code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void updateIndices(ApiType oldObj, ApiType newObj, String key) { // if we got an old object, we need to remove it before we can add // it again. if (oldObj != null) { deleteFromIndices(oldObj, key); } for (Map.Entry<String, Function<ApiType, List<String>>> indexEntry : indexers.entrySet()) { String indexName = indexEntry.getKey(); Function<ApiType, List<String>> indexFunc = indexEntry.getValue(); List<String> indexValues = indexFunc.apply(newObj); if (io.kubernetes.client.util.common.Collections.isEmptyCollection(indexValues)) { continue; } Map<String, Set<String>> index = this.indices.computeIfAbsent(indexName, k -> new HashMap<>()); for (String indexValue : indexValues) { Set<String> indexSet = index.computeIfAbsent(indexValue, k -> new HashSet<>()); indexSet.add(key); } } }
class class_name[name] begin[{] method[updateIndices, return_type[void], modifier[public], parameter[oldObj, newObj, key]] begin[{] if[binary_operation[member[.oldObj], !=, literal[null]]] begin[{] call[.deleteFromIndices, parameter[member[.oldObj], member[.key]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=indexEntry, selectors=[], type_arguments=None), name=indexName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=indexEntry, selectors=[], type_arguments=None), name=indexFunc)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ApiType, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=Function, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=newObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=indexFunc, selectors=[], type_arguments=None), name=indexValues)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=indexValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmptyCollection, postfix_operators=[], prefix_operators=[], qualifier=io.kubernetes.client.util.common.Collections, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=indices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=indexName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), parameters=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=computeIfAbsent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=index)], modifiers=set(), 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=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=indexValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None)), parameters=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=computeIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), name=indexSet)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=indexSet, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=indexValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=indexValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=indexers, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=indexEntry)], 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=ApiType, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=Function, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[updateIndices] operator[SEP] identifier[ApiType] identifier[oldObj] , identifier[ApiType] identifier[newObj] , identifier[String] identifier[key] operator[SEP] { Keyword[if] operator[SEP] identifier[oldObj] operator[!=] Other[null] operator[SEP] { identifier[deleteFromIndices] operator[SEP] identifier[oldObj] , identifier[key] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Function] operator[<] identifier[ApiType] , identifier[List] operator[<] identifier[String] operator[>] operator[>] operator[>] identifier[indexEntry] operator[:] identifier[indexers] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[indexName] operator[=] identifier[indexEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Function] operator[<] identifier[ApiType] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[indexFunc] operator[=] identifier[indexEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[indexValues] operator[=] identifier[indexFunc] operator[SEP] identifier[apply] operator[SEP] identifier[newObj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[io] operator[SEP] identifier[kubernetes] operator[SEP] identifier[client] operator[SEP] identifier[util] operator[SEP] identifier[common] operator[SEP] identifier[Collections] operator[SEP] identifier[isEmptyCollection] operator[SEP] identifier[indexValues] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[index] operator[=] Keyword[this] operator[SEP] identifier[indices] operator[SEP] identifier[computeIfAbsent] operator[SEP] identifier[indexName] , identifier[k] operator[->] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[indexValue] operator[:] identifier[indexValues] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[indexSet] operator[=] identifier[index] operator[SEP] identifier[computeIfAbsent] operator[SEP] identifier[indexValue] , identifier[k] operator[->] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[indexSet] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] } } }
public boolean addAll(Collection<? extends T> c, Object identifier) { checkNotNullArgument(c); if (isPublisherThread()) { boolean changed = false; if (identifier != null) { final Long id = subscriberIdentifiers.get(identifier); checkNotNullIdentifier(id); changed = queues.get(id).addAll(c); } else { for (Queue<T> queue : queues.values()) { if (queue.addAll(c)) { changed = true; } } } return changed; } return getCurrentThreadQueue().addAll(c); }
class class_name[name] begin[{] method[addAll, return_type[type[boolean]], modifier[public], parameter[c, identifier]] begin[{] call[.checkNotNullArgument, parameter[member[.c]]] if[call[.isPublisherThread, parameter[]]] begin[{] local_variable[type[boolean], changed] if[binary_operation[member[.identifier], !=, literal[null]]] begin[{] local_variable[type[Long], id] call[.checkNotNullIdentifier, parameter[member[.id]]] assign[member[.changed], call[queues.get, parameter[member[.id]]]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=queue, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=queues, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=queue)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Queue, sub_type=None))), label=None) end[}] return[member[.changed]] else begin[{] None end[}] return[call[.getCurrentThreadQueue, parameter[]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[addAll] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[c] , identifier[Object] identifier[identifier] operator[SEP] { identifier[checkNotNullArgument] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPublisherThread] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[changed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[identifier] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[Long] identifier[id] operator[=] identifier[subscriberIdentifiers] operator[SEP] identifier[get] operator[SEP] identifier[identifier] operator[SEP] operator[SEP] identifier[checkNotNullIdentifier] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[changed] operator[=] identifier[queues] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[Queue] operator[<] identifier[T] operator[>] identifier[queue] operator[:] identifier[queues] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[queue] operator[SEP] identifier[addAll] operator[SEP] identifier[c] operator[SEP] operator[SEP] { identifier[changed] operator[=] literal[boolean] operator[SEP] } } } Keyword[return] identifier[changed] operator[SEP] } Keyword[return] identifier[getCurrentThreadQueue] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[c] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.ECA__CAT_NAME: return getCATName(); case AfplibPackage.ECA__TRIPLETS: return getTriplets(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ECA__CAT_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getCATName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=ECA__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[ECA__CAT_NAME] operator[:] Keyword[return] identifier[getCATName] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[ECA__TRIPLETS] operator[:] Keyword[return] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public void sendMessage(String message) { try { getChat().sendMessage(message); } catch (XMPPException | NotConnectedException e) { e.printStackTrace(); } }
class class_name[name] begin[{] method[sendMessage, return_type[void], modifier[public], parameter[message]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getChat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['XMPPException', 'NotConnectedException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[sendMessage] operator[SEP] identifier[String] identifier[message] operator[SEP] { Keyword[try] { identifier[getChat] operator[SEP] operator[SEP] operator[SEP] identifier[sendMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[XMPPException] operator[|] identifier[NotConnectedException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
private static <T> Supplier<T> memoize(Supplier<T> original) { return new Supplier<T>() { Supplier<T> mDelegate = this::firstTime; boolean mInitialized; public T get() { return mDelegate.get(); } private synchronized T firstTime() { if (!mInitialized) { T value = original.get(); mDelegate = () -> value; mInitialized = true; } return mDelegate.get(); } }; }
class class_name[name] begin[{] method[memoize, return_type[type[Supplier]], modifier[private static], parameter[original]] begin[{] return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodReference(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), method=MemberReference(member=firstTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), name=mDelegate)], documentation=None, modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Supplier, sub_type=None)), FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=mInitialized)], documentation=None, modifiers=set(), type=BasicType(dimensions=[], name=boolean)), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=mDelegate, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=get, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[IfStatement(condition=MemberReference(member=mInitialized, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=original, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mDelegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=LambdaExpression(body=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), parameters=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=mDelegate, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'synchronized', 'private'}, name=firstTime, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), throws=None, type_parameters=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=T, sub_type=None))], dimensions=None, name=Supplier, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[Supplier] operator[<] identifier[T] operator[>] identifier[memoize] operator[SEP] identifier[Supplier] operator[<] identifier[T] operator[>] identifier[original] operator[SEP] { Keyword[return] Keyword[new] identifier[Supplier] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] { identifier[Supplier] operator[<] identifier[T] operator[>] identifier[mDelegate] operator[=] Keyword[this] operator[::] identifier[firstTime] operator[SEP] Keyword[boolean] identifier[mInitialized] operator[SEP] Keyword[public] identifier[T] identifier[get] operator[SEP] operator[SEP] { Keyword[return] identifier[mDelegate] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[private] Keyword[synchronized] identifier[T] identifier[firstTime] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[mInitialized] operator[SEP] { identifier[T] identifier[value] operator[=] identifier[original] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[mDelegate] operator[=] operator[SEP] operator[SEP] operator[->] identifier[value] operator[SEP] identifier[mInitialized] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[mDelegate] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
private void visitClass(final Class clazz) { Method[] methods = clazz.getDeclaredMethods(); for (Method method : methods) { Class<?>[] exceptionTypes = method.getExceptionTypes(); String[] exceptions = new String[exceptionTypes.length]; for (int i = 0; i < exceptions.length; i++) { exceptions[i] = BytecodeHelper.getClassInternalName(exceptionTypes[i]); } // for each method defined in the class, generate the appropriate delegation bytecode visitMethod(method.getModifiers(), method.getName(), BytecodeHelper.getMethodDescriptor(method.getReturnType(), method.getParameterTypes()), null, exceptions); } Constructor[] constructors = clazz.getDeclaredConstructors(); for (Constructor method : constructors) { Class<?>[] exceptionTypes = method.getExceptionTypes(); String[] exceptions = new String[exceptionTypes.length]; for (int i = 0; i < exceptions.length; i++) { exceptions[i] = BytecodeHelper.getClassInternalName(exceptionTypes[i]); } // for each method defined in the class, generate the appropriate delegation bytecode visitMethod(method.getModifiers(), "<init>", BytecodeHelper.getMethodDescriptor(Void.TYPE, method.getParameterTypes()), null, exceptions); } for (Class intf : clazz.getInterfaces()) { visitClass(intf); } Class superclass = clazz.getSuperclass(); if (superclass != null) visitClass(superclass); // Ultimately, methods can be available in the closure map which are not defined by the superclass // nor the interfaces for (Map.Entry<String, Boolean> entry : delegatedClosures.entrySet()) { Boolean visited = entry.getValue(); if (!visited) { String name = entry.getKey(); if (!"*".equals(name)) { // generate a new method visitMethod(ACC_PUBLIC, name, "([Ljava/lang/Object;)Ljava/lang/Object;", null, null); } } } }
class class_name[name] begin[{] method[visitClass, return_type[void], modifier[private], parameter[clazz]] begin[{] local_variable[type[Method], methods] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getExceptionTypes, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=exceptionTypes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[None], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=exceptionTypes, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=exceptions)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=exceptionTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getClassInternalName, postfix_operators=[], prefix_operators=[], qualifier=BytecodeHelper, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=exceptions, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReturnType, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None)], member=getMethodDescriptor, postfix_operators=[], prefix_operators=[], qualifier=BytecodeHelper, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=exceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None) local_variable[type[Constructor], constructors] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getExceptionTypes, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=exceptionTypes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[None], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=exceptionTypes, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=exceptions)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=exceptionTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getClassInternalName, postfix_operators=[], prefix_operators=[], qualifier=BytecodeHelper, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=exceptions, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<init>"), MethodInvocation(arguments=[MemberReference(member=TYPE, postfix_operators=[], prefix_operators=[], qualifier=Void, selectors=[]), MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None)], member=getMethodDescriptor, postfix_operators=[], prefix_operators=[], qualifier=BytecodeHelper, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=exceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=constructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Constructor, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=intf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getInterfaces, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=intf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))), label=None) local_variable[type[Class], superclass] if[binary_operation[member[.superclass], !=, literal[null]]] begin[{] call[.visitClass, parameter[member[.superclass]]] 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=visited)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)), IfStatement(condition=MemberReference(member=visited, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, 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)], value="*"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ACC_PUBLIC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="([Ljava/lang/Object;)Ljava/lang/Object;"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=visitMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=delegatedClosures, 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=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[visitClass] operator[SEP] Keyword[final] identifier[Class] identifier[clazz] operator[SEP] { identifier[Method] operator[SEP] operator[SEP] identifier[methods] operator[=] identifier[clazz] operator[SEP] identifier[getDeclaredMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Method] identifier[method] operator[:] identifier[methods] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[exceptionTypes] operator[=] identifier[method] operator[SEP] identifier[getExceptionTypes] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[exceptions] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[exceptionTypes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[exceptions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[exceptions] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[BytecodeHelper] operator[SEP] identifier[getClassInternalName] operator[SEP] identifier[exceptionTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } identifier[visitMethod] operator[SEP] identifier[method] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[BytecodeHelper] operator[SEP] identifier[getMethodDescriptor] operator[SEP] identifier[method] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] , Other[null] , identifier[exceptions] operator[SEP] operator[SEP] } identifier[Constructor] operator[SEP] operator[SEP] identifier[constructors] operator[=] identifier[clazz] operator[SEP] identifier[getDeclaredConstructors] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Constructor] identifier[method] operator[:] identifier[constructors] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[exceptionTypes] operator[=] identifier[method] operator[SEP] identifier[getExceptionTypes] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[exceptions] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[exceptionTypes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[exceptions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[exceptions] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[BytecodeHelper] operator[SEP] identifier[getClassInternalName] operator[SEP] identifier[exceptionTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } identifier[visitMethod] operator[SEP] identifier[method] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] , literal[String] , identifier[BytecodeHelper] operator[SEP] identifier[getMethodDescriptor] operator[SEP] identifier[Void] operator[SEP] identifier[TYPE] , identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] , Other[null] , identifier[exceptions] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Class] identifier[intf] operator[:] identifier[clazz] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] { identifier[visitClass] operator[SEP] identifier[intf] operator[SEP] operator[SEP] } identifier[Class] identifier[superclass] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[superclass] operator[!=] Other[null] operator[SEP] identifier[visitClass] operator[SEP] identifier[superclass] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Boolean] operator[>] identifier[entry] operator[:] identifier[delegatedClosures] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Boolean] identifier[visited] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[visited] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[visitMethod] operator[SEP] identifier[ACC_PUBLIC] , identifier[name] , literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] } } } }
public static Style grey() { final Style style = new Style(); style.color = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_GREY); return style; }
class class_name[name] begin[{] method[grey, return_type[type[Style]], modifier[public static], parameter[]] begin[{] local_variable[type[Style], style] assign[member[style.color], call[PaletteUtils.getSolidColor, parameter[member[PaletteUtils.MATERIAL_GREY]]]] return[member[.style]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Style] identifier[grey] operator[SEP] operator[SEP] { Keyword[final] identifier[Style] identifier[style] operator[=] Keyword[new] identifier[Style] operator[SEP] operator[SEP] operator[SEP] identifier[style] operator[SEP] identifier[color] operator[=] identifier[PaletteUtils] operator[SEP] identifier[getSolidColor] operator[SEP] identifier[PaletteUtils] operator[SEP] identifier[MATERIAL_GREY] operator[SEP] operator[SEP] Keyword[return] identifier[style] operator[SEP] }
public void inlinePrintNoQuotes(Object o) { if(inline.length() > 0) { inline.append(SEPARATOR); } // remove newlines String str = o.toString().replace(NEWLINE, " "); // escaping str = str.replace("\\", "\\\\").replace("\"", "\\\""); inline.append(str); }
class class_name[name] begin[{] method[inlinePrintNoQuotes, return_type[void], modifier[public], parameter[o]] begin[{] if[binary_operation[call[inline.length, parameter[]], >, literal[0]]] begin[{] call[inline.append, parameter[member[.SEPARATOR]]] else begin[{] None end[}] local_variable[type[String], str] assign[member[.str], call[str.replace, parameter[literal["\\"], literal["\\\\"]]]] call[inline.append, parameter[member[.str]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[inlinePrintNoQuotes] operator[SEP] identifier[Object] identifier[o] operator[SEP] { Keyword[if] operator[SEP] identifier[inline] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[inline] operator[SEP] identifier[append] operator[SEP] identifier[SEPARATOR] operator[SEP] operator[SEP] } identifier[String] identifier[str] operator[=] identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[NEWLINE] , literal[String] operator[SEP] operator[SEP] identifier[str] operator[=] identifier[str] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[inline] operator[SEP] identifier[append] operator[SEP] identifier[str] operator[SEP] operator[SEP] }
public String convertIPBackToString(long ip) { StringBuffer sb = new StringBuffer(16); sb.append(Long.toString((ip >> 24)& 0xFF)); sb.append('.'); sb.append(Long.toString((ip >> 16)& 0xFF)); sb.append('.'); sb.append(Long.toString((ip >> 8) & 0xFF)); sb.append('.'); sb.append(Long.toString(ip & 0xFF)); return sb.toString(); }
class class_name[name] begin[{] method[convertIPBackToString, return_type[type[String]], modifier[public], parameter[ip]] begin[{] local_variable[type[StringBuffer], sb] call[sb.append, parameter[call[Long.toString, parameter[binary_operation[binary_operation[member[.ip], >>, literal[24]], &, literal[0xFF]]]]]] call[sb.append, parameter[literal['.']]] call[sb.append, parameter[call[Long.toString, parameter[binary_operation[binary_operation[member[.ip], >>, literal[16]], &, literal[0xFF]]]]]] call[sb.append, parameter[literal['.']]] call[sb.append, parameter[call[Long.toString, parameter[binary_operation[binary_operation[member[.ip], >>, literal[8]], &, literal[0xFF]]]]]] call[sb.append, parameter[literal['.']]] call[sb.append, parameter[call[Long.toString, parameter[binary_operation[member[.ip], &, literal[0xFF]]]]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[convertIPBackToString] operator[SEP] Keyword[long] identifier[ip] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[16] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Long] operator[SEP] identifier[toString] operator[SEP] operator[SEP] identifier[ip] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Long] operator[SEP] identifier[toString] operator[SEP] operator[SEP] identifier[ip] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Long] operator[SEP] identifier[toString] operator[SEP] operator[SEP] identifier[ip] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[ip] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected void onVisitLookupSwitchInsn(Label defaultTarget, int[] key, Label[] label) { super.visitLookupSwitchInsn(defaultTarget, key, label); }
class class_name[name] begin[{] method[onVisitLookupSwitchInsn, return_type[void], modifier[protected], parameter[defaultTarget, key, label]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=defaultTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitLookupSwitchInsn, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[onVisitLookupSwitchInsn] operator[SEP] identifier[Label] identifier[defaultTarget] , Keyword[int] operator[SEP] operator[SEP] identifier[key] , identifier[Label] operator[SEP] operator[SEP] identifier[label] operator[SEP] { Keyword[super] operator[SEP] identifier[visitLookupSwitchInsn] operator[SEP] identifier[defaultTarget] , identifier[key] , identifier[label] operator[SEP] operator[SEP] }
private static boolean endsWith(String str, String suffix, boolean ignoreCase) { if (str == null || suffix == null) { return (str == null && suffix == null); } if (suffix.length() > str.length()) { return false; } int strOffset = str.length() - suffix.length(); return str.regionMatches(ignoreCase, strOffset, suffix, 0, suffix.length()); }
class class_name[name] begin[{] method[endsWith, return_type[type[boolean]], modifier[private static], parameter[str, suffix, ignoreCase]] begin[{] if[binary_operation[binary_operation[member[.str], ==, literal[null]], ||, binary_operation[member[.suffix], ==, literal[null]]]] begin[{] return[binary_operation[binary_operation[member[.str], ==, literal[null]], &&, binary_operation[member[.suffix], ==, literal[null]]]] else begin[{] None end[}] if[binary_operation[call[suffix.length, parameter[]], >, call[str.length, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], strOffset] return[call[str.regionMatches, parameter[member[.ignoreCase], member[.strOffset], member[.suffix], literal[0], call[suffix.length, parameter[]]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[endsWith] operator[SEP] identifier[String] identifier[str] , identifier[String] identifier[suffix] , Keyword[boolean] identifier[ignoreCase] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[||] identifier[suffix] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] identifier[str] operator[==] Other[null] operator[&&] identifier[suffix] operator[==] Other[null] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[suffix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[int] identifier[strOffset] operator[=] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[suffix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[str] operator[SEP] identifier[regionMatches] operator[SEP] identifier[ignoreCase] , identifier[strOffset] , identifier[suffix] , Other[0] , identifier[suffix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public CompletableFuture<Void> snapshot() { RaftPartitionServer server = this.server; if (server != null) { return server.snapshot(); } return CompletableFuture.completedFuture(null); }
class class_name[name] begin[{] method[snapshot, return_type[type[CompletableFuture]], modifier[public], parameter[]] begin[{] local_variable[type[RaftPartitionServer], server] if[binary_operation[member[.server], !=, literal[null]]] begin[{] return[call[server.snapshot, parameter[]]] else begin[{] None end[}] return[call[CompletableFuture.completedFuture, parameter[literal[null]]]] end[}] END[}]
Keyword[public] identifier[CompletableFuture] operator[<] identifier[Void] operator[>] identifier[snapshot] operator[SEP] operator[SEP] { identifier[RaftPartitionServer] identifier[server] operator[=] Keyword[this] operator[SEP] identifier[server] operator[SEP] Keyword[if] operator[SEP] identifier[server] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[server] operator[SEP] identifier[snapshot] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[CompletableFuture] operator[SEP] identifier[completedFuture] operator[SEP] Other[null] operator[SEP] operator[SEP] }
private byte[] subColumnNameAsByteArray(String superColumn, CfDef cfDef) { return TBaseHelper.byteBufferToByteArray(subColumnNameAsBytes(superColumn, cfDef)); }
class class_name[name] begin[{] method[subColumnNameAsByteArray, return_type[type[byte]], modifier[private], parameter[superColumn, cfDef]] begin[{] return[call[TBaseHelper.byteBufferToByteArray, parameter[call[.subColumnNameAsBytes, parameter[member[.superColumn], member[.cfDef]]]]]] end[}] END[}]
Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[subColumnNameAsByteArray] operator[SEP] identifier[String] identifier[superColumn] , identifier[CfDef] identifier[cfDef] operator[SEP] { Keyword[return] identifier[TBaseHelper] operator[SEP] identifier[byteBufferToByteArray] operator[SEP] identifier[subColumnNameAsBytes] operator[SEP] identifier[superColumn] , identifier[cfDef] operator[SEP] operator[SEP] operator[SEP] }
public Table getTable(String tableName) { // [START ] Table table = dataset.get(tableName); // [END ] return table; }
class class_name[name] begin[{] method[getTable, return_type[type[Table]], modifier[public], parameter[tableName]] begin[{] local_variable[type[Table], table] return[member[.table]] end[}] END[}]
Keyword[public] identifier[Table] identifier[getTable] operator[SEP] identifier[String] identifier[tableName] operator[SEP] { identifier[Table] identifier[table] operator[=] identifier[dataset] operator[SEP] identifier[get] operator[SEP] identifier[tableName] operator[SEP] operator[SEP] Keyword[return] identifier[table] operator[SEP] }
protected NodeData createBodyStyle() { NodeData ret = createBlockStyle(); TermFactory tf = CSSFactory.getTermFactory(); ret.push(createDeclaration("background-color", tf.createColor(255, 255, 255))); return ret; }
class class_name[name] begin[{] method[createBodyStyle, return_type[type[NodeData]], modifier[protected], parameter[]] begin[{] local_variable[type[NodeData], ret] local_variable[type[TermFactory], tf] call[ret.push, parameter[call[.createDeclaration, parameter[literal["background-color"], call[tf.createColor, parameter[literal[255], literal[255], literal[255]]]]]]] return[member[.ret]] end[}] END[}]
Keyword[protected] identifier[NodeData] identifier[createBodyStyle] operator[SEP] operator[SEP] { identifier[NodeData] identifier[ret] operator[=] identifier[createBlockStyle] operator[SEP] operator[SEP] operator[SEP] identifier[TermFactory] identifier[tf] operator[=] identifier[CSSFactory] operator[SEP] identifier[getTermFactory] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[push] operator[SEP] identifier[createDeclaration] operator[SEP] literal[String] , identifier[tf] operator[SEP] identifier[createColor] operator[SEP] Other[255] , Other[255] , Other[255] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
private void commonInit() { listenerFlag = HTTP_SESSION_NO_LISTENER; deferWriteUntilNextTick = 0; mLastWriteTime = -1; removingSessionFromCache = false; _refCount = 0; _version = initialCacheId; }
class class_name[name] begin[{] method[commonInit, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.listenerFlag], member[.HTTP_SESSION_NO_LISTENER]] assign[member[.deferWriteUntilNextTick], literal[0]] assign[member[.mLastWriteTime], literal[1]] assign[member[.removingSessionFromCache], literal[false]] assign[member[._refCount], literal[0]] assign[member[._version], member[.initialCacheId]] end[}] END[}]
Keyword[private] Keyword[void] identifier[commonInit] operator[SEP] operator[SEP] { identifier[listenerFlag] operator[=] identifier[HTTP_SESSION_NO_LISTENER] operator[SEP] identifier[deferWriteUntilNextTick] operator[=] Other[0] operator[SEP] identifier[mLastWriteTime] operator[=] operator[-] Other[1] operator[SEP] identifier[removingSessionFromCache] operator[=] literal[boolean] operator[SEP] identifier[_refCount] operator[=] Other[0] operator[SEP] identifier[_version] operator[=] identifier[initialCacheId] operator[SEP] }
public Districts searchByState(String state) throws OpenStatesException { return api.query(new MethodMap("districts", state), null, Districts.class); }
class class_name[name] begin[{] method[searchByState, return_type[type[Districts]], modifier[public], parameter[state]] begin[{] return[call[api.query, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="districts"), MemberReference(member=state, 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=MethodMap, sub_type=None)), literal[null], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Districts, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Districts] identifier[searchByState] operator[SEP] identifier[String] identifier[state] operator[SEP] Keyword[throws] identifier[OpenStatesException] { Keyword[return] identifier[api] operator[SEP] identifier[query] operator[SEP] Keyword[new] identifier[MethodMap] operator[SEP] literal[String] , identifier[state] operator[SEP] , Other[null] , identifier[Districts] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void execute(Runnable command, long timeout, TimeUnit unit) { submittedCount.incrementAndGet(); try { super.execute(command); } catch (RejectedExecutionException rx) { // NOSONAR // not to re-throw this exception because this is only used to find out whether the pool is full, not for a // exception purpose final ControllableQueue queue = (ControllableQueue) super.getQueue(); try { if (!queue.force(command, timeout, unit)) { submittedCount.decrementAndGet(); throw new RejectedExecutionException("Queue capacity is full."); } } catch (InterruptedException ignore) { submittedCount.decrementAndGet(); throw new RejectedExecutionException(ignore); } } }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[command, timeout, unit]] begin[{] call[submittedCount.incrementAndGet, parameter[]] TryStatement(block=[StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=SuperMethodInvocation(arguments=[], member=getQueue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ControllableQueue, sub_type=None)), name=queue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ControllableQueue, sub_type=None)), TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=force, postfix_operators=[], prefix_operators=['!'], qualifier=queue, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=decrementAndGet, postfix_operators=[], prefix_operators=[], qualifier=submittedCount, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Queue capacity is full.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RejectedExecutionException, sub_type=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=decrementAndGet, postfix_operators=[], prefix_operators=[], qualifier=submittedCount, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ignore, 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=RejectedExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['InterruptedException']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=rx, types=['RejectedExecutionException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[Runnable] identifier[command] , Keyword[long] identifier[timeout] , identifier[TimeUnit] identifier[unit] operator[SEP] { identifier[submittedCount] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[super] operator[SEP] identifier[execute] operator[SEP] identifier[command] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RejectedExecutionException] identifier[rx] operator[SEP] { Keyword[final] identifier[ControllableQueue] identifier[queue] operator[=] operator[SEP] identifier[ControllableQueue] operator[SEP] Keyword[super] operator[SEP] identifier[getQueue] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[queue] operator[SEP] identifier[force] operator[SEP] identifier[command] , identifier[timeout] , identifier[unit] operator[SEP] operator[SEP] { identifier[submittedCount] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RejectedExecutionException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ignore] operator[SEP] { identifier[submittedCount] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RejectedExecutionException] operator[SEP] identifier[ignore] operator[SEP] operator[SEP] } } }
public Observable<ServiceResponseWithHeaders<StreamingJobInner, StreamingJobsUpdateHeaders>> updateWithServiceResponseAsync(String resourceGroupName, String jobName, StreamingJobInner streamingJob, String ifMatch) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (jobName == null) { throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); } if (streamingJob == null) { throw new IllegalArgumentException("Parameter streamingJob is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(streamingJob); return service.update(this.client.subscriptionId(), resourceGroupName, jobName, streamingJob, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<StreamingJobInner, StreamingJobsUpdateHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<StreamingJobInner, StreamingJobsUpdateHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<StreamingJobInner, StreamingJobsUpdateHeaders> clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[updateWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, jobName, streamingJob, ifMatch]] begin[{] 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[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[.jobName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter jobName 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[.streamingJob], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter streamingJob 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[}] call[Validator.validate, parameter[member[.streamingJob]]] return[call[service.update, parameter[THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.resourceGroupName], member[.jobName], member[.streamingJob], member[.ifMatch], 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[ServiceResponseWithHeaders] operator[<] identifier[StreamingJobInner] , identifier[StreamingJobsUpdateHeaders] operator[>] operator[>] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[jobName] , identifier[StreamingJobInner] identifier[streamingJob] , identifier[String] identifier[ifMatch] 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] 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[jobName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[streamingJob] 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] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[streamingJob] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[update] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[resourceGroupName] , identifier[jobName] , identifier[streamingJob] , identifier[ifMatch] , 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[ServiceResponseWithHeaders] operator[<] identifier[StreamingJobInner] , identifier[StreamingJobsUpdateHeaders] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[StreamingJobInner] , identifier[StreamingJobsUpdateHeaders] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponseWithHeaders] operator[<] identifier[StreamingJobInner] , identifier[StreamingJobsUpdateHeaders] operator[>] identifier[clientResponse] operator[=] identifier[updateDelegate] 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] }
public boolean getExclusiveMin() { if (property instanceof AbstractNumericProperty) { AbstractNumericProperty numericProperty = (AbstractNumericProperty) property; return BooleanUtils.isTrue(numericProperty.getExclusiveMinimum()); } return false; }
class class_name[name] begin[{] method[getExclusiveMin, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.property], instanceof, type[AbstractNumericProperty]]] begin[{] local_variable[type[AbstractNumericProperty], numericProperty] return[call[BooleanUtils.isTrue, parameter[call[numericProperty.getExclusiveMinimum, parameter[]]]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[getExclusiveMin] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[property] Keyword[instanceof] identifier[AbstractNumericProperty] operator[SEP] { identifier[AbstractNumericProperty] identifier[numericProperty] operator[=] operator[SEP] identifier[AbstractNumericProperty] operator[SEP] identifier[property] operator[SEP] Keyword[return] identifier[BooleanUtils] operator[SEP] identifier[isTrue] operator[SEP] identifier[numericProperty] operator[SEP] identifier[getExclusiveMinimum] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void remove(int amount) { int size = stack.size(); for (int i=size-1; i>size-1-amount; i--) { popWithMessage(i); } }
class class_name[name] begin[{] method[remove, return_type[void], modifier[public], parameter[amount]] begin[{] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=popWithMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operandr=MemberReference(member=amount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[remove] operator[SEP] Keyword[int] identifier[amount] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[stack] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[size] operator[-] Other[1] operator[SEP] identifier[i] operator[>] identifier[size] operator[-] Other[1] operator[-] identifier[amount] operator[SEP] identifier[i] operator[--] operator[SEP] { identifier[popWithMessage] operator[SEP] identifier[i] operator[SEP] operator[SEP] } }
public final String getChainIdentity(String separator) throws KSIException { StringBuilder identity = new StringBuilder(); for (int i = chain.size()-1; i >=0 ; i--) { AggregationChainLink aggregationChainLink = chain.get(i); Identity linkIdentity = aggregationChainLink.getLinkIdentity(); String id = linkIdentity == null ? "" : linkIdentity.getDecodedClientId(); if (identity.length() > 0 && id.length() > 0) { identity.append(separator); } identity.append(id); } return identity.toString(); }
class class_name[name] begin[{] method[getChainIdentity, return_type[type[String]], modifier[final public], parameter[separator]] begin[{] local_variable[type[StringBuilder], identity] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=chain, selectors=[], type_arguments=None), name=aggregationChainLink)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AggregationChainLink, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLinkIdentity, postfix_operators=[], prefix_operators=[], qualifier=aggregationChainLink, selectors=[], type_arguments=None), name=linkIdentity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Identity, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=linkIdentity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getDecodedClientId, postfix_operators=[], prefix_operators=[], qualifier=linkIdentity, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=identity, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=identity, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=identity, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=chain, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[identity.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[String] identifier[getChainIdentity] operator[SEP] identifier[String] identifier[separator] operator[SEP] Keyword[throws] identifier[KSIException] { identifier[StringBuilder] identifier[identity] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[chain] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { identifier[AggregationChainLink] identifier[aggregationChainLink] operator[=] identifier[chain] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Identity] identifier[linkIdentity] operator[=] identifier[aggregationChainLink] operator[SEP] identifier[getLinkIdentity] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] identifier[linkIdentity] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[linkIdentity] operator[SEP] identifier[getDecodedClientId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[identity] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[id] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[identity] operator[SEP] identifier[append] operator[SEP] identifier[separator] operator[SEP] operator[SEP] } identifier[identity] operator[SEP] identifier[append] operator[SEP] identifier[id] operator[SEP] operator[SEP] } Keyword[return] identifier[identity] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private Boolean getBooleanProperty(Properties prop, String name) { String propertyValue = prop.getProperty(name); return Boolean.parseBoolean(propertyValue); }
class class_name[name] begin[{] method[getBooleanProperty, return_type[type[Boolean]], modifier[private], parameter[prop, name]] begin[{] local_variable[type[String], propertyValue] return[call[Boolean.parseBoolean, parameter[member[.propertyValue]]]] end[}] END[}]
Keyword[private] identifier[Boolean] identifier[getBooleanProperty] operator[SEP] identifier[Properties] identifier[prop] , identifier[String] identifier[name] operator[SEP] { identifier[String] identifier[propertyValue] operator[=] identifier[prop] operator[SEP] identifier[getProperty] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[propertyValue] operator[SEP] operator[SEP] }
private String getTransformedAttrName(final String attrName) { return attrNameMapper.containsKey(attrName) ? attrNameMapper.get(attrName) : attrName; }
class class_name[name] begin[{] method[getTransformedAttrName, return_type[type[String]], modifier[private], parameter[attrName]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=attrName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=attrNameMapper, selectors=[], type_arguments=None), if_false=MemberReference(member=attrName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=attrName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=attrNameMapper, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[private] identifier[String] identifier[getTransformedAttrName] operator[SEP] Keyword[final] identifier[String] identifier[attrName] operator[SEP] { Keyword[return] identifier[attrNameMapper] operator[SEP] identifier[containsKey] operator[SEP] identifier[attrName] operator[SEP] operator[?] identifier[attrNameMapper] operator[SEP] identifier[get] operator[SEP] identifier[attrName] operator[SEP] operator[:] identifier[attrName] operator[SEP] }
public static HttpPipeline createDefaultPipeline(Class<?> swaggerInterface, AsyncServiceClientCredentials credentials) { return createDefaultPipeline(swaggerInterface, new AsyncCredentialsPolicy(credentials)); }
class class_name[name] begin[{] method[createDefaultPipeline, return_type[type[HttpPipeline]], modifier[public static], parameter[swaggerInterface, credentials]] begin[{] return[call[.createDefaultPipeline, parameter[member[.swaggerInterface], ClassCreator(arguments=[MemberReference(member=credentials, 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=AsyncCredentialsPolicy, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HttpPipeline] identifier[createDefaultPipeline] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[swaggerInterface] , identifier[AsyncServiceClientCredentials] identifier[credentials] operator[SEP] { Keyword[return] identifier[createDefaultPipeline] operator[SEP] identifier[swaggerInterface] , Keyword[new] identifier[AsyncCredentialsPolicy] operator[SEP] identifier[credentials] operator[SEP] operator[SEP] operator[SEP] }
private void buildReplacementNodesFromTranslation(MsgNode msg, SoyMsg translation) { currReplacementNodes = Lists.newArrayList(); for (SoyMsgPart msgPart : translation.getParts()) { if (msgPart instanceof SoyMsgRawTextPart) { // Append a new RawTextNode to the currReplacementNodes list. String rawText = ((SoyMsgRawTextPart) msgPart).getRawText(); currReplacementNodes.add( new RawTextNode(nodeIdGen.genId(), rawText, msg.getSourceLocation())); } else if (msgPart instanceof SoyMsgPlaceholderPart) { // Get the representative placeholder node and iterate through its contents. String placeholderName = ((SoyMsgPlaceholderPart) msgPart).getPlaceholderName(); MsgPlaceholderNode placeholderNode = msg.getRepPlaceholderNode(placeholderName); for (StandaloneNode contentNode : placeholderNode.getChildren()) { // If the content node is a MsgHtmlTagNode, it needs to be replaced by a number of // consecutive siblings. This is done by visiting the MsgHtmlTagNode. Otherwise, we // simply add the content node to the currReplacementNodes list being built. if (contentNode instanceof MsgHtmlTagNode) { currReplacementNodes.addAll(((MsgHtmlTagNode) contentNode).getChildren()); } else { currReplacementNodes.add(contentNode); } } } else { throw new AssertionError(); } } }
class class_name[name] begin[{] method[buildReplacementNodesFromTranslation, return_type[void], modifier[private], parameter[msg, translation]] begin[{] assign[member[.currReplacementNodes], call[Lists.newArrayList, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=msgPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SoyMsgRawTextPart, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=msgPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SoyMsgPlaceholderPart, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, 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=AssertionError, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=msgPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SoyMsgPlaceholderPart, sub_type=None)), name=placeholderName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=placeholderName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRepPlaceholderNode, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), name=placeholderNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MsgPlaceholderNode, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=contentNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=MsgHtmlTagNode, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contentNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=currReplacementNodes, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=contentNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MsgHtmlTagNode, sub_type=None))], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=currReplacementNodes, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=placeholderNode, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=contentNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StandaloneNode, sub_type=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=msgPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SoyMsgRawTextPart, sub_type=None)), name=rawText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=genId, postfix_operators=[], prefix_operators=[], qualifier=nodeIdGen, selectors=[], type_arguments=None), MemberReference(member=rawText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSourceLocation, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RawTextNode, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=currReplacementNodes, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getParts, postfix_operators=[], prefix_operators=[], qualifier=translation, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=msgPart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SoyMsgPart, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[buildReplacementNodesFromTranslation] operator[SEP] identifier[MsgNode] identifier[msg] , identifier[SoyMsg] identifier[translation] operator[SEP] { identifier[currReplacementNodes] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SoyMsgPart] identifier[msgPart] operator[:] identifier[translation] operator[SEP] identifier[getParts] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[msgPart] Keyword[instanceof] identifier[SoyMsgRawTextPart] operator[SEP] { identifier[String] identifier[rawText] operator[=] operator[SEP] operator[SEP] identifier[SoyMsgRawTextPart] operator[SEP] identifier[msgPart] operator[SEP] operator[SEP] identifier[getRawText] operator[SEP] operator[SEP] operator[SEP] identifier[currReplacementNodes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[RawTextNode] operator[SEP] identifier[nodeIdGen] operator[SEP] identifier[genId] operator[SEP] operator[SEP] , identifier[rawText] , identifier[msg] operator[SEP] identifier[getSourceLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[msgPart] Keyword[instanceof] identifier[SoyMsgPlaceholderPart] operator[SEP] { identifier[String] identifier[placeholderName] operator[=] operator[SEP] operator[SEP] identifier[SoyMsgPlaceholderPart] operator[SEP] identifier[msgPart] operator[SEP] operator[SEP] identifier[getPlaceholderName] operator[SEP] operator[SEP] operator[SEP] identifier[MsgPlaceholderNode] identifier[placeholderNode] operator[=] identifier[msg] operator[SEP] identifier[getRepPlaceholderNode] operator[SEP] identifier[placeholderName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StandaloneNode] identifier[contentNode] operator[:] identifier[placeholderNode] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[contentNode] Keyword[instanceof] identifier[MsgHtmlTagNode] operator[SEP] { identifier[currReplacementNodes] operator[SEP] identifier[addAll] operator[SEP] operator[SEP] operator[SEP] identifier[MsgHtmlTagNode] operator[SEP] identifier[contentNode] operator[SEP] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[currReplacementNodes] operator[SEP] identifier[add] operator[SEP] identifier[contentNode] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] operator[SEP] operator[SEP] } } }
public ServiceFuture<FailoverGroupInner> forceFailoverAllowDataLossAsync(String resourceGroupName, String serverName, String failoverGroupName, final ServiceCallback<FailoverGroupInner> serviceCallback) { return ServiceFuture.fromResponse(forceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName), serviceCallback); }
class class_name[name] begin[{] method[forceFailoverAllowDataLossAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, failoverGroupName, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.forceFailoverAllowDataLossWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.failoverGroupName]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[FailoverGroupInner] operator[>] identifier[forceFailoverAllowDataLossAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[failoverGroupName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[FailoverGroupInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[forceFailoverAllowDataLossWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[failoverGroupName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
private Method findFindByPrimaryKey(Class c) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "findFindByPrimaryKey", c); Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; ++i) { if (methods[i].getName().equals("findByPrimaryKey")) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "findFindByPrimaryKey"); return methods[i]; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "findFindByPrimaryKey: method findByPrimaryKey not found!"); return null; }
class class_name[name] begin[{] method[findFindByPrimaryKey, return_type[type[Method]], modifier[private], parameter[c]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["findFindByPrimaryKey"], member[.c]]] else begin[{] None end[}] local_variable[type[Method], methods] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="findByPrimaryKey")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), 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="findFindByPrimaryKey")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=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=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=methods, 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) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["findFindByPrimaryKey: method findByPrimaryKey not found!"]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[Method] identifier[findFindByPrimaryKey] operator[SEP] identifier[Class] identifier[c] 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[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[c] operator[SEP] operator[SEP] identifier[Method] operator[SEP] operator[SEP] identifier[methods] operator[=] identifier[c] operator[SEP] identifier[getMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[methods] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[methods] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] 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[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[methods] operator[SEP] identifier[i] 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[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
private boolean moveToNextDataSegment() throws IOException { try { clearDataSegment(); DataSegmentReader dataSegmentReader = new DataSegmentReader(dataIn, conf, decompressorCache); dataSegmentIn = dataSegmentReader.getInputStream(); } catch (EmptyDataSegmentException e){ // no data available return false; } catch (EOFException e) { // EOFException is thrown when the underlying data stream is truncated, e.g. truncated file. // This is considered as a normal case. throw new CodecPrematureEOFException("Truncated .SSF file detected."); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } return true; }
class class_name[name] begin[{] method[moveToNextDataSegment, return_type[type[boolean]], modifier[private], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clearDataSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=dataIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=decompressorCache, 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=DataSegmentReader, sub_type=None)), name=dataSegmentReader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataSegmentReader, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataSegmentIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=dataSegmentReader, selectors=[], type_arguments=None)), 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=['EmptyDataSegmentException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Truncated .SSF file detected.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CodecPrematureEOFException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['EOFException'])), 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=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[moveToNextDataSegment] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[clearDataSegment] operator[SEP] operator[SEP] operator[SEP] identifier[DataSegmentReader] identifier[dataSegmentReader] operator[=] Keyword[new] identifier[DataSegmentReader] operator[SEP] identifier[dataIn] , identifier[conf] , identifier[decompressorCache] operator[SEP] operator[SEP] identifier[dataSegmentIn] operator[=] identifier[dataSegmentReader] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[EmptyDataSegmentException] identifier[e] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[EOFException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CodecPrematureEOFException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static HashMap<Integer, Integer> readIntIntMapFromGlob(Path glob, FileSystem fs) throws IOException { FileStatus status[] = fs.globStatus(glob); HashMap<Integer, Integer> ret = new HashMap<Integer, Integer>(); for(FileStatus fileS : status) { ret.putAll(readIntIntMap(fileS.getPath(), fs)); } return ret; }
class class_name[name] begin[{] method[readIntIntMapFromGlob, return_type[type[HashMap]], modifier[public static], parameter[glob, fs]] begin[{] local_variable[type[FileStatus], status] local_variable[type[HashMap], ret] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=fileS, selectors=[], type_arguments=None), MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readIntIntMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fileS)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileStatus, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HashMap] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[readIntIntMapFromGlob] operator[SEP] identifier[Path] identifier[glob] , identifier[FileSystem] identifier[fs] operator[SEP] Keyword[throws] identifier[IOException] { identifier[FileStatus] identifier[status] operator[SEP] operator[SEP] operator[=] identifier[fs] operator[SEP] identifier[globStatus] operator[SEP] identifier[glob] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[ret] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Integer] , identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FileStatus] identifier[fileS] operator[:] identifier[status] operator[SEP] { identifier[ret] operator[SEP] identifier[putAll] operator[SEP] identifier[readIntIntMap] operator[SEP] identifier[fileS] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[fs] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
private void setupIgnoreRules(ResourceClassifier target) { ignoreValidationRules.add(new IgnorePortValidationRule(IgnorePortValidationRule.TYPE)); ignoreValidationRules.add(new IgnoreResourceMemoryLimitRule(IgnoreResourceMemoryLimitRule.TYPE)); }
class class_name[name] begin[{] method[setupIgnoreRules, return_type[void], modifier[private], parameter[target]] begin[{] call[ignoreValidationRules.add, parameter[ClassCreator(arguments=[MemberReference(member=TYPE, postfix_operators=[], prefix_operators=[], qualifier=IgnorePortValidationRule, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IgnorePortValidationRule, sub_type=None))]] call[ignoreValidationRules.add, parameter[ClassCreator(arguments=[MemberReference(member=TYPE, postfix_operators=[], prefix_operators=[], qualifier=IgnoreResourceMemoryLimitRule, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IgnoreResourceMemoryLimitRule, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setupIgnoreRules] operator[SEP] identifier[ResourceClassifier] identifier[target] operator[SEP] { identifier[ignoreValidationRules] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[IgnorePortValidationRule] operator[SEP] identifier[IgnorePortValidationRule] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] operator[SEP] identifier[ignoreValidationRules] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[IgnoreResourceMemoryLimitRule] operator[SEP] identifier[IgnoreResourceMemoryLimitRule] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] operator[SEP] }
public synchronized void updateNextBuildNumber(int next) throws IOException { RunT lb = getLastBuild(); if (lb!=null ? next>lb.getNumber() : next>0) { this.nextBuildNumber = next; saveNextBuildNumber(); } }
class class_name[name] begin[{] method[updateNextBuildNumber, return_type[void], modifier[synchronized public], parameter[next]] begin[{] local_variable[type[RunT], lb] if[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=BinaryOperation(operandl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_true=BinaryOperation(operandl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumber, postfix_operators=[], prefix_operators=[], qualifier=lb, selectors=[], type_arguments=None), operator=>))] begin[{] assign[THIS[member[None.nextBuildNumber]], member[.next]] call[.saveNextBuildNumber, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[updateNextBuildNumber] operator[SEP] Keyword[int] identifier[next] operator[SEP] Keyword[throws] identifier[IOException] { identifier[RunT] identifier[lb] operator[=] identifier[getLastBuild] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lb] operator[!=] Other[null] operator[?] identifier[next] operator[>] identifier[lb] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] operator[:] identifier[next] operator[>] Other[0] operator[SEP] { Keyword[this] operator[SEP] identifier[nextBuildNumber] operator[=] identifier[next] operator[SEP] identifier[saveNextBuildNumber] operator[SEP] operator[SEP] operator[SEP] } }
@Override public SecurityConfig setClientPermissionConfigs(Set<PermissionConfig> permissions) { if (securityService == null) { throw new UnsupportedOperationException("Unsupported operation"); } securityService.refreshClientPermissions(permissions); return this; }
class class_name[name] begin[{] method[setClientPermissionConfigs, return_type[type[SecurityConfig]], modifier[public], parameter[permissions]] begin[{] if[binary_operation[member[.securityService], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported operation")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] call[securityService.refreshClientPermissions, parameter[member[.permissions]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[SecurityConfig] identifier[setClientPermissionConfigs] operator[SEP] identifier[Set] operator[<] identifier[PermissionConfig] operator[>] identifier[permissions] operator[SEP] { Keyword[if] operator[SEP] identifier[securityService] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[securityService] operator[SEP] identifier[refreshClientPermissions] operator[SEP] identifier[permissions] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void marshall(CreateIPSetRequest createIPSetRequest, ProtocolMarshaller protocolMarshaller) { if (createIPSetRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createIPSetRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createIPSetRequest.getChangeToken(), CHANGETOKEN_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[createIPSetRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createIPSetRequest], ==, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=createIPSetRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_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=getChangeToken, postfix_operators=[], prefix_operators=[], qualifier=createIPSetRequest, selectors=[], type_arguments=None), MemberReference(member=CHANGETOKEN_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[CreateIPSetRequest] identifier[createIPSetRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createIPSetRequest] 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[createIPSetRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createIPSetRequest] operator[SEP] identifier[getChangeToken] operator[SEP] operator[SEP] , identifier[CHANGETOKEN_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] } }
static Field getClassFieldByName(Class<?> clazz, String fieldName) { try { return clazz.getDeclaredField(fieldName); } catch (SecurityException e) { throw new DynamoDBMappingException( "Denied access to the [" + fieldName + "] field in class [" + clazz + "].", e); } catch (NoSuchFieldException e) { return null; } }
class class_name[name] begin[{] method[getClassFieldByName, return_type[type[Field]], modifier[static], parameter[clazz, fieldName]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredField, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Denied access to the ["), operandr=MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] field in class ["), operator=+), operandr=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]."), 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=DynamoDBMappingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SecurityException'])), CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchFieldException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[static] identifier[Field] identifier[getClassFieldByName] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] identifier[fieldName] operator[SEP] { Keyword[try] { Keyword[return] identifier[clazz] operator[SEP] identifier[getDeclaredField] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DynamoDBMappingException] operator[SEP] literal[String] operator[+] identifier[fieldName] operator[+] literal[String] operator[+] identifier[clazz] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchFieldException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public void linkActivated(URL url, BaseApplet applet, int iOptions) { m_editorPane.linkActivated(url, applet, iOptions); }
class class_name[name] begin[{] method[linkActivated, return_type[void], modifier[public], parameter[url, applet, iOptions]] begin[{] call[m_editorPane.linkActivated, parameter[member[.url], member[.applet], member[.iOptions]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[linkActivated] operator[SEP] identifier[URL] identifier[url] , identifier[BaseApplet] identifier[applet] , Keyword[int] identifier[iOptions] operator[SEP] { identifier[m_editorPane] operator[SEP] identifier[linkActivated] operator[SEP] identifier[url] , identifier[applet] , identifier[iOptions] operator[SEP] operator[SEP] }
public ObservableList<Item> getPropertySheetItems() { ObservableList<Item> items = FXCollections.observableArrayList(); items.add(new Item() { @Override public Optional<ObservableValue<?>> getObservableValue() { return Optional.of(positionProperty()); } @Override public void setValue(Object value) { position.set((Position) value); } @Override public Object getValue() { return getPosition(); } @Override public Class<?> getType() { return Position.class; } @Override public String getName() { return "Position"; //$NON-NLS-1$ } @Override public String getDescription() { return "Position (first, last, middle, only)"; //$NON-NLS-1$ } @Override public String getCategory() { return ENTRY_VIEW_CATEGORY; } }); items.add(new Item() { @Override public Optional<ObservableValue<?>> getObservableValue() { return Optional.of(selectedProperty()); } @Override public void setValue(Object value) { selected.set((boolean) value); } @Override public Object getValue() { return isSelected(); } @Override public Class<?> getType() { return Boolean.class; } @Override public String getName() { return "Selected"; //$NON-NLS-1$ } @Override public String getDescription() { return "Selected"; //$NON-NLS-1$ } @Override public String getCategory() { return ENTRY_VIEW_CATEGORY; } }); return items; }
class class_name[name] begin[{] method[getPropertySheetItems, return_type[type[ObservableList]], modifier[public], parameter[]] begin[{] local_variable[type[ObservableList], items] call[items.add, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=positionProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getObservableValue, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ObservableValue, sub_type=None))], dimensions=[], name=Optional, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Position, sub_type=None))], member=set, postfix_operators=[], prefix_operators=[], qualifier=position, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=setValue, parameters=[FormalParameter(annotations=[], modifiers=set(), name=value, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getValue, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Position, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=getType, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Position"), label=None)], documentation=None, modifiers={'public'}, name=getName, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Position (first, last, middle, only)"), label=None)], documentation=None, modifiers={'public'}, name=getDescription, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=ENTRY_VIEW_CATEGORY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getCategory, parameters=[], 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=Item, sub_type=None))]] call[items.add, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=selectedProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getObservableValue, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ObservableValue, sub_type=None))], dimensions=[], name=Optional, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=boolean))], member=set, postfix_operators=[], prefix_operators=[], qualifier=selected, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=setValue, parameters=[FormalParameter(annotations=[], modifiers=set(), name=value, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSelected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getValue, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=getType, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Selected"), label=None)], documentation=None, modifiers={'public'}, name=getName, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Selected"), label=None)], documentation=None, modifiers={'public'}, name=getDescription, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=ENTRY_VIEW_CATEGORY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getCategory, parameters=[], 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=Item, sub_type=None))]] return[member[.items]] end[}] END[}]
Keyword[public] identifier[ObservableList] operator[<] identifier[Item] operator[>] identifier[getPropertySheetItems] operator[SEP] operator[SEP] { identifier[ObservableList] operator[<] identifier[Item] operator[>] identifier[items] operator[=] identifier[FXCollections] operator[SEP] identifier[observableArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[items] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Item] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Optional] operator[<] identifier[ObservableValue] operator[<] operator[?] operator[>] operator[>] identifier[getObservableValue] operator[SEP] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[positionProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setValue] operator[SEP] identifier[Object] identifier[value] operator[SEP] { identifier[position] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[Position] operator[SEP] identifier[value] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getValue] operator[SEP] operator[SEP] { Keyword[return] identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[getType] operator[SEP] operator[SEP] { Keyword[return] identifier[Position] operator[SEP] Keyword[class] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getName] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getDescription] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getCategory] operator[SEP] operator[SEP] { Keyword[return] identifier[ENTRY_VIEW_CATEGORY] operator[SEP] } } operator[SEP] operator[SEP] identifier[items] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Item] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Optional] operator[<] identifier[ObservableValue] operator[<] operator[?] operator[>] operator[>] identifier[getObservableValue] operator[SEP] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[selectedProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setValue] operator[SEP] identifier[Object] identifier[value] operator[SEP] { identifier[selected] operator[SEP] identifier[set] operator[SEP] operator[SEP] Keyword[boolean] operator[SEP] identifier[value] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getValue] operator[SEP] operator[SEP] { Keyword[return] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[getType] operator[SEP] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getName] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getDescription] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getCategory] operator[SEP] operator[SEP] { Keyword[return] identifier[ENTRY_VIEW_CATEGORY] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] identifier[items] operator[SEP] }
public void addKeyword(String keyword) { if (taxonomy.concepts.containsKey(keyword)) { throw new IllegalArgumentException(String.format("Concept %s already exists.", keyword)); } taxonomy.concepts.put(keyword, this); if (synset == null) { synset = new TreeSet<>(); } synset.add(keyword); }
class class_name[name] begin[{] method[addKeyword, return_type[void], modifier[public], parameter[keyword]] begin[{] if[call[taxonomy.concepts.containsKey, parameter[member[.keyword]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Concept %s already exists."), MemberReference(member=keyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], 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[}] call[taxonomy.concepts.put, parameter[member[.keyword], THIS[]]] if[binary_operation[member[.synset], ==, literal[null]]] begin[{] assign[member[.synset], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TreeSet, sub_type=None))] else begin[{] None end[}] call[synset.add, parameter[member[.keyword]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addKeyword] operator[SEP] identifier[String] identifier[keyword] operator[SEP] { Keyword[if] operator[SEP] identifier[taxonomy] operator[SEP] identifier[concepts] operator[SEP] identifier[containsKey] operator[SEP] identifier[keyword] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[keyword] operator[SEP] operator[SEP] operator[SEP] } identifier[taxonomy] operator[SEP] identifier[concepts] operator[SEP] identifier[put] operator[SEP] identifier[keyword] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[synset] operator[==] Other[null] operator[SEP] { identifier[synset] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[synset] operator[SEP] identifier[add] operator[SEP] identifier[keyword] operator[SEP] operator[SEP] }
public static String getFormatDate(String format, String zoneId) { return getFormatDate(format, new Date(), zoneId); }
class class_name[name] begin[{] method[getFormatDate, return_type[type[String]], modifier[public static], parameter[format, zoneId]] begin[{] return[call[.getFormatDate, parameter[member[.format], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None)), member[.zoneId]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getFormatDate] operator[SEP] identifier[String] identifier[format] , identifier[String] identifier[zoneId] operator[SEP] { Keyword[return] identifier[getFormatDate] operator[SEP] identifier[format] , Keyword[new] identifier[Date] operator[SEP] operator[SEP] , identifier[zoneId] operator[SEP] operator[SEP] }
@Override public void executeDemo(String text) { EntityUtils.getEntities(this, 0, PAGE_SIZE, new EntityListListener() { @Override public void onList(ListResult<Entity> entities) { handleBasicSocializeResult(entities); } @Override public void onError(SocializeException error) { handleError(GetAllEntitiesActivity.this, error); } }); }
class class_name[name] begin[{] method[executeDemo, return_type[void], modifier[public], parameter[text]] begin[{] call[EntityUtils.getEntities, parameter[THIS[], literal[0], member[.PAGE_SIZE], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleBasicSocializeResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onList, parameters=[FormalParameter(annotations=[], modifiers=set(), name=entities, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Entity, sub_type=None))], dimensions=[], name=ListResult, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=GetAllEntitiesActivity, selectors=[]), MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onError, parameters=[FormalParameter(annotations=[], modifiers=set(), name=error, type=ReferenceType(arguments=None, dimensions=[], name=SocializeException, 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=EntityListListener, sub_type=None))]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[executeDemo] operator[SEP] identifier[String] identifier[text] operator[SEP] { identifier[EntityUtils] operator[SEP] identifier[getEntities] operator[SEP] Keyword[this] , Other[0] , identifier[PAGE_SIZE] , Keyword[new] identifier[EntityListListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onList] operator[SEP] identifier[ListResult] operator[<] identifier[Entity] operator[>] identifier[entities] operator[SEP] { identifier[handleBasicSocializeResult] operator[SEP] identifier[entities] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onError] operator[SEP] identifier[SocializeException] identifier[error] operator[SEP] { identifier[handleError] operator[SEP] identifier[GetAllEntitiesActivity] operator[SEP] Keyword[this] , identifier[error] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public Object put(Object key,Object subKey,Object value){ HashMap a = (HashMap)super.get(key); if(a==null){ a = new HashMap(); super.put(key,a); } return a.put(subKey,value); }
class class_name[name] begin[{] method[put, return_type[type[Object]], modifier[public], parameter[key, subKey, value]] begin[{] local_variable[type[HashMap], a] if[binary_operation[member[.a], ==, literal[null]]] begin[{] assign[member[.a], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))] SuperMethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) else begin[{] None end[}] return[call[a.put, parameter[member[.subKey], member[.value]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[put] operator[SEP] identifier[Object] identifier[key] , identifier[Object] identifier[subKey] , identifier[Object] identifier[value] operator[SEP] { identifier[HashMap] identifier[a] operator[=] operator[SEP] identifier[HashMap] operator[SEP] Keyword[super] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[==] Other[null] operator[SEP] { identifier[a] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[a] operator[SEP] operator[SEP] } Keyword[return] identifier[a] operator[SEP] identifier[put] operator[SEP] identifier[subKey] , identifier[value] operator[SEP] operator[SEP] }
public static <T extends ContentMeta> T withBytes(byte[] data, Map<String, String> meta, ContentFactory<T> factory) { return withStream(new ByteArrayInputStream(data), meta, factory); }
class class_name[name] begin[{] method[withBytes, return_type[type[T]], modifier[public static], parameter[data, meta, factory]] begin[{] return[call[.withStream, parameter[ClassCreator(arguments=[MemberReference(member=data, 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=ByteArrayInputStream, sub_type=None)), member[.meta], member[.factory]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ContentMeta] operator[>] identifier[T] identifier[withBytes] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[meta] , identifier[ContentFactory] operator[<] identifier[T] operator[>] identifier[factory] operator[SEP] { Keyword[return] identifier[withStream] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[data] operator[SEP] , identifier[meta] , identifier[factory] operator[SEP] operator[SEP] }
public static <T> TaggedValue<T> taggedValue(String tag, T rep) { return new TaggedValueImpl<T>(tag, rep); }
class class_name[name] begin[{] method[taggedValue, return_type[type[TaggedValue]], modifier[public static], parameter[tag, rep]] begin[{] return[ClassCreator(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rep, 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=T, sub_type=None))], dimensions=None, name=TaggedValueImpl, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[TaggedValue] operator[<] identifier[T] operator[>] identifier[taggedValue] operator[SEP] identifier[String] identifier[tag] , identifier[T] identifier[rep] operator[SEP] { Keyword[return] Keyword[new] identifier[TaggedValueImpl] operator[<] identifier[T] operator[>] operator[SEP] identifier[tag] , identifier[rep] operator[SEP] operator[SEP] }
public static String getBoldHTMLText(final String text) { String boldStr = null; if (text != null) { final StringBuilder updatedMsg = new StringBuilder("<b>"); updatedMsg.append(text); updatedMsg.append("</b>"); boldStr = updatedMsg.toString(); } return boldStr; }
class class_name[name] begin[{] method[getBoldHTMLText, return_type[type[String]], modifier[public static], parameter[text]] begin[{] local_variable[type[String], boldStr] if[binary_operation[member[.text], !=, literal[null]]] begin[{] local_variable[type[StringBuilder], updatedMsg] call[updatedMsg.append, parameter[member[.text]]] call[updatedMsg.append, parameter[literal["</b>"]]] assign[member[.boldStr], call[updatedMsg.toString, parameter[]]] else begin[{] None end[}] return[member[.boldStr]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getBoldHTMLText] operator[SEP] Keyword[final] identifier[String] identifier[text] operator[SEP] { identifier[String] identifier[boldStr] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[text] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[updatedMsg] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[updatedMsg] operator[SEP] identifier[append] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[updatedMsg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[boldStr] operator[=] identifier[updatedMsg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[boldStr] operator[SEP] }
@Override public Object mapSequence(Object sequence) { List<List<Float>> seq = (List<List<Float>>) sequence; List<Float> ret = new ArrayList<>(); for (List<Float> step : seq) ret.add((Float) map(step)); return ret; }
class class_name[name] begin[{] method[mapSequence, return_type[type[Object]], modifier[public], parameter[sequence]] begin[{] local_variable[type[List], seq] local_variable[type[List], ret] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[MemberReference(member=step, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=step)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[mapSequence] operator[SEP] identifier[Object] identifier[sequence] operator[SEP] { identifier[List] operator[<] identifier[List] operator[<] identifier[Float] operator[>] operator[>] identifier[seq] operator[=] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[Float] operator[>] operator[>] operator[SEP] identifier[sequence] operator[SEP] identifier[List] operator[<] identifier[Float] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[Float] operator[>] identifier[step] operator[:] identifier[seq] operator[SEP] identifier[ret] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[Float] operator[SEP] identifier[map] operator[SEP] identifier[step] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
@Override public void commit() throws IOException { try { LOG.info("Flushing pending insert."); this.commands.flush(); LOG.info("Commiting transaction."); this.conn.commit(); } catch (Exception e) { this.failed = true; throw new RuntimeException(e); } }
class class_name[name] begin[{] method[commit, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Flushing pending insert.")], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=commands, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=flush, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Commiting transaction.")], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=conn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=commit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=failed, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), 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=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[commit] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[commands] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[conn] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[this] operator[SEP] identifier[failed] operator[=] literal[boolean] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static FileOutputStream openExampleFileOuputStream(String filename) throws IOException { Path directoryPath; if ("".equals(lastDumpFileName)) { directoryPath = Paths.get(EXAMPLE_OUTPUT_DIRECTORY); } else { directoryPath = Paths.get(EXAMPLE_OUTPUT_DIRECTORY); createDirectory(directoryPath); directoryPath = directoryPath.resolve( lastDumpFileName); } createDirectory(directoryPath); Path filePath = directoryPath.resolve(filename); return new FileOutputStream(filePath.toFile()); }
class class_name[name] begin[{] method[openExampleFileOuputStream, return_type[type[FileOutputStream]], modifier[public static], parameter[filename]] begin[{] local_variable[type[Path], directoryPath] if[literal[""]] begin[{] assign[member[.directoryPath], call[Paths.get, parameter[member[.EXAMPLE_OUTPUT_DIRECTORY]]]] else begin[{] assign[member[.directoryPath], call[Paths.get, parameter[member[.EXAMPLE_OUTPUT_DIRECTORY]]]] call[.createDirectory, parameter[member[.directoryPath]]] assign[member[.directoryPath], call[directoryPath.resolve, parameter[member[.lastDumpFileName]]]] end[}] call[.createDirectory, parameter[member[.directoryPath]]] local_variable[type[Path], filePath] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toFile, postfix_operators=[], prefix_operators=[], qualifier=filePath, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[FileOutputStream] identifier[openExampleFileOuputStream] operator[SEP] identifier[String] identifier[filename] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Path] identifier[directoryPath] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[lastDumpFileName] operator[SEP] operator[SEP] { identifier[directoryPath] operator[=] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[EXAMPLE_OUTPUT_DIRECTORY] operator[SEP] operator[SEP] } Keyword[else] { identifier[directoryPath] operator[=] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[EXAMPLE_OUTPUT_DIRECTORY] operator[SEP] operator[SEP] identifier[createDirectory] operator[SEP] identifier[directoryPath] operator[SEP] operator[SEP] identifier[directoryPath] operator[=] identifier[directoryPath] operator[SEP] identifier[resolve] operator[SEP] identifier[lastDumpFileName] operator[SEP] operator[SEP] } identifier[createDirectory] operator[SEP] identifier[directoryPath] operator[SEP] operator[SEP] identifier[Path] identifier[filePath] operator[=] identifier[directoryPath] operator[SEP] identifier[resolve] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[filePath] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public AuthorizationEntity[] newDeployment(Deployment deployment) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); IdentityService identityService = processEngineConfiguration.getIdentityService(); Authentication currentAuthentication = identityService.getCurrentAuthentication(); if (currentAuthentication != null && currentAuthentication.getUserId() != null) { String userId = currentAuthentication.getUserId(); String deploymentId = deployment.getId(); AuthorizationEntity authorization = createGrantAuthorization(userId, null, DEPLOYMENT, deploymentId, READ, DELETE); return new AuthorizationEntity[]{ authorization }; } return null; }
class class_name[name] begin[{] method[newDeployment, return_type[type[AuthorizationEntity]], modifier[public], parameter[deployment]] begin[{] local_variable[type[ProcessEngineConfigurationImpl], processEngineConfiguration] local_variable[type[IdentityService], identityService] local_variable[type[Authentication], currentAuthentication] if[binary_operation[binary_operation[member[.currentAuthentication], !=, literal[null]], &&, binary_operation[call[currentAuthentication.getUserId, parameter[]], !=, literal[null]]]] begin[{] local_variable[type[String], userId] local_variable[type[String], deploymentId] local_variable[type[AuthorizationEntity], authorization] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=authorization, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthorizationEntity, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[AuthorizationEntity] operator[SEP] operator[SEP] identifier[newDeployment] operator[SEP] identifier[Deployment] identifier[deployment] operator[SEP] { identifier[ProcessEngineConfigurationImpl] identifier[processEngineConfiguration] operator[=] identifier[Context] operator[SEP] identifier[getProcessEngineConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[IdentityService] identifier[identityService] operator[=] identifier[processEngineConfiguration] operator[SEP] identifier[getIdentityService] operator[SEP] operator[SEP] operator[SEP] identifier[Authentication] identifier[currentAuthentication] operator[=] identifier[identityService] operator[SEP] identifier[getCurrentAuthentication] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentAuthentication] operator[!=] Other[null] operator[&&] identifier[currentAuthentication] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[userId] operator[=] identifier[currentAuthentication] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[deploymentId] operator[=] identifier[deployment] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[AuthorizationEntity] identifier[authorization] operator[=] identifier[createGrantAuthorization] operator[SEP] identifier[userId] , Other[null] , identifier[DEPLOYMENT] , identifier[deploymentId] , identifier[READ] , identifier[DELETE] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AuthorizationEntity] operator[SEP] operator[SEP] { identifier[authorization] } operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "laplacian") public JAXBElement<LaplacianType> createLaplacian(LaplacianType value) { return new JAXBElement<LaplacianType>(_Laplacian_QNAME, LaplacianType.class, null, value); }
class class_name[name] begin[{] method[createLaplacian, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Laplacian_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LaplacianType, 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=LaplacianType, 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[LaplacianType] operator[>] identifier[createLaplacian] operator[SEP] identifier[LaplacianType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[LaplacianType] operator[>] operator[SEP] identifier[_Laplacian_QNAME] , identifier[LaplacianType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public Content getSignature(ConstructorDoc constructor) { Content pre = new HtmlTree(HtmlTag.PRE); writer.addAnnotationInfo(constructor, pre); int annotationLength = pre.charCount(); addModifiers(constructor, pre); if (configuration.linksource) { Content constructorName = new StringContent(constructor.name()); writer.addSrcLink(constructor, constructorName, pre); } else { addName(constructor.name(), pre); } int indent = pre.charCount() - annotationLength; addParameters(constructor, pre, indent); addExceptions(constructor, pre, indent); return pre; }
class class_name[name] begin[{] method[getSignature, return_type[type[Content]], modifier[public], parameter[constructor]] begin[{] local_variable[type[Content], pre] call[writer.addAnnotationInfo, parameter[member[.constructor], member[.pre]]] local_variable[type[int], annotationLength] call[.addModifiers, parameter[member[.constructor], member[.pre]]] if[member[configuration.linksource]] begin[{] local_variable[type[Content], constructorName] call[writer.addSrcLink, parameter[member[.constructor], member[.constructorName], member[.pre]]] else begin[{] call[.addName, parameter[call[constructor.name, parameter[]], member[.pre]]] end[}] local_variable[type[int], indent] call[.addParameters, parameter[member[.constructor], member[.pre], member[.indent]]] call[.addExceptions, parameter[member[.constructor], member[.pre], member[.indent]]] return[member[.pre]] end[}] END[}]
Keyword[public] identifier[Content] identifier[getSignature] operator[SEP] identifier[ConstructorDoc] identifier[constructor] operator[SEP] { identifier[Content] identifier[pre] operator[=] Keyword[new] identifier[HtmlTree] operator[SEP] identifier[HtmlTag] operator[SEP] identifier[PRE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[addAnnotationInfo] operator[SEP] identifier[constructor] , identifier[pre] operator[SEP] operator[SEP] Keyword[int] identifier[annotationLength] operator[=] identifier[pre] operator[SEP] identifier[charCount] operator[SEP] operator[SEP] operator[SEP] identifier[addModifiers] operator[SEP] identifier[constructor] , identifier[pre] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configuration] operator[SEP] identifier[linksource] operator[SEP] { identifier[Content] identifier[constructorName] operator[=] Keyword[new] identifier[StringContent] operator[SEP] identifier[constructor] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[addSrcLink] operator[SEP] identifier[constructor] , identifier[constructorName] , identifier[pre] operator[SEP] operator[SEP] } Keyword[else] { identifier[addName] operator[SEP] identifier[constructor] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[pre] operator[SEP] operator[SEP] } Keyword[int] identifier[indent] operator[=] identifier[pre] operator[SEP] identifier[charCount] operator[SEP] operator[SEP] operator[-] identifier[annotationLength] operator[SEP] identifier[addParameters] operator[SEP] identifier[constructor] , identifier[pre] , identifier[indent] operator[SEP] operator[SEP] identifier[addExceptions] operator[SEP] identifier[constructor] , identifier[pre] , identifier[indent] operator[SEP] operator[SEP] Keyword[return] identifier[pre] operator[SEP] }
public static List<RowsMapping> findChildRowsMappingFromShiftMap( final String fullName, final NavigableMap<String, ConfigRangeAttrs> shiftMap) { List<RowsMapping> rowsMappingList = new ArrayList<>(); NavigableMap<String, ConfigRangeAttrs> tailmap = shiftMap .tailMap(fullName, false); for (Map.Entry<String, ConfigRangeAttrs> entry : tailmap .entrySet()) { String key = entry.getKey(); // check it's children if (key.startsWith(fullName)) { rowsMappingList.add(entry.getValue().getUnitRowsMapping()); } else { break; } } return rowsMappingList; }
class class_name[name] begin[{] method[findChildRowsMappingFromShiftMap, return_type[type[List]], modifier[public static], parameter[fullName, shiftMap]] begin[{] local_variable[type[List], rowsMappingList] local_variable[type[NavigableMap], tailmap] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=fullName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=getUnitRowsMapping, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=rowsMappingList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=tailmap, 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=None, dimensions=[], name=ConfigRangeAttrs, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.rowsMappingList]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[RowsMapping] operator[>] identifier[findChildRowsMappingFromShiftMap] operator[SEP] Keyword[final] identifier[String] identifier[fullName] , Keyword[final] identifier[NavigableMap] operator[<] identifier[String] , identifier[ConfigRangeAttrs] operator[>] identifier[shiftMap] operator[SEP] { identifier[List] operator[<] identifier[RowsMapping] operator[>] identifier[rowsMappingList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[NavigableMap] operator[<] identifier[String] , identifier[ConfigRangeAttrs] operator[>] identifier[tailmap] operator[=] identifier[shiftMap] operator[SEP] identifier[tailMap] operator[SEP] identifier[fullName] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ConfigRangeAttrs] operator[>] identifier[entry] operator[:] identifier[tailmap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[key] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] identifier[fullName] operator[SEP] operator[SEP] { identifier[rowsMappingList] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getUnitRowsMapping] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[break] operator[SEP] } } Keyword[return] identifier[rowsMappingList] operator[SEP] }
@Nonnull public static GenericodeWriter <com.helger.genericode.v10.ColumnSetDocument> gc10ColumnSet () { return new GenericodeWriter<> (EGenericodeDocumentType.GC10_COLUMN_SET); }
class class_name[name] begin[{] method[gc10ColumnSet, return_type[type[GenericodeWriter]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[MemberReference(member=GC10_COLUMN_SET, postfix_operators=[], prefix_operators=[], qualifier=EGenericodeDocumentType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=GenericodeWriter, sub_type=None))] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[GenericodeWriter] operator[<] identifier[com] operator[SEP] identifier[helger] operator[SEP] identifier[genericode] operator[SEP] identifier[v10] operator[SEP] identifier[ColumnSetDocument] operator[>] identifier[gc10ColumnSet] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[GenericodeWriter] operator[<] operator[>] operator[SEP] identifier[EGenericodeDocumentType] operator[SEP] identifier[GC10_COLUMN_SET] operator[SEP] operator[SEP] }
public boolean start(RootDoc root) { Object retVal; String methodName = "start"; Class<?>[] paramTypes = { RootDoc.class }; Object[] params = { root }; try { retVal = invoke(methodName, null, paramTypes, params); } catch (DocletInvokeException exc) { return false; } if (retVal instanceof Boolean) { return ((Boolean)retVal); } else { messager.error(Messager.NOPOS, "main.must_return_boolean", docletClassName, methodName); return false; } }
class class_name[name] begin[{] method[start, return_type[type[boolean]], modifier[public], parameter[root]] begin[{] local_variable[type[Object], retVal] local_variable[type[String], methodName] local_variable[type[Class], paramTypes] local_variable[type[Object], params] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=retVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), 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=exc, types=['DocletInvokeException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.retVal], instanceof, type[Boolean]]] begin[{] return[Cast(expression=MemberReference(member=retVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))] else begin[{] call[messager.error, parameter[member[Messager.NOPOS], literal["main.must_return_boolean"], member[.docletClassName], member[.methodName]]] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[start] operator[SEP] identifier[RootDoc] identifier[root] operator[SEP] { identifier[Object] identifier[retVal] operator[SEP] identifier[String] identifier[methodName] operator[=] literal[String] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[paramTypes] operator[=] { identifier[RootDoc] operator[SEP] Keyword[class] } operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[params] operator[=] { identifier[root] } operator[SEP] Keyword[try] { identifier[retVal] operator[=] identifier[invoke] operator[SEP] identifier[methodName] , Other[null] , identifier[paramTypes] , identifier[params] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DocletInvokeException] identifier[exc] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[retVal] Keyword[instanceof] identifier[Boolean] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[retVal] operator[SEP] operator[SEP] } Keyword[else] { identifier[messager] operator[SEP] identifier[error] operator[SEP] identifier[Messager] operator[SEP] identifier[NOPOS] , literal[String] , identifier[docletClassName] , identifier[methodName] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
@Override protected void visitPrintNode(PrintNode node) { TranslateToPyExprVisitor translator = new TranslateToPyExprVisitor(localVarExprs, pluginValueFactory, errorReporter); PyExpr pyExpr = translator.exec(node.getExpr()); // Process directives. for (PrintDirectiveNode directiveNode : node.getChildren()) { // Get directive. SoyPrintDirective directive = directiveNode.getPrintDirective(); if (!(directive instanceof SoyPySrcPrintDirective)) { errorReporter.report( directiveNode.getSourceLocation(), UNKNOWN_SOY_PY_SRC_PRINT_DIRECTIVE, directiveNode.getName()); continue; } // Get directive args. List<ExprRootNode> args = directiveNode.getArgs(); // Translate directive args. List<PyExpr> argsPyExprs = new ArrayList<>(args.size()); for (ExprRootNode arg : args) { argsPyExprs.add(translator.exec(arg)); } // Apply directive. pyExpr = ((SoyPySrcPrintDirective) directive).applyForPySrc(pyExpr, argsPyExprs); } pyExprs.add(pyExpr); }
class class_name[name] begin[{] method[visitPrintNode, return_type[void], modifier[protected], parameter[node]] begin[{] local_variable[type[TranslateToPyExprVisitor], translator] local_variable[type[PyExpr], pyExpr] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPrintDirective, postfix_operators=[], prefix_operators=[], qualifier=directiveNode, selectors=[], type_arguments=None), name=directive)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SoyPrintDirective, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=directive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SoyPySrcPrintDirective, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSourceLocation, postfix_operators=[], prefix_operators=[], qualifier=directiveNode, selectors=[], type_arguments=None), MemberReference(member=UNKNOWN_SOY_PY_SRC_PRINT_DIRECTIVE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=directiveNode, selectors=[], type_arguments=None)], member=report, postfix_operators=[], prefix_operators=[], qualifier=errorReporter, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getArgs, postfix_operators=[], prefix_operators=[], qualifier=directiveNode, selectors=[], type_arguments=None), name=args)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ExprRootNode, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=argsPyExprs)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PyExpr, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exec, postfix_operators=[], prefix_operators=[], qualifier=translator, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=argsPyExprs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExprRootNode, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pyExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=directive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SoyPySrcPrintDirective, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=directiveNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PrintDirectiveNode, sub_type=None))), label=None) call[pyExprs.add, parameter[member[.pyExpr]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[visitPrintNode] operator[SEP] identifier[PrintNode] identifier[node] operator[SEP] { identifier[TranslateToPyExprVisitor] identifier[translator] operator[=] Keyword[new] identifier[TranslateToPyExprVisitor] operator[SEP] identifier[localVarExprs] , identifier[pluginValueFactory] , identifier[errorReporter] operator[SEP] operator[SEP] identifier[PyExpr] identifier[pyExpr] operator[=] identifier[translator] operator[SEP] identifier[exec] operator[SEP] identifier[node] operator[SEP] identifier[getExpr] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PrintDirectiveNode] identifier[directiveNode] operator[:] identifier[node] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] { identifier[SoyPrintDirective] identifier[directive] operator[=] identifier[directiveNode] operator[SEP] identifier[getPrintDirective] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[directive] Keyword[instanceof] identifier[SoyPySrcPrintDirective] operator[SEP] operator[SEP] { identifier[errorReporter] operator[SEP] identifier[report] operator[SEP] identifier[directiveNode] operator[SEP] identifier[getSourceLocation] operator[SEP] operator[SEP] , identifier[UNKNOWN_SOY_PY_SRC_PRINT_DIRECTIVE] , identifier[directiveNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[List] operator[<] identifier[ExprRootNode] operator[>] identifier[args] operator[=] identifier[directiveNode] operator[SEP] identifier[getArgs] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[PyExpr] operator[>] identifier[argsPyExprs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[args] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ExprRootNode] identifier[arg] operator[:] identifier[args] operator[SEP] { identifier[argsPyExprs] operator[SEP] identifier[add] operator[SEP] identifier[translator] operator[SEP] identifier[exec] operator[SEP] identifier[arg] operator[SEP] operator[SEP] operator[SEP] } identifier[pyExpr] operator[=] operator[SEP] operator[SEP] identifier[SoyPySrcPrintDirective] operator[SEP] identifier[directive] operator[SEP] operator[SEP] identifier[applyForPySrc] operator[SEP] identifier[pyExpr] , identifier[argsPyExprs] operator[SEP] operator[SEP] } identifier[pyExprs] operator[SEP] identifier[add] operator[SEP] identifier[pyExpr] operator[SEP] operator[SEP] }
public static Bitmap textToBitmap(@NonNull final Context context, final int width, final int height, @ColorInt final int backgroundColor, @NonNull final CharSequence text, final float textSize, @ColorInt final int textColor) { return textToBitmap(context, width, height, backgroundColor, text, textSize, textColor, null); }
class class_name[name] begin[{] method[textToBitmap, return_type[type[Bitmap]], modifier[public static], parameter[context, width, height, backgroundColor, text, textSize, textColor]] begin[{] return[call[.textToBitmap, parameter[member[.context], member[.width], member[.height], member[.backgroundColor], member[.text], member[.textSize], member[.textColor], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Bitmap] identifier[textToBitmap] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[Context] identifier[context] , Keyword[final] Keyword[int] identifier[width] , Keyword[final] Keyword[int] identifier[height] , annotation[@] identifier[ColorInt] Keyword[final] Keyword[int] identifier[backgroundColor] , annotation[@] identifier[NonNull] Keyword[final] identifier[CharSequence] identifier[text] , Keyword[final] Keyword[float] identifier[textSize] , annotation[@] identifier[ColorInt] Keyword[final] Keyword[int] identifier[textColor] operator[SEP] { Keyword[return] identifier[textToBitmap] operator[SEP] identifier[context] , identifier[width] , identifier[height] , identifier[backgroundColor] , identifier[text] , identifier[textSize] , identifier[textColor] , Other[null] operator[SEP] operator[SEP] }
private void initTimeBgRect(float topPaddingSize) { float mHourLeft; float mMinuteLeft; float mSecondLeft; boolean isInitHasBackgroundTextBaseY = false; if (isShowDay) { // initialize day background and border rectF if (isShowTimeBgBorder) { mDayBgBorderRectF = new RectF(mLeftPaddingSize, topPaddingSize, mLeftPaddingSize + mDayTimeBgWidth + (mTimeBgBorderSize * 2), topPaddingSize + mTimeBgSize + (mTimeBgBorderSize * 2)); mDayBgRectF = new RectF(mLeftPaddingSize + mTimeBgBorderSize, topPaddingSize + mTimeBgBorderSize, mLeftPaddingSize + mDayTimeBgWidth + mTimeBgBorderSize, topPaddingSize + mTimeBgSize + mTimeBgBorderSize); } else { mDayBgRectF = new RectF(mLeftPaddingSize, topPaddingSize, mLeftPaddingSize + mDayTimeBgWidth, topPaddingSize + mTimeBgSize); } // hour left point mHourLeft = mLeftPaddingSize + mDayTimeBgWidth + mSuffixDayTextWidth + mSuffixDayLeftMargin + mSuffixDayRightMargin + (mTimeBgBorderSize * 2); if (!isShowHour && !isShowMinute && !isShowSecond) { isInitHasBackgroundTextBaseY = true; initHasBackgroundTextBaseY(mDayBgRectF); } } else { // hour left point mHourLeft = mLeftPaddingSize; } if (isShowHour) { // initialize hour background border rectF if (isShowTimeBgBorder) { mHourBgBorderRectF = new RectF(mHourLeft, topPaddingSize, mHourLeft + mTimeBgSize + (mTimeBgBorderSize * 2), topPaddingSize + mTimeBgSize + (mTimeBgBorderSize * 2)); mHourBgRectF = new RectF(mHourLeft + mTimeBgBorderSize, topPaddingSize + mTimeBgBorderSize, mHourLeft + mTimeBgSize + mTimeBgBorderSize, topPaddingSize + mTimeBgSize + mTimeBgBorderSize); } else { mHourBgRectF = new RectF(mHourLeft, topPaddingSize, mHourLeft + mTimeBgSize, topPaddingSize + mTimeBgSize); } // minute left point mMinuteLeft = mHourLeft + mTimeBgSize + mSuffixHourTextWidth + mSuffixHourLeftMargin + mSuffixHourRightMargin + (mTimeBgBorderSize * 2); if (!isInitHasBackgroundTextBaseY) { isInitHasBackgroundTextBaseY = true; initHasBackgroundTextBaseY(mHourBgRectF); } } else { // minute left point mMinuteLeft = mHourLeft; } if (isShowMinute) { // initialize minute background border rectF if (isShowTimeBgBorder) { mMinuteBgBorderRectF = new RectF(mMinuteLeft, topPaddingSize, mMinuteLeft + mTimeBgSize + (mTimeBgBorderSize * 2), topPaddingSize + mTimeBgSize + (mTimeBgBorderSize * 2)); mMinuteBgRectF = new RectF(mMinuteLeft + mTimeBgBorderSize, topPaddingSize + mTimeBgBorderSize, mMinuteLeft + mTimeBgSize + mTimeBgBorderSize, topPaddingSize + mTimeBgSize + mTimeBgBorderSize); } else { mMinuteBgRectF = new RectF(mMinuteLeft, topPaddingSize, mMinuteLeft + mTimeBgSize, topPaddingSize + mTimeBgSize); } // second left point mSecondLeft = mMinuteLeft + mTimeBgSize + mSuffixMinuteTextWidth + mSuffixMinuteLeftMargin + mSuffixMinuteRightMargin + (mTimeBgBorderSize * 2); if (!isInitHasBackgroundTextBaseY) { isInitHasBackgroundTextBaseY = true; initHasBackgroundTextBaseY(mMinuteBgRectF); } } else { // second left point mSecondLeft = mMinuteLeft; } if (isShowSecond) { // initialize second background border rectF if (isShowTimeBgBorder) { mSecondBgBorderRectF = new RectF(mSecondLeft, topPaddingSize, mSecondLeft + mTimeBgSize + (mTimeBgBorderSize * 2), topPaddingSize + mTimeBgSize + (mTimeBgBorderSize * 2)); mSecondBgRectF = new RectF(mSecondLeft + mTimeBgBorderSize, topPaddingSize + mTimeBgBorderSize, mSecondLeft + mTimeBgSize + mTimeBgBorderSize, topPaddingSize + mTimeBgSize + mTimeBgBorderSize); } else { mSecondBgRectF = new RectF(mSecondLeft, topPaddingSize, mSecondLeft + mTimeBgSize, topPaddingSize + mTimeBgSize); } if (isShowMillisecond) { // millisecond left point float mMillisecondLeft = mSecondLeft + mTimeBgSize + mSuffixSecondTextWidth + mSuffixSecondLeftMargin + mSuffixSecondRightMargin + (mTimeBgBorderSize * 2); // initialize millisecond background border rectF if (isShowTimeBgBorder) { mMillisecondBgBorderRectF = new RectF(mMillisecondLeft, topPaddingSize, mMillisecondLeft + mTimeBgSize + (mTimeBgBorderSize * 2), topPaddingSize + mTimeBgSize + (mTimeBgBorderSize * 2)); mMillisecondBgRectF = new RectF(mMillisecondLeft + mTimeBgBorderSize, topPaddingSize + mTimeBgBorderSize, mMillisecondLeft + mTimeBgSize + mTimeBgBorderSize, topPaddingSize + mTimeBgSize + mTimeBgBorderSize); } else { mMillisecondBgRectF = new RectF(mMillisecondLeft, topPaddingSize, mMillisecondLeft + mTimeBgSize, topPaddingSize + mTimeBgSize); } } if (!isInitHasBackgroundTextBaseY) { initHasBackgroundTextBaseY(mSecondBgRectF); } } }
class class_name[name] begin[{] method[initTimeBgRect, return_type[void], modifier[private], parameter[topPaddingSize]] begin[{] local_variable[type[float], mHourLeft] local_variable[type[float], mMinuteLeft] local_variable[type[float], mSecondLeft] local_variable[type[boolean], isInitHasBackgroundTextBaseY] if[member[.isShowDay]] begin[{] if[member[.isShowTimeBgBorder]] begin[{] assign[member[.mDayBgBorderRectF], ClassCreator(arguments=[MemberReference(member=mLeftPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mLeftPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mDayTimeBgWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RectF, sub_type=None))] assign[member[.mDayBgRectF], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=mLeftPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mLeftPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mDayTimeBgWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, 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=RectF, sub_type=None))] else begin[{] assign[member[.mDayBgRectF], ClassCreator(arguments=[MemberReference(member=mLeftPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mLeftPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mDayTimeBgWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, 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=RectF, sub_type=None))] end[}] assign[member[.mHourLeft], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.mLeftPaddingSize], +, member[.mDayTimeBgWidth]], +, member[.mSuffixDayTextWidth]], +, member[.mSuffixDayLeftMargin]], +, member[.mSuffixDayRightMargin]], +, binary_operation[member[.mTimeBgBorderSize], *, literal[2]]]] if[binary_operation[binary_operation[member[.isShowHour], &&, member[.isShowMinute]], &&, member[.isShowSecond]]] begin[{] assign[member[.isInitHasBackgroundTextBaseY], literal[true]] call[.initHasBackgroundTextBaseY, parameter[member[.mDayBgRectF]]] else begin[{] None end[}] else begin[{] assign[member[.mHourLeft], member[.mLeftPaddingSize]] end[}] if[member[.isShowHour]] begin[{] if[member[.isShowTimeBgBorder]] begin[{] assign[member[.mHourBgBorderRectF], ClassCreator(arguments=[MemberReference(member=mHourLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mHourLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RectF, sub_type=None))] assign[member[.mHourBgRectF], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=mHourLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mHourLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, 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=RectF, sub_type=None))] else begin[{] assign[member[.mHourBgRectF], ClassCreator(arguments=[MemberReference(member=mHourLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mHourLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, 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=RectF, sub_type=None))] end[}] assign[member[.mMinuteLeft], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.mHourLeft], +, member[.mTimeBgSize]], +, member[.mSuffixHourTextWidth]], +, member[.mSuffixHourLeftMargin]], +, member[.mSuffixHourRightMargin]], +, binary_operation[member[.mTimeBgBorderSize], *, literal[2]]]] if[member[.isInitHasBackgroundTextBaseY]] begin[{] assign[member[.isInitHasBackgroundTextBaseY], literal[true]] call[.initHasBackgroundTextBaseY, parameter[member[.mHourBgRectF]]] else begin[{] None end[}] else begin[{] assign[member[.mMinuteLeft], member[.mHourLeft]] end[}] if[member[.isShowMinute]] begin[{] if[member[.isShowTimeBgBorder]] begin[{] assign[member[.mMinuteBgBorderRectF], ClassCreator(arguments=[MemberReference(member=mMinuteLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mMinuteLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RectF, sub_type=None))] assign[member[.mMinuteBgRectF], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=mMinuteLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mMinuteLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, 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=RectF, sub_type=None))] else begin[{] assign[member[.mMinuteBgRectF], ClassCreator(arguments=[MemberReference(member=mMinuteLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mMinuteLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, 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=RectF, sub_type=None))] end[}] assign[member[.mSecondLeft], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.mMinuteLeft], +, member[.mTimeBgSize]], +, member[.mSuffixMinuteTextWidth]], +, member[.mSuffixMinuteLeftMargin]], +, member[.mSuffixMinuteRightMargin]], +, binary_operation[member[.mTimeBgBorderSize], *, literal[2]]]] if[member[.isInitHasBackgroundTextBaseY]] begin[{] assign[member[.isInitHasBackgroundTextBaseY], literal[true]] call[.initHasBackgroundTextBaseY, parameter[member[.mMinuteBgRectF]]] else begin[{] None end[}] else begin[{] assign[member[.mSecondLeft], member[.mMinuteLeft]] end[}] if[member[.isShowSecond]] begin[{] if[member[.isShowTimeBgBorder]] begin[{] assign[member[.mSecondBgBorderRectF], ClassCreator(arguments=[MemberReference(member=mSecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mSecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RectF, sub_type=None))] assign[member[.mSecondBgRectF], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=mSecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mSecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, 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=RectF, sub_type=None))] else begin[{] assign[member[.mSecondBgRectF], ClassCreator(arguments=[MemberReference(member=mSecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mSecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, 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=RectF, sub_type=None))] end[}] if[member[.isShowMillisecond]] begin[{] local_variable[type[float], mMillisecondLeft] if[member[.isShowTimeBgBorder]] begin[{] assign[member[.mMillisecondBgBorderRectF], ClassCreator(arguments=[MemberReference(member=mMillisecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mMillisecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RectF, sub_type=None))] assign[member[.mMillisecondBgRectF], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=mMillisecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mMillisecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=mTimeBgBorderSize, 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=RectF, sub_type=None))] else begin[{] assign[member[.mMillisecondBgRectF], ClassCreator(arguments=[MemberReference(member=mMillisecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mMillisecondLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=topPaddingSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mTimeBgSize, 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=RectF, sub_type=None))] end[}] else begin[{] None end[}] if[member[.isInitHasBackgroundTextBaseY]] begin[{] call[.initHasBackgroundTextBaseY, parameter[member[.mSecondBgRectF]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[initTimeBgRect] operator[SEP] Keyword[float] identifier[topPaddingSize] operator[SEP] { Keyword[float] identifier[mHourLeft] operator[SEP] Keyword[float] identifier[mMinuteLeft] operator[SEP] Keyword[float] identifier[mSecondLeft] operator[SEP] Keyword[boolean] identifier[isInitHasBackgroundTextBaseY] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[isShowDay] operator[SEP] { Keyword[if] operator[SEP] identifier[isShowTimeBgBorder] operator[SEP] { identifier[mDayBgBorderRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mLeftPaddingSize] , identifier[topPaddingSize] , identifier[mLeftPaddingSize] operator[+] identifier[mDayTimeBgWidth] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[mDayBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mLeftPaddingSize] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgBorderSize] , identifier[mLeftPaddingSize] operator[+] identifier[mDayTimeBgWidth] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] operator[SEP] operator[SEP] } Keyword[else] { identifier[mDayBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mLeftPaddingSize] , identifier[topPaddingSize] , identifier[mLeftPaddingSize] operator[+] identifier[mDayTimeBgWidth] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[SEP] operator[SEP] } identifier[mHourLeft] operator[=] identifier[mLeftPaddingSize] operator[+] identifier[mDayTimeBgWidth] operator[+] identifier[mSuffixDayTextWidth] operator[+] identifier[mSuffixDayLeftMargin] operator[+] identifier[mSuffixDayRightMargin] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isShowHour] operator[&&] operator[!] identifier[isShowMinute] operator[&&] operator[!] identifier[isShowSecond] operator[SEP] { identifier[isInitHasBackgroundTextBaseY] operator[=] literal[boolean] operator[SEP] identifier[initHasBackgroundTextBaseY] operator[SEP] identifier[mDayBgRectF] operator[SEP] operator[SEP] } } Keyword[else] { identifier[mHourLeft] operator[=] identifier[mLeftPaddingSize] operator[SEP] } Keyword[if] operator[SEP] identifier[isShowHour] operator[SEP] { Keyword[if] operator[SEP] identifier[isShowTimeBgBorder] operator[SEP] { identifier[mHourBgBorderRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mHourLeft] , identifier[topPaddingSize] , identifier[mHourLeft] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[mHourBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mHourLeft] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgBorderSize] , identifier[mHourLeft] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] operator[SEP] operator[SEP] } Keyword[else] { identifier[mHourBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mHourLeft] , identifier[topPaddingSize] , identifier[mHourLeft] operator[+] identifier[mTimeBgSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[SEP] operator[SEP] } identifier[mMinuteLeft] operator[=] identifier[mHourLeft] operator[+] identifier[mTimeBgSize] operator[+] identifier[mSuffixHourTextWidth] operator[+] identifier[mSuffixHourLeftMargin] operator[+] identifier[mSuffixHourRightMargin] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isInitHasBackgroundTextBaseY] operator[SEP] { identifier[isInitHasBackgroundTextBaseY] operator[=] literal[boolean] operator[SEP] identifier[initHasBackgroundTextBaseY] operator[SEP] identifier[mHourBgRectF] operator[SEP] operator[SEP] } } Keyword[else] { identifier[mMinuteLeft] operator[=] identifier[mHourLeft] operator[SEP] } Keyword[if] operator[SEP] identifier[isShowMinute] operator[SEP] { Keyword[if] operator[SEP] identifier[isShowTimeBgBorder] operator[SEP] { identifier[mMinuteBgBorderRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mMinuteLeft] , identifier[topPaddingSize] , identifier[mMinuteLeft] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[mMinuteBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mMinuteLeft] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgBorderSize] , identifier[mMinuteLeft] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] operator[SEP] operator[SEP] } Keyword[else] { identifier[mMinuteBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mMinuteLeft] , identifier[topPaddingSize] , identifier[mMinuteLeft] operator[+] identifier[mTimeBgSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[SEP] operator[SEP] } identifier[mSecondLeft] operator[=] identifier[mMinuteLeft] operator[+] identifier[mTimeBgSize] operator[+] identifier[mSuffixMinuteTextWidth] operator[+] identifier[mSuffixMinuteLeftMargin] operator[+] identifier[mSuffixMinuteRightMargin] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isInitHasBackgroundTextBaseY] operator[SEP] { identifier[isInitHasBackgroundTextBaseY] operator[=] literal[boolean] operator[SEP] identifier[initHasBackgroundTextBaseY] operator[SEP] identifier[mMinuteBgRectF] operator[SEP] operator[SEP] } } Keyword[else] { identifier[mSecondLeft] operator[=] identifier[mMinuteLeft] operator[SEP] } Keyword[if] operator[SEP] identifier[isShowSecond] operator[SEP] { Keyword[if] operator[SEP] identifier[isShowTimeBgBorder] operator[SEP] { identifier[mSecondBgBorderRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mSecondLeft] , identifier[topPaddingSize] , identifier[mSecondLeft] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[mSecondBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mSecondLeft] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgBorderSize] , identifier[mSecondLeft] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] operator[SEP] operator[SEP] } Keyword[else] { identifier[mSecondBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mSecondLeft] , identifier[topPaddingSize] , identifier[mSecondLeft] operator[+] identifier[mTimeBgSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isShowMillisecond] operator[SEP] { Keyword[float] identifier[mMillisecondLeft] operator[=] identifier[mSecondLeft] operator[+] identifier[mTimeBgSize] operator[+] identifier[mSuffixSecondTextWidth] operator[+] identifier[mSuffixSecondLeftMargin] operator[+] identifier[mSuffixSecondRightMargin] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isShowTimeBgBorder] operator[SEP] { identifier[mMillisecondBgBorderRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mMillisecondLeft] , identifier[topPaddingSize] , identifier[mMillisecondLeft] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] operator[SEP] identifier[mTimeBgBorderSize] operator[*] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[mMillisecondBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mMillisecondLeft] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgBorderSize] , identifier[mMillisecondLeft] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[+] identifier[mTimeBgBorderSize] operator[SEP] operator[SEP] } Keyword[else] { identifier[mMillisecondBgRectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mMillisecondLeft] , identifier[topPaddingSize] , identifier[mMillisecondLeft] operator[+] identifier[mTimeBgSize] , identifier[topPaddingSize] operator[+] identifier[mTimeBgSize] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isInitHasBackgroundTextBaseY] operator[SEP] { identifier[initHasBackgroundTextBaseY] operator[SEP] identifier[mSecondBgRectF] operator[SEP] operator[SEP] } } }
@Override public RecordWriter<NullWritable,SpreadSheetCellDAO> getRecordWriter(TaskAttemptContext context) throws IOException { // check if mimeType is set. If not assume new Excel format (.xlsx) Configuration conf=context.getConfiguration(); String defaultConf=conf.get(HadoopOfficeWriteConfiguration.CONF_MIMETYPE,ExcelFileOutputFormat.DEFAULT_MIMETYPE); conf.set(HadoopOfficeWriteConfiguration.CONF_MIMETYPE,defaultConf); // add suffix Path file = getDefaultWorkFile(context,ExcelFileOutputFormat.getSuffix(conf.get(HadoopOfficeWriteConfiguration.CONF_MIMETYPE))); try { return new ExcelRecordWriter<>(HadoopUtil.getDataOutputStream(conf,file,context,getCompressOutput(context),getOutputCompressorClass(context, ExcelFileOutputFormat.defaultCompressorClass)),file.getName(),conf); } catch (InvalidWriterConfigurationException | InvalidCellSpecificationException | FormatNotUnderstoodException | GeneralSecurityException | OfficeWriterException e) { LOG.error(e); } return null; }
class class_name[name] begin[{] method[getRecordWriter, return_type[type[RecordWriter]], modifier[public], parameter[context]] begin[{] local_variable[type[Configuration], conf] local_variable[type[String], defaultConf] call[conf.set, parameter[member[HadoopOfficeWriteConfiguration.CONF_MIMETYPE], member[.defaultConf]]] local_variable[type[Path], file] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCompressOutput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultCompressorClass, postfix_operators=[], prefix_operators=[], qualifier=ExcelFileOutputFormat, selectors=[])], member=getOutputCompressorClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getDataOutputStream, postfix_operators=[], prefix_operators=[], qualifier=HadoopUtil, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), MemberReference(member=conf, 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=ExcelRecordWriter, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvalidWriterConfigurationException', 'InvalidCellSpecificationException', 'FormatNotUnderstoodException', 'GeneralSecurityException', 'OfficeWriterException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[RecordWriter] operator[<] identifier[NullWritable] , identifier[SpreadSheetCellDAO] operator[>] identifier[getRecordWriter] operator[SEP] identifier[TaskAttemptContext] identifier[context] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Configuration] identifier[conf] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[defaultConf] operator[=] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[HadoopOfficeWriteConfiguration] operator[SEP] identifier[CONF_MIMETYPE] , identifier[ExcelFileOutputFormat] operator[SEP] identifier[DEFAULT_MIMETYPE] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[set] operator[SEP] identifier[HadoopOfficeWriteConfiguration] operator[SEP] identifier[CONF_MIMETYPE] , identifier[defaultConf] operator[SEP] operator[SEP] identifier[Path] identifier[file] operator[=] identifier[getDefaultWorkFile] operator[SEP] identifier[context] , identifier[ExcelFileOutputFormat] operator[SEP] identifier[getSuffix] operator[SEP] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[HadoopOfficeWriteConfiguration] operator[SEP] identifier[CONF_MIMETYPE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] Keyword[new] identifier[ExcelRecordWriter] operator[<] operator[>] operator[SEP] identifier[HadoopUtil] operator[SEP] identifier[getDataOutputStream] operator[SEP] identifier[conf] , identifier[file] , identifier[context] , identifier[getCompressOutput] operator[SEP] identifier[context] operator[SEP] , identifier[getOutputCompressorClass] operator[SEP] identifier[context] , identifier[ExcelFileOutputFormat] operator[SEP] identifier[defaultCompressorClass] operator[SEP] operator[SEP] , identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[conf] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvalidWriterConfigurationException] operator[|] identifier[InvalidCellSpecificationException] operator[|] identifier[FormatNotUnderstoodException] operator[|] identifier[GeneralSecurityException] operator[|] identifier[OfficeWriterException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public ServiceFuture<List<DeletedVaultInner>> listDeletedAsync(final ListOperationCallback<DeletedVaultInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listDeletedSinglePageAsync(), new Func1<String, Observable<ServiceResponse<Page<DeletedVaultInner>>>>() { @Override public Observable<ServiceResponse<Page<DeletedVaultInner>>> call(String nextPageLink) { return listDeletedNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
class class_name[name] begin[{] method[listDeletedAsync, return_type[type[ServiceFuture]], modifier[public], parameter[serviceCallback]] begin[{] return[call[AzureServiceFuture.fromPageResponse, parameter[call[.listDeletedSinglePageAsync, parameter[]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listDeletedNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DeletedVaultInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None), throws=None, type_parameters=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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DeletedVaultInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None))], dimensions=None, name=Func1, sub_type=None)), member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[DeletedVaultInner] operator[>] operator[>] identifier[listDeletedAsync] operator[SEP] Keyword[final] identifier[ListOperationCallback] operator[<] identifier[DeletedVaultInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[listDeletedSinglePageAsync] operator[SEP] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[DeletedVaultInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[DeletedVaultInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listDeletedNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] } } , identifier[serviceCallback] operator[SEP] operator[SEP] }
public static PreparedStatement createWayTagTable(Connection connection, String wayTagTableName, String tagTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { StringBuilder sb = new StringBuilder("CREATE TABLE "); sb.append(wayTagTableName); sb.append("(ID_WAY BIGINT, ID_TAG BIGINT, VALUE VARCHAR);"); stmt.execute(sb.toString()); } //We return the preparedstatement of the way tag table StringBuilder insert = new StringBuilder("INSERT INTO "); insert.append(wayTagTableName); insert.append("VALUES ( ?, "); insert.append("(SELECT ID_TAG FROM ").append(tagTableName).append(" WHERE TAG_KEY = ? LIMIT 1)"); insert.append(", ?);"); return connection.prepareStatement(insert.toString()); }
class class_name[name] begin[{] method[createWayTagTable, return_type[type[PreparedStatement]], modifier[public static], parameter[connection, wayTagTableName, tagTableName]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CREATE TABLE ")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=wayTagTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(ID_WAY BIGINT, ID_TAG BIGINT, VALUE VARCHAR);")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=execute, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stmt, type=ReferenceType(arguments=None, dimensions=[], name=Statement, sub_type=None), value=MethodInvocation(arguments=[], member=createStatement, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None))]) local_variable[type[StringBuilder], insert] call[insert.append, parameter[member[.wayTagTableName]]] call[insert.append, parameter[literal["VALUES ( ?, "]]] call[insert.append, parameter[literal["(SELECT ID_TAG FROM "]]] call[insert.append, parameter[literal[", ?);"]]] return[call[connection.prepareStatement, parameter[call[insert.toString, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[PreparedStatement] identifier[createWayTagTable] operator[SEP] identifier[Connection] identifier[connection] , identifier[String] identifier[wayTagTableName] , identifier[String] identifier[tagTableName] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[try] operator[SEP] identifier[Statement] identifier[stmt] operator[=] identifier[connection] operator[SEP] identifier[createStatement] operator[SEP] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[wayTagTableName] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[execute] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[insert] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[insert] operator[SEP] identifier[append] operator[SEP] identifier[wayTagTableName] operator[SEP] operator[SEP] identifier[insert] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[insert] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[tagTableName] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[insert] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[connection] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[insert] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public DateTime minusWeeks(int weeks) { if (weeks == 0) { return this; } long instant = getChronology().weeks().subtract(getMillis(), weeks); return withMillis(instant); }
class class_name[name] begin[{] method[minusWeeks, return_type[type[DateTime]], modifier[public], parameter[weeks]] begin[{] if[binary_operation[member[.weeks], ==, literal[0]]] begin[{] return[THIS[]] else begin[{] None end[}] local_variable[type[long], instant] return[call[.withMillis, parameter[member[.instant]]]] end[}] END[}]
Keyword[public] identifier[DateTime] identifier[minusWeeks] operator[SEP] Keyword[int] identifier[weeks] operator[SEP] { Keyword[if] operator[SEP] identifier[weeks] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } Keyword[long] identifier[instant] operator[=] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] identifier[weeks] operator[SEP] operator[SEP] operator[SEP] identifier[subtract] operator[SEP] identifier[getMillis] operator[SEP] operator[SEP] , identifier[weeks] operator[SEP] operator[SEP] Keyword[return] identifier[withMillis] operator[SEP] identifier[instant] operator[SEP] operator[SEP] }
public static String[] requireAttributes(final XMLExtendedStreamReader reader, final String... attributeNames) throws XMLStreamException { final int length = attributeNames.length; final String[] result = new String[length]; for (int i = 0; i < length; i++) { final String name = attributeNames[i]; final String value = reader.getAttributeValue(null, name); if (value == null) { throw missingRequired(reader, Collections.singleton(name)); } result[i] = value; } return result; }
class class_name[name] begin[{] method[requireAttributes, return_type[type[String]], modifier[public static], parameter[reader, attributeNames]] begin[{] local_variable[type[int], length] local_variable[type[String], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=name)], 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=[], value=null), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributeValue, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=value)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, 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=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singleton, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=missingRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, 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[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[requireAttributes] operator[SEP] Keyword[final] identifier[XMLExtendedStreamReader] identifier[reader] , Keyword[final] identifier[String] operator[...] identifier[attributeNames] operator[SEP] Keyword[throws] identifier[XMLStreamException] { Keyword[final] Keyword[int] identifier[length] operator[=] identifier[attributeNames] operator[SEP] identifier[length] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[String] identifier[name] operator[=] identifier[attributeNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[=] identifier[reader] operator[SEP] identifier[getAttributeValue] operator[SEP] Other[null] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[throw] identifier[missingRequired] operator[SEP] identifier[reader] , identifier[Collections] operator[SEP] identifier[singleton] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[value] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public boolean find(String xmlPathQuery) { XmlPath xmlPath = XmlPathParser.parse(xmlPathQuery); XmlNode node; while((node = pullXmlNode()) != null) { if(node instanceof XmlStartElement) { XmlStartElement startElement = (XmlStartElement) node; Element element = new Element(startElement.getLocalName()); element.addAttributes(startElement.getAttributes()); currentPath.addLast(element); if(xmlPath.matches(currentPath)) { nodeQueue.push(node); currentPath.removeLast(); return true; } } else if(node instanceof XmlEndElement) { if(currentPath.getLast() instanceof Content) { currentPath.removeLast(); } currentPath.removeLast(); } else if(node instanceof XmlContent) { XmlContent content = (XmlContent) node; if(currentPath.getLast() instanceof Content) { currentPath.removeLast(); } currentPath.addLast(new Content(content.getText())); } else { throw new XmlReaderException("Unknown XmlNode type: " + node); } } return false; }
class class_name[name] begin[{] method[find, return_type[type[boolean]], modifier[public], parameter[xmlPathQuery]] begin[{] local_variable[type[XmlPath], xmlPath] local_variable[type[XmlNode], node] while[binary_operation[assign[member[.node], call[.pullXmlNode, parameter[]]], !=, literal[null]]] begin[{] if[binary_operation[member[.node], instanceof, type[XmlStartElement]]] begin[{] local_variable[type[XmlStartElement], startElement] local_variable[type[Element], element] call[element.addAttributes, parameter[call[startElement.getAttributes, parameter[]]]] call[currentPath.addLast, parameter[member[.element]]] if[call[xmlPath.matches, parameter[member[.currentPath]]]] begin[{] call[nodeQueue.push, parameter[member[.node]]] call[currentPath.removeLast, parameter[]] return[literal[true]] else begin[{] None end[}] else begin[{] if[binary_operation[member[.node], instanceof, type[XmlEndElement]]] begin[{] if[binary_operation[call[currentPath.getLast, parameter[]], instanceof, type[Content]]] begin[{] call[currentPath.removeLast, parameter[]] else begin[{] None end[}] call[currentPath.removeLast, parameter[]] else begin[{] if[binary_operation[member[.node], instanceof, type[XmlContent]]] begin[{] local_variable[type[XmlContent], content] if[binary_operation[call[currentPath.getLast, parameter[]], instanceof, type[Content]]] begin[{] call[currentPath.removeLast, parameter[]] else begin[{] None end[}] call[currentPath.addLast, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Content, sub_type=None))]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown XmlNode type: "), operandr=MemberReference(member=node, 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=XmlReaderException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[find] operator[SEP] identifier[String] identifier[xmlPathQuery] operator[SEP] { identifier[XmlPath] identifier[xmlPath] operator[=] identifier[XmlPathParser] operator[SEP] identifier[parse] operator[SEP] identifier[xmlPathQuery] operator[SEP] operator[SEP] identifier[XmlNode] identifier[node] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[node] operator[=] identifier[pullXmlNode] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[XmlStartElement] operator[SEP] { identifier[XmlStartElement] identifier[startElement] operator[=] operator[SEP] identifier[XmlStartElement] operator[SEP] identifier[node] operator[SEP] identifier[Element] identifier[element] operator[=] Keyword[new] identifier[Element] operator[SEP] identifier[startElement] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[addAttributes] operator[SEP] identifier[startElement] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[currentPath] operator[SEP] identifier[addLast] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xmlPath] operator[SEP] identifier[matches] operator[SEP] identifier[currentPath] operator[SEP] operator[SEP] { identifier[nodeQueue] operator[SEP] identifier[push] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[currentPath] operator[SEP] identifier[removeLast] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[XmlEndElement] operator[SEP] { Keyword[if] operator[SEP] identifier[currentPath] operator[SEP] identifier[getLast] operator[SEP] operator[SEP] Keyword[instanceof] identifier[Content] operator[SEP] { identifier[currentPath] operator[SEP] identifier[removeLast] operator[SEP] operator[SEP] operator[SEP] } identifier[currentPath] operator[SEP] identifier[removeLast] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[XmlContent] operator[SEP] { identifier[XmlContent] identifier[content] operator[=] operator[SEP] identifier[XmlContent] operator[SEP] identifier[node] operator[SEP] Keyword[if] operator[SEP] identifier[currentPath] operator[SEP] identifier[getLast] operator[SEP] operator[SEP] Keyword[instanceof] identifier[Content] operator[SEP] { identifier[currentPath] operator[SEP] identifier[removeLast] operator[SEP] operator[SEP] operator[SEP] } identifier[currentPath] operator[SEP] identifier[addLast] operator[SEP] Keyword[new] identifier[Content] operator[SEP] identifier[content] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[XmlReaderException] operator[SEP] literal[String] operator[+] identifier[node] operator[SEP] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public ZonedDateTime getAsDateTimeWithDefault(String key, ZonedDateTime defaultValue) { Object value = getAsObject(key); return DateTimeConverter.toDateTimeWithDefault(value, defaultValue); }
class class_name[name] begin[{] method[getAsDateTimeWithDefault, return_type[type[ZonedDateTime]], modifier[public], parameter[key, defaultValue]] begin[{] local_variable[type[Object], value] return[call[DateTimeConverter.toDateTimeWithDefault, parameter[member[.value], member[.defaultValue]]]] end[}] END[}]
Keyword[public] identifier[ZonedDateTime] identifier[getAsDateTimeWithDefault] operator[SEP] identifier[String] identifier[key] , identifier[ZonedDateTime] identifier[defaultValue] operator[SEP] { identifier[Object] identifier[value] operator[=] identifier[getAsObject] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] identifier[DateTimeConverter] operator[SEP] identifier[toDateTimeWithDefault] operator[SEP] identifier[value] , identifier[defaultValue] operator[SEP] operator[SEP] }
public static boolean isSymbolicLink(File file) throws IOException { // first try using Java 7 try { // use reflection here Class<?> filesClass = Class.forName("java.nio.file.Files"); Class<?> pathClass = Class.forName("java.nio.file.Path"); Object path = File.class.getMethod("toPath").invoke(file); return ((Boolean) filesClass.getMethod("isSymbolicLink", pathClass).invoke(null, path)) .booleanValue(); } catch (InvocationTargetException exception) { Throwable cause = exception.getCause(); Throwables.propagateIfPossible(cause, IOException.class); // shouldn't reach this point, but just in case... throw new RuntimeException(cause); } catch (ClassNotFoundException exception) { // handled below } catch (IllegalArgumentException exception) { // handled below } catch (SecurityException exception) { // handled below } catch (IllegalAccessException exception) { // handled below } catch (NoSuchMethodException exception) { // handled below } // backup option compatible with earlier Java // this won't work on Windows, which is where separator char is '\\' if (File.separatorChar == '\\') { return false; } File canonical = file; if (file.getParent() != null) { canonical = new File(file.getParentFile().getCanonicalFile(), file.getName()); } return !canonical.getCanonicalFile().equals(canonical.getAbsoluteFile()); }
class class_name[name] begin[{] method[isSymbolicLink, return_type[type[boolean]], modifier[public static], parameter[file]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.nio.file.Files")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=filesClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.nio.file.Path")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=pathClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="toPath")], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="isSymbolicLink"), MemberReference(member=pathClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=filesClass, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=exception, selectors=[], type_arguments=None), name=cause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None))], member=propagateIfPossible, postfix_operators=[], prefix_operators=[], qualifier=Throwables, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=cause, 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=exception, types=['InvocationTargetException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['ClassNotFoundException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['IllegalArgumentException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['SecurityException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['IllegalAccessException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[File.separatorChar], ==, literal['\\']]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[File], canonical] if[binary_operation[call[file.getParent, parameter[]], !=, literal[null]]] begin[{] assign[member[.canonical], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getParentFile, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[MethodInvocation(arguments=[], member=getCanonicalFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] else begin[{] None end[}] return[call[canonical.getCanonicalFile, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isSymbolicLink] operator[SEP] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[Class] operator[<] operator[?] operator[>] identifier[filesClass] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[pathClass] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[path] operator[=] identifier[File] operator[SEP] Keyword[class] operator[SEP] identifier[getMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[filesClass] operator[SEP] identifier[getMethod] operator[SEP] literal[String] , identifier[pathClass] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] Other[null] , identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[exception] operator[SEP] { identifier[Throwable] identifier[cause] operator[=] identifier[exception] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] identifier[Throwables] operator[SEP] identifier[propagateIfPossible] operator[SEP] identifier[cause] , identifier[IOException] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[cause] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[exception] operator[SEP] { } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[exception] operator[SEP] { } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[exception] operator[SEP] { } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[exception] operator[SEP] { } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[exception] operator[SEP] { } Keyword[if] operator[SEP] identifier[File] operator[SEP] identifier[separatorChar] operator[==] literal[String] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[File] identifier[canonical] operator[=] identifier[file] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[canonical] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalFile] operator[SEP] operator[SEP] , identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[!] identifier[canonical] operator[SEP] identifier[getCanonicalFile] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[canonical] operator[SEP] identifier[getAbsoluteFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public SIMPIterator getForeignDestinationIterator() { DestinationTypeFilter filter = new DestinationTypeFilter(); filter.FOREIGN_DESTINATION = Boolean.TRUE; SIMPIterator destItr = destinationIndex.iterator(filter); return new ControllableIterator(destItr); }
class class_name[name] begin[{] method[getForeignDestinationIterator, return_type[type[SIMPIterator]], modifier[public], parameter[]] begin[{] local_variable[type[DestinationTypeFilter], filter] assign[member[filter.FOREIGN_DESTINATION], member[Boolean.TRUE]] local_variable[type[SIMPIterator], destItr] return[ClassCreator(arguments=[MemberReference(member=destItr, 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=ControllableIterator, sub_type=None))] end[}] END[}]
Keyword[public] identifier[SIMPIterator] identifier[getForeignDestinationIterator] operator[SEP] operator[SEP] { identifier[DestinationTypeFilter] identifier[filter] operator[=] Keyword[new] identifier[DestinationTypeFilter] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[FOREIGN_DESTINATION] operator[=] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] identifier[SIMPIterator] identifier[destItr] operator[=] identifier[destinationIndex] operator[SEP] identifier[iterator] operator[SEP] identifier[filter] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ControllableIterator] operator[SEP] identifier[destItr] operator[SEP] operator[SEP] }
static String getJavaScriptUnicodeEscapeString(char ch) { int chInt = (int)ch; if(chInt>=ENCODE_RANGE_1_START && chInt<ENCODE_RANGE_1_END) { return javaScriptUnicodeEscapeStrings1[chInt - ENCODE_RANGE_1_START]; } if(chInt>=ENCODE_RANGE_2_START && chInt<ENCODE_RANGE_2_END) { return javaScriptUnicodeEscapeStrings2[chInt - ENCODE_RANGE_2_START]; } if(chInt>=ENCODE_RANGE_3_START && chInt<ENCODE_RANGE_3_END) { return javaScriptUnicodeEscapeStrings3[chInt - ENCODE_RANGE_3_START]; } // No encoding needed return null; }
class class_name[name] begin[{] method[getJavaScriptUnicodeEscapeString, return_type[type[String]], modifier[static], parameter[ch]] begin[{] local_variable[type[int], chInt] if[binary_operation[binary_operation[member[.chInt], >=, member[.ENCODE_RANGE_1_START]], &&, binary_operation[member[.chInt], <, member[.ENCODE_RANGE_1_END]]]] begin[{] return[member[.javaScriptUnicodeEscapeStrings1]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.chInt], >=, member[.ENCODE_RANGE_2_START]], &&, binary_operation[member[.chInt], <, member[.ENCODE_RANGE_2_END]]]] begin[{] return[member[.javaScriptUnicodeEscapeStrings2]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.chInt], >=, member[.ENCODE_RANGE_3_START]], &&, binary_operation[member[.chInt], <, member[.ENCODE_RANGE_3_END]]]] begin[{] return[member[.javaScriptUnicodeEscapeStrings3]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[static] identifier[String] identifier[getJavaScriptUnicodeEscapeString] operator[SEP] Keyword[char] identifier[ch] operator[SEP] { Keyword[int] identifier[chInt] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[ch] operator[SEP] Keyword[if] operator[SEP] identifier[chInt] operator[>=] identifier[ENCODE_RANGE_1_START] operator[&&] identifier[chInt] operator[<] identifier[ENCODE_RANGE_1_END] operator[SEP] { Keyword[return] identifier[javaScriptUnicodeEscapeStrings1] operator[SEP] identifier[chInt] operator[-] identifier[ENCODE_RANGE_1_START] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[chInt] operator[>=] identifier[ENCODE_RANGE_2_START] operator[&&] identifier[chInt] operator[<] identifier[ENCODE_RANGE_2_END] operator[SEP] { Keyword[return] identifier[javaScriptUnicodeEscapeStrings2] operator[SEP] identifier[chInt] operator[-] identifier[ENCODE_RANGE_2_START] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[chInt] operator[>=] identifier[ENCODE_RANGE_3_START] operator[&&] identifier[chInt] operator[<] identifier[ENCODE_RANGE_3_END] operator[SEP] { Keyword[return] identifier[javaScriptUnicodeEscapeStrings3] operator[SEP] identifier[chInt] operator[-] identifier[ENCODE_RANGE_3_START] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public int read() throws IOException { byte b[] = new byte[1]; int n = blob.read(b, 0, pos, b.length); if (n > 0) { pos += n; return b[0]; } return -1; }
class class_name[name] begin[{] method[read, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[byte], b] local_variable[type[int], n] if[binary_operation[member[.n], >, literal[0]]] begin[{] assign[member[.pos], member[.n]] return[member[.b]] else begin[{] None end[}] return[literal[1]] end[}] END[}]
Keyword[public] Keyword[int] identifier[read] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[byte] identifier[b] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[blob] operator[SEP] identifier[read] operator[SEP] identifier[b] , Other[0] , identifier[pos] , identifier[b] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[>] Other[0] operator[SEP] { identifier[pos] operator[+=] identifier[n] operator[SEP] Keyword[return] identifier[b] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
public void getCipherStream(BlockCipher aesCipher, byte[] out, int length, byte[] iv) { System.arraycopy(iv, 0, cipherInBlock, 0, 14); int ctr; for (ctr = 0; ctr < length / BLKLEN; ctr++) { // compute the cipher stream cipherInBlock[14] = (byte) ((ctr & 0xFF00) >> 8); cipherInBlock[15] = (byte) ((ctr & 0x00FF)); aesCipher.processBlock(cipherInBlock, 0, out, ctr * BLKLEN); } // Treat the last bytes: cipherInBlock[14] = (byte) ((ctr & 0xFF00) >> 8); cipherInBlock[15] = (byte) ((ctr & 0x00FF)); aesCipher.processBlock(cipherInBlock, 0, tmpCipherBlock, 0); System.arraycopy(tmpCipherBlock, 0, out, ctr * BLKLEN, length % BLKLEN); }
class class_name[name] begin[{] method[getCipherStream, return_type[void], modifier[public], parameter[aesCipher, out, length, iv]] begin[{] call[System.arraycopy, parameter[member[.iv], literal[0], member[.cipherInBlock], literal[0], literal[14]]] local_variable[type[int], ctr] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cipherInBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=14))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ctr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF00), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cipherInBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=ctr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00FF), operator=&), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cipherInBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=ctr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BLKLEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=processBlock, postfix_operators=[], prefix_operators=[], qualifier=aesCipher, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ctr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BLKLEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operator=<), init=[Assignment(expressionl=MemberReference(member=ctr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=ctr, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.cipherInBlock], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ctr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF00), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.cipherInBlock], Cast(expression=BinaryOperation(operandl=MemberReference(member=ctr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00FF), operator=&), type=BasicType(dimensions=[], name=byte))] call[aesCipher.processBlock, parameter[member[.cipherInBlock], literal[0], member[.tmpCipherBlock], literal[0]]] call[System.arraycopy, parameter[member[.tmpCipherBlock], literal[0], member[.out], binary_operation[member[.ctr], *, member[.BLKLEN]], binary_operation[member[.length], %, member[.BLKLEN]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[getCipherStream] operator[SEP] identifier[BlockCipher] identifier[aesCipher] , Keyword[byte] operator[SEP] operator[SEP] identifier[out] , Keyword[int] identifier[length] , Keyword[byte] operator[SEP] operator[SEP] identifier[iv] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[iv] , Other[0] , identifier[cipherInBlock] , Other[0] , Other[14] operator[SEP] operator[SEP] Keyword[int] identifier[ctr] operator[SEP] Keyword[for] operator[SEP] identifier[ctr] operator[=] Other[0] operator[SEP] identifier[ctr] operator[<] identifier[length] operator[/] identifier[BLKLEN] operator[SEP] identifier[ctr] operator[++] operator[SEP] { identifier[cipherInBlock] operator[SEP] Other[14] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[ctr] operator[&] literal[Integer] operator[SEP] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] identifier[cipherInBlock] operator[SEP] Other[15] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[ctr] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[aesCipher] operator[SEP] identifier[processBlock] operator[SEP] identifier[cipherInBlock] , Other[0] , identifier[out] , identifier[ctr] operator[*] identifier[BLKLEN] operator[SEP] operator[SEP] } identifier[cipherInBlock] operator[SEP] Other[14] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[ctr] operator[&] literal[Integer] operator[SEP] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] identifier[cipherInBlock] operator[SEP] Other[15] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[ctr] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[aesCipher] operator[SEP] identifier[processBlock] operator[SEP] identifier[cipherInBlock] , Other[0] , identifier[tmpCipherBlock] , Other[0] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[tmpCipherBlock] , Other[0] , identifier[out] , identifier[ctr] operator[*] identifier[BLKLEN] , identifier[length] operator[%] identifier[BLKLEN] operator[SEP] operator[SEP] }
@Override public Set<K> keySet() { return new AbstractSet<K>() { @Override public Iterator<K> iterator() { return new Iterator<K>() { final Iterator<AMapEntry<K,V>> it = inner.iterator(); @Override public boolean hasNext() { return it.hasNext(); } @Override public K next() { return it.next().getKey (); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } @Override public int size() { return inner.size(); } }; }
class class_name[name] begin[{] method[keySet, return_type[type[Set]], modifier[public], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=inner, selectors=[], type_arguments=None), name=it)], documentation=None, modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=AMapEntry, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[MethodInvocation(arguments=[], member=getKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=remove, parameters=[], return_type=None, throws=None, type_parameters=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=K, sub_type=None))], dimensions=None, name=Iterator, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=iterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=inner, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=size, parameters=[], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=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=K, sub_type=None))], dimensions=None, name=AbstractSet, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[K] operator[>] identifier[keySet] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractSet] operator[<] identifier[K] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[K] operator[>] identifier[iterator] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[K] operator[>] operator[SEP] operator[SEP] { Keyword[final] identifier[Iterator] operator[<] identifier[AMapEntry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[it] operator[=] identifier[inner] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[K] identifier[next] operator[SEP] operator[SEP] { Keyword[return] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[size] operator[SEP] operator[SEP] { Keyword[return] identifier[inner] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public ListLicenseSpecificationsForResourceResult withLicenseSpecifications(LicenseSpecification... licenseSpecifications) { if (this.licenseSpecifications == null) { setLicenseSpecifications(new java.util.ArrayList<LicenseSpecification>(licenseSpecifications.length)); } for (LicenseSpecification ele : licenseSpecifications) { this.licenseSpecifications.add(ele); } return this; }
class class_name[name] begin[{] method[withLicenseSpecifications, return_type[type[ListLicenseSpecificationsForResourceResult]], modifier[public], parameter[licenseSpecifications]] begin[{] if[binary_operation[THIS[member[None.licenseSpecifications]], ==, literal[null]]] begin[{] call[.setLicenseSpecifications, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=licenseSpecifications, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LicenseSpecification, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=licenseSpecifications, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=licenseSpecifications, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LicenseSpecification, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ListLicenseSpecificationsForResourceResult] identifier[withLicenseSpecifications] operator[SEP] identifier[LicenseSpecification] operator[...] identifier[licenseSpecifications] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[licenseSpecifications] operator[==] Other[null] operator[SEP] { identifier[setLicenseSpecifications] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[LicenseSpecification] operator[>] operator[SEP] identifier[licenseSpecifications] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[LicenseSpecification] identifier[ele] operator[:] identifier[licenseSpecifications] operator[SEP] { Keyword[this] operator[SEP] identifier[licenseSpecifications] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private Object convertStrToObjTree(String s) { Object contentObj = null; if (s != null) { s = s.trim(); try { if (s.startsWith("{")) { contentObj = Config.getInstance().getMapper().readValue(s, new TypeReference<HashMap<String, Object>>() { }); } else if (s.startsWith("[")) { contentObj = Config.getInstance().getMapper().readValue(s, new TypeReference<List<Object>>() { }); } else { logger.error("cannot deserialize json str: {}", s); return null; } } catch (IOException e) { logger.error(e.getMessage()); } } return contentObj; }
class class_name[name] begin[{] method[convertStrToObjTree, return_type[type[Object]], modifier[private], parameter[s]] begin[{] local_variable[type[Object], contentObj] if[binary_operation[member[.s], !=, literal[null]]] begin[{] assign[member[.s], call[s.trim, parameter[]]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot deserialize json str: {}"), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=contentObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Config, selectors=[MethodInvocation(arguments=[], member=getMapper, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[], 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=Object, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=TypeReference, sub_type=None))], member=readValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=contentObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Config, selectors=[MethodInvocation(arguments=[], member=getMapper, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[], 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=HashMap, sub_type=None))], dimensions=None, name=TypeReference, sub_type=None))], member=readValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, 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) else begin[{] None end[}] return[member[.contentObj]] end[}] END[}]
Keyword[private] identifier[Object] identifier[convertStrToObjTree] operator[SEP] identifier[String] identifier[s] operator[SEP] { identifier[Object] identifier[contentObj] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] { identifier[s] operator[=] identifier[s] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[contentObj] operator[=] identifier[Config] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMapper] operator[SEP] operator[SEP] operator[SEP] identifier[readValue] operator[SEP] identifier[s] , Keyword[new] identifier[TypeReference] operator[<] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[contentObj] operator[=] identifier[Config] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMapper] operator[SEP] operator[SEP] operator[SEP] identifier[readValue] operator[SEP] identifier[s] , Keyword[new] identifier[TypeReference] operator[<] identifier[List] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] } Keyword[else] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[s] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[contentObj] operator[SEP] }
public boolean sameState(final IntMomentStatistics other) { return this == other || _min == other._min && _max == other._max && _sum == other._sum && super.sameState(other); }
class class_name[name] begin[{] method[sameState, return_type[type[boolean]], modifier[public], parameter[other]] begin[{] return[binary_operation[binary_operation[THIS[], ==, member[.other]], ||, binary_operation[binary_operation[binary_operation[binary_operation[member[._min], ==, member[other._min]], &&, binary_operation[member[._max], ==, member[other._max]]], &&, binary_operation[member[._sum], ==, member[other._sum]]], &&, SuperMethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sameState, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[sameState] operator[SEP] Keyword[final] identifier[IntMomentStatistics] identifier[other] operator[SEP] { Keyword[return] Keyword[this] operator[==] identifier[other] operator[||] identifier[_min] operator[==] identifier[other] operator[SEP] identifier[_min] operator[&&] identifier[_max] operator[==] identifier[other] operator[SEP] identifier[_max] operator[&&] identifier[_sum] operator[==] identifier[other] operator[SEP] identifier[_sum] operator[&&] Keyword[super] operator[SEP] identifier[sameState] operator[SEP] identifier[other] operator[SEP] operator[SEP] }
public ScreenParent makeScreen(ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String,Object> properties) { ScreenParent screen = null; if ((iDocMode & ClassProject.CLASS_DETAIL_MODE) == ClassProject.CLASS_DETAIL_MODE) screen = Record.makeNewScreen(ClassInfo.CLASS_INFO_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true); else if ((iDocMode & ClassProject.RESOURCE_DETAIL_MODE) == ClassProject.RESOURCE_DETAIL_MODE) screen = Record.makeNewScreen(Resource.RESOURCE_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true); else if ((iDocMode & ScreenConstants.DETAIL_MODE) == ScreenConstants.DETAIL_MODE) screen = Record.makeNewScreen(CLASS_PROJECT_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true); else if ((iDocMode & ScreenConstants.MAINT_MODE) == ScreenConstants.MAINT_MODE) screen = Record.makeNewScreen(CLASS_PROJECT_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true); else if ((iDocMode & ScreenConstants.DISPLAY_MODE) != 0) screen = Record.makeNewScreen(CLASS_PROJECT_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true); else if ((iDocMode & ScreenConstants.MENU_MODE) != 0) screen = Record.makeNewScreen(CLASS_PROJECT_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true); else screen = super.makeScreen(itsLocation, parentScreen, iDocMode, properties); return screen; }
class class_name[name] begin[{] method[makeScreen, return_type[type[ScreenParent]], modifier[public], parameter[itsLocation, parentScreen, iDocMode, properties]] begin[{] local_variable[type[ScreenParent], screen] if[binary_operation[binary_operation[member[.iDocMode], &, member[ClassProject.CLASS_DETAIL_MODE]], ==, member[ClassProject.CLASS_DETAIL_MODE]]] begin[{] assign[member[.screen], call[Record.makeNewScreen, parameter[member[ClassInfo.CLASS_INFO_GRID_SCREEN_CLASS], member[.itsLocation], member[.parentScreen], binary_operation[member[.iDocMode], |, member[ScreenConstants.DONT_DISPLAY_FIELD_DESC]], member[.properties], THIS[], literal[true]]]] else begin[{] if[binary_operation[binary_operation[member[.iDocMode], &, member[ClassProject.RESOURCE_DETAIL_MODE]], ==, member[ClassProject.RESOURCE_DETAIL_MODE]]] begin[{] assign[member[.screen], call[Record.makeNewScreen, parameter[member[Resource.RESOURCE_GRID_SCREEN_CLASS], member[.itsLocation], member[.parentScreen], binary_operation[member[.iDocMode], |, member[ScreenConstants.DONT_DISPLAY_FIELD_DESC]], member[.properties], THIS[], literal[true]]]] else begin[{] if[binary_operation[binary_operation[member[.iDocMode], &, member[ScreenConstants.DETAIL_MODE]], ==, member[ScreenConstants.DETAIL_MODE]]] begin[{] assign[member[.screen], call[Record.makeNewScreen, parameter[member[.CLASS_PROJECT_GRID_SCREEN_CLASS], member[.itsLocation], member[.parentScreen], binary_operation[member[.iDocMode], |, member[ScreenConstants.DONT_DISPLAY_FIELD_DESC]], member[.properties], THIS[], literal[true]]]] else begin[{] if[binary_operation[binary_operation[member[.iDocMode], &, member[ScreenConstants.MAINT_MODE]], ==, member[ScreenConstants.MAINT_MODE]]] begin[{] assign[member[.screen], call[Record.makeNewScreen, parameter[member[.CLASS_PROJECT_SCREEN_CLASS], member[.itsLocation], member[.parentScreen], binary_operation[member[.iDocMode], |, member[ScreenConstants.DONT_DISPLAY_FIELD_DESC]], member[.properties], THIS[], literal[true]]]] else begin[{] if[binary_operation[binary_operation[member[.iDocMode], &, member[ScreenConstants.DISPLAY_MODE]], !=, literal[0]]] begin[{] assign[member[.screen], call[Record.makeNewScreen, parameter[member[.CLASS_PROJECT_GRID_SCREEN_CLASS], member[.itsLocation], member[.parentScreen], binary_operation[member[.iDocMode], |, member[ScreenConstants.DONT_DISPLAY_FIELD_DESC]], member[.properties], THIS[], literal[true]]]] else begin[{] if[binary_operation[binary_operation[member[.iDocMode], &, member[ScreenConstants.MENU_MODE]], !=, literal[0]]] begin[{] assign[member[.screen], call[Record.makeNewScreen, parameter[member[.CLASS_PROJECT_SCREEN_CLASS], member[.itsLocation], member[.parentScreen], binary_operation[member[.iDocMode], |, member[ScreenConstants.DONT_DISPLAY_FIELD_DESC]], member[.properties], THIS[], literal[true]]]] else begin[{] assign[member[.screen], SuperMethodInvocation(arguments=[MemberReference(member=itsLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentScreen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iDocMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeScreen, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] end[}] end[}] end[}] end[}] end[}] return[member[.screen]] end[}] END[}]
Keyword[public] identifier[ScreenParent] identifier[makeScreen] operator[SEP] identifier[ScreenLoc] identifier[itsLocation] , identifier[ComponentParent] identifier[parentScreen] , Keyword[int] identifier[iDocMode] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[SEP] { identifier[ScreenParent] identifier[screen] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[iDocMode] operator[&] identifier[ClassProject] operator[SEP] identifier[CLASS_DETAIL_MODE] operator[SEP] operator[==] identifier[ClassProject] operator[SEP] identifier[CLASS_DETAIL_MODE] operator[SEP] identifier[screen] operator[=] identifier[Record] operator[SEP] identifier[makeNewScreen] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_INFO_GRID_SCREEN_CLASS] , identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] operator[|] identifier[ScreenConstants] operator[SEP] identifier[DONT_DISPLAY_FIELD_DESC] , identifier[properties] , Keyword[this] , literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[iDocMode] operator[&] identifier[ClassProject] operator[SEP] identifier[RESOURCE_DETAIL_MODE] operator[SEP] operator[==] identifier[ClassProject] operator[SEP] identifier[RESOURCE_DETAIL_MODE] operator[SEP] identifier[screen] operator[=] identifier[Record] operator[SEP] identifier[makeNewScreen] operator[SEP] identifier[Resource] operator[SEP] identifier[RESOURCE_GRID_SCREEN_CLASS] , identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] operator[|] identifier[ScreenConstants] operator[SEP] identifier[DONT_DISPLAY_FIELD_DESC] , identifier[properties] , Keyword[this] , literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[iDocMode] operator[&] identifier[ScreenConstants] operator[SEP] identifier[DETAIL_MODE] operator[SEP] operator[==] identifier[ScreenConstants] operator[SEP] identifier[DETAIL_MODE] operator[SEP] identifier[screen] operator[=] identifier[Record] operator[SEP] identifier[makeNewScreen] operator[SEP] identifier[CLASS_PROJECT_GRID_SCREEN_CLASS] , identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] operator[|] identifier[ScreenConstants] operator[SEP] identifier[DONT_DISPLAY_FIELD_DESC] , identifier[properties] , Keyword[this] , literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[iDocMode] operator[&] identifier[ScreenConstants] operator[SEP] identifier[MAINT_MODE] operator[SEP] operator[==] identifier[ScreenConstants] operator[SEP] identifier[MAINT_MODE] operator[SEP] identifier[screen] operator[=] identifier[Record] operator[SEP] identifier[makeNewScreen] operator[SEP] identifier[CLASS_PROJECT_SCREEN_CLASS] , identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] operator[|] identifier[ScreenConstants] operator[SEP] identifier[DONT_DISPLAY_FIELD_DESC] , identifier[properties] , Keyword[this] , literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[iDocMode] operator[&] identifier[ScreenConstants] operator[SEP] identifier[DISPLAY_MODE] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[screen] operator[=] identifier[Record] operator[SEP] identifier[makeNewScreen] operator[SEP] identifier[CLASS_PROJECT_GRID_SCREEN_CLASS] , identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] operator[|] identifier[ScreenConstants] operator[SEP] identifier[DONT_DISPLAY_FIELD_DESC] , identifier[properties] , Keyword[this] , literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[iDocMode] operator[&] identifier[ScreenConstants] operator[SEP] identifier[MENU_MODE] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[screen] operator[=] identifier[Record] operator[SEP] identifier[makeNewScreen] operator[SEP] identifier[CLASS_PROJECT_SCREEN_CLASS] , identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] operator[|] identifier[ScreenConstants] operator[SEP] identifier[DONT_DISPLAY_FIELD_DESC] , identifier[properties] , Keyword[this] , literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[screen] operator[=] Keyword[super] operator[SEP] identifier[makeScreen] operator[SEP] identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] , identifier[properties] operator[SEP] operator[SEP] Keyword[return] identifier[screen] operator[SEP] }
public void setResourceTypeList(java.util.Collection<String> resourceTypeList) { if (resourceTypeList == null) { this.resourceTypeList = null; return; } this.resourceTypeList = new java.util.ArrayList<String>(resourceTypeList); }
class class_name[name] begin[{] method[setResourceTypeList, return_type[void], modifier[public], parameter[resourceTypeList]] begin[{] if[binary_operation[member[.resourceTypeList], ==, literal[null]]] begin[{] assign[THIS[member[None.resourceTypeList]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.resourceTypeList]], ClassCreator(arguments=[MemberReference(member=resourceTypeList, 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=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setResourceTypeList] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[resourceTypeList] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceTypeList] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[resourceTypeList] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[resourceTypeList] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[resourceTypeList] operator[SEP] operator[SEP] }
public static HsqlException error(String message, String sqlState, int i) { return new HsqlException(message, sqlState, i); }
class class_name[name] begin[{] method[error, return_type[type[HsqlException]], modifier[public static], parameter[message, sqlState, i]] begin[{] return[ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sqlState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, 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=HsqlException, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[HsqlException] identifier[error] operator[SEP] identifier[String] identifier[message] , identifier[String] identifier[sqlState] , Keyword[int] identifier[i] operator[SEP] { Keyword[return] Keyword[new] identifier[HsqlException] operator[SEP] identifier[message] , identifier[sqlState] , identifier[i] operator[SEP] operator[SEP] }
protected static String getAbsoluteUrl(String resource) { if (resource.startsWith("/" + WonderPush.API_VERSION)) { resource = resource.substring(1 + WonderPush.API_VERSION.length()); } return WonderPush.getBaseURL() + resource; }
class class_name[name] begin[{] method[getAbsoluteUrl, return_type[type[String]], modifier[static protected], parameter[resource]] begin[{] if[call[resource.startsWith, parameter[binary_operation[literal["/"], +, member[WonderPush.API_VERSION]]]]] begin[{] assign[member[.resource], call[resource.substring, parameter[binary_operation[literal[1], +, call[WonderPush.API_VERSION.length, parameter[]]]]]] else begin[{] None end[}] return[binary_operation[call[WonderPush.getBaseURL, parameter[]], +, member[.resource]]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[String] identifier[getAbsoluteUrl] operator[SEP] identifier[String] identifier[resource] operator[SEP] { Keyword[if] operator[SEP] identifier[resource] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[+] identifier[WonderPush] operator[SEP] identifier[API_VERSION] operator[SEP] operator[SEP] { identifier[resource] operator[=] identifier[resource] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[+] identifier[WonderPush] operator[SEP] identifier[API_VERSION] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[WonderPush] operator[SEP] identifier[getBaseURL] operator[SEP] operator[SEP] operator[+] identifier[resource] operator[SEP] }
public void setSceneModel (MisoSceneModel model) { _model = model; // clear out old blocks and objects clearScene(); centerOnTile(0, 0); if (isShowing()) { rethink(); _remgr.invalidateRegion(_vbounds); } }
class class_name[name] begin[{] method[setSceneModel, return_type[void], modifier[public], parameter[model]] begin[{] assign[member[._model], member[.model]] call[.clearScene, parameter[]] call[.centerOnTile, parameter[literal[0], literal[0]]] if[call[.isShowing, parameter[]]] begin[{] call[.rethink, parameter[]] call[_remgr.invalidateRegion, parameter[member[._vbounds]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSceneModel] operator[SEP] identifier[MisoSceneModel] identifier[model] operator[SEP] { identifier[_model] operator[=] identifier[model] operator[SEP] identifier[clearScene] operator[SEP] operator[SEP] operator[SEP] identifier[centerOnTile] operator[SEP] Other[0] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isShowing] operator[SEP] operator[SEP] operator[SEP] { identifier[rethink] operator[SEP] operator[SEP] operator[SEP] identifier[_remgr] operator[SEP] identifier[invalidateRegion] operator[SEP] identifier[_vbounds] operator[SEP] operator[SEP] } }
public final List<String> listFormats() { final List<String> formats = new ArrayList<>(); formats.add(SVG_FMT); formats.add(SVG_FMT.toUpperCase(Locale.ROOT)); formats.add(PS_FMT); formats.add(PS_FMT.toUpperCase(Locale.ROOT)); formats.add(EPS_FMT); formats.add(EPS_FMT.toUpperCase(Locale.ROOT)); formats.add(PDF_FMT); formats.add(PDF_FMT.toUpperCase(Locale.ROOT)); formats.addAll(Arrays.asList(ImageIO.getWriterFormatNames())); return formats; }
class class_name[name] begin[{] method[listFormats, return_type[type[List]], modifier[final public], parameter[]] begin[{] local_variable[type[List], formats] call[formats.add, parameter[member[.SVG_FMT]]] call[formats.add, parameter[call[SVG_FMT.toUpperCase, parameter[member[Locale.ROOT]]]]] call[formats.add, parameter[member[.PS_FMT]]] call[formats.add, parameter[call[PS_FMT.toUpperCase, parameter[member[Locale.ROOT]]]]] call[formats.add, parameter[member[.EPS_FMT]]] call[formats.add, parameter[call[EPS_FMT.toUpperCase, parameter[member[Locale.ROOT]]]]] call[formats.add, parameter[member[.PDF_FMT]]] call[formats.add, parameter[call[PDF_FMT.toUpperCase, parameter[member[Locale.ROOT]]]]] call[formats.addAll, parameter[call[Arrays.asList, parameter[call[ImageIO.getWriterFormatNames, parameter[]]]]]] return[member[.formats]] end[}] END[}]
Keyword[public] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[listFormats] operator[SEP] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[formats] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[SVG_FMT] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[SVG_FMT] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ROOT] operator[SEP] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[PS_FMT] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[PS_FMT] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ROOT] operator[SEP] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[EPS_FMT] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[EPS_FMT] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ROOT] operator[SEP] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[PDF_FMT] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[add] operator[SEP] identifier[PDF_FMT] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ROOT] operator[SEP] operator[SEP] operator[SEP] identifier[formats] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[ImageIO] operator[SEP] identifier[getWriterFormatNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[formats] operator[SEP] }
@Override synchronized public void process(WatchedEvent event) { ReplyHeader h = new ReplyHeader(-1, -1L, 0); if (LOG.isTraceEnabled()) { ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK, "Deliver event " + event + " to 0x" + Long.toHexString(this.sessionId) + " through " + this); } // Convert WatchedEvent to a type that can be sent over the wire WatcherEvent e = event.getWrapper(); sendResponse(h, e, "notification"); }
class class_name[name] begin[{] method[process, return_type[void], modifier[synchronized public], parameter[event]] begin[{] local_variable[type[ReplyHeader], h] if[call[LOG.isTraceEnabled, parameter[]]] begin[{] call[ZooTrace.logTraceMessage, parameter[member[.LOG], member[ZooTrace.EVENT_DELIVERY_TRACE_MASK], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Deliver event "], +, member[.event]], +, literal[" to 0x"]], +, call[Long.toHexString, parameter[THIS[member[None.sessionId]]]]], +, literal[" through "]], +, THIS[]]]] else begin[{] None end[}] local_variable[type[WatcherEvent], e] call[.sendResponse, parameter[member[.h], member[.e], literal["notification"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[synchronized] Keyword[public] Keyword[void] identifier[process] operator[SEP] identifier[WatchedEvent] identifier[event] operator[SEP] { identifier[ReplyHeader] identifier[h] operator[=] Keyword[new] identifier[ReplyHeader] operator[SEP] operator[-] Other[1] , operator[-] Other[1L] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[ZooTrace] operator[SEP] identifier[logTraceMessage] operator[SEP] identifier[LOG] , identifier[ZooTrace] operator[SEP] identifier[EVENT_DELIVERY_TRACE_MASK] , literal[String] operator[+] identifier[event] operator[+] literal[String] operator[+] identifier[Long] operator[SEP] identifier[toHexString] operator[SEP] Keyword[this] operator[SEP] identifier[sessionId] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] operator[SEP] } identifier[WatcherEvent] identifier[e] operator[=] identifier[event] operator[SEP] identifier[getWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[sendResponse] operator[SEP] identifier[h] , identifier[e] , literal[String] operator[SEP] operator[SEP] }
private int checkClass(final ClassReader reader, Pattern suppressAnnotationsPattern) throws ForbiddenApiException { final String className = Type.getObjectType(reader.getClassName()).getClassName(); final ClassScanner scanner = new ClassScanner(this, forbiddenSignatures, suppressAnnotationsPattern); try { reader.accept(scanner, ClassReader.SKIP_FRAMES); } catch (RelatedClassLoadingException rcle) { final Exception cause = rcle.getException(); final StringBuilder msg = new StringBuilder() .append("Check for forbidden API calls failed while scanning class '") .append(className) .append('\''); final String source = scanner.getSourceFile(); if (source != null) { msg.append(" (").append(source).append(')'); } msg.append(": ").append(cause); msg.append(" (while looking up details about referenced class '").append(rcle.getClassName()).append("')"); assert cause != null && (cause instanceof IOException || cause instanceof ClassNotFoundException); throw new ForbiddenApiException(msg.toString(), cause); } final List<ForbiddenViolation> violations = scanner.getSortedViolations(); final Pattern splitter = Pattern.compile(Pattern.quote(ForbiddenViolation.SEPARATOR)); for (final ForbiddenViolation v : violations) { for (final String line : splitter.split(v.format(className, scanner.getSourceFile()))) { logger.error(line); } } return violations.size(); }
class class_name[name] begin[{] method[checkClass, return_type[type[int]], modifier[private], parameter[reader, suppressAnnotationsPattern]] begin[{] local_variable[type[String], className] local_variable[type[ClassScanner], scanner] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=scanner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SKIP_FRAMES, postfix_operators=[], prefix_operators=[], qualifier=ClassReader, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getException, postfix_operators=[], prefix_operators=[], qualifier=rcle, selectors=[], type_arguments=None), name=cause)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Exception, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Check for forbidden API calls failed while scanning class '")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=msg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSourceFile, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None), name=source)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=source, 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=" (")], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[MethodInvocation(arguments=[MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (while looking up details about referenced class '")], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=rcle, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="')")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ClassNotFoundException, sub_type=None), operator=instanceof), operator=||), operator=&&), label=None, value=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), MemberReference(member=cause, 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=ForbiddenApiException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=rcle, types=['RelatedClassLoadingException']))], finally_block=None, label=None, resources=None) local_variable[type[List], violations] local_variable[type[Pattern], splitter] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSourceFile, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)], member=split, postfix_operators=[], prefix_operators=[], qualifier=splitter, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=line)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=violations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ForbiddenViolation, sub_type=None))), label=None) return[call[violations.size, parameter[]]] end[}] END[}]
Keyword[private] Keyword[int] identifier[checkClass] operator[SEP] Keyword[final] identifier[ClassReader] identifier[reader] , identifier[Pattern] identifier[suppressAnnotationsPattern] operator[SEP] Keyword[throws] identifier[ForbiddenApiException] { Keyword[final] identifier[String] identifier[className] operator[=] identifier[Type] operator[SEP] identifier[getObjectType] operator[SEP] identifier[reader] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ClassScanner] identifier[scanner] operator[=] Keyword[new] identifier[ClassScanner] operator[SEP] Keyword[this] , identifier[forbiddenSignatures] , identifier[suppressAnnotationsPattern] operator[SEP] operator[SEP] Keyword[try] { identifier[reader] operator[SEP] identifier[accept] operator[SEP] identifier[scanner] , identifier[ClassReader] operator[SEP] identifier[SKIP_FRAMES] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RelatedClassLoadingException] identifier[rcle] operator[SEP] { Keyword[final] identifier[Exception] identifier[cause] operator[=] identifier[rcle] operator[SEP] identifier[getException] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[msg] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[className] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[source] operator[=] identifier[scanner] operator[SEP] identifier[getSourceFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[source] operator[!=] Other[null] operator[SEP] { identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[cause] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[rcle] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[assert] identifier[cause] operator[!=] Other[null] operator[&&] operator[SEP] identifier[cause] Keyword[instanceof] identifier[IOException] operator[||] identifier[cause] Keyword[instanceof] identifier[ClassNotFoundException] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ForbiddenApiException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[cause] operator[SEP] operator[SEP] } Keyword[final] identifier[List] operator[<] identifier[ForbiddenViolation] operator[>] identifier[violations] operator[=] identifier[scanner] operator[SEP] identifier[getSortedViolations] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Pattern] identifier[splitter] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[ForbiddenViolation] operator[SEP] identifier[SEPARATOR] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ForbiddenViolation] identifier[v] operator[:] identifier[violations] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[line] operator[:] identifier[splitter] operator[SEP] identifier[split] operator[SEP] identifier[v] operator[SEP] identifier[format] operator[SEP] identifier[className] , identifier[scanner] operator[SEP] identifier[getSourceFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[line] operator[SEP] operator[SEP] } } Keyword[return] identifier[violations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] }
public static List<CommerceVirtualOrderItem> toModels( CommerceVirtualOrderItemSoap[] soapModels) { if (soapModels == null) { return null; } List<CommerceVirtualOrderItem> models = new ArrayList<CommerceVirtualOrderItem>(soapModels.length); for (CommerceVirtualOrderItemSoap soapModel : soapModels) { models.add(toModel(soapModel)); } return models; }
class class_name[name] begin[{] method[toModels, return_type[type[List]], modifier[public static], parameter[soapModels]] begin[{] if[binary_operation[member[.soapModels], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], models] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=soapModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=models, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=soapModels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=soapModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceVirtualOrderItemSoap, sub_type=None))), label=None) return[member[.models]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[CommerceVirtualOrderItem] operator[>] identifier[toModels] operator[SEP] identifier[CommerceVirtualOrderItemSoap] operator[SEP] operator[SEP] identifier[soapModels] operator[SEP] { Keyword[if] operator[SEP] identifier[soapModels] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[CommerceVirtualOrderItem] operator[>] identifier[models] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CommerceVirtualOrderItem] operator[>] operator[SEP] identifier[soapModels] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CommerceVirtualOrderItemSoap] identifier[soapModel] operator[:] identifier[soapModels] operator[SEP] { identifier[models] operator[SEP] identifier[add] operator[SEP] identifier[toModel] operator[SEP] identifier[soapModel] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[models] operator[SEP] }
public CellFinder startPosition(final Cell cell) { ArgUtils.notNull(cell, "cell"); return startPosition(cell.getColumnIndex(), cell.getRowIndex()); }
class class_name[name] begin[{] method[startPosition, return_type[type[CellFinder]], modifier[public], parameter[cell]] begin[{] call[ArgUtils.notNull, parameter[member[.cell], literal["cell"]]] return[call[.startPosition, parameter[call[cell.getColumnIndex, parameter[]], call[cell.getRowIndex, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[CellFinder] identifier[startPosition] operator[SEP] Keyword[final] identifier[Cell] identifier[cell] operator[SEP] { identifier[ArgUtils] operator[SEP] identifier[notNull] operator[SEP] identifier[cell] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[startPosition] operator[SEP] identifier[cell] operator[SEP] identifier[getColumnIndex] operator[SEP] operator[SEP] , identifier[cell] operator[SEP] identifier[getRowIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void copyDocumentFields(PdfReader reader) throws DocumentException { if (!reader.isOpenedWithFullPermissions()) throw new IllegalArgumentException("PdfReader not opened with owner password"); if (readers2intrefs.containsKey(reader)) { reader = new PdfReader(reader); } else { if (reader.isTampered()) throw new DocumentException("The document was reused."); reader.consolidateNamedDestinations(); reader.setTampered(true); } reader.shuffleSubsetNames(); readers2intrefs.put(reader, new IntHashtable()); fields.add(reader.getAcroFields()); updateCalculationOrder(reader); }
class class_name[name] begin[{] method[copyDocumentFields, return_type[void], modifier[public], parameter[reader]] begin[{] if[call[reader.isOpenedWithFullPermissions, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PdfReader not opened with owner password")], 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[call[readers2intrefs.containsKey, parameter[member[.reader]]]] begin[{] assign[member[.reader], ClassCreator(arguments=[MemberReference(member=reader, 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=PdfReader, sub_type=None))] else begin[{] if[call[reader.isTampered, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The document was reused.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DocumentException, sub_type=None)), label=None) else begin[{] None end[}] call[reader.consolidateNamedDestinations, parameter[]] call[reader.setTampered, parameter[literal[true]]] end[}] call[reader.shuffleSubsetNames, parameter[]] call[readers2intrefs.put, parameter[member[.reader], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntHashtable, sub_type=None))]] call[fields.add, parameter[call[reader.getAcroFields, parameter[]]]] call[.updateCalculationOrder, parameter[member[.reader]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[copyDocumentFields] operator[SEP] identifier[PdfReader] identifier[reader] operator[SEP] Keyword[throws] identifier[DocumentException] { Keyword[if] operator[SEP] operator[!] identifier[reader] operator[SEP] identifier[isOpenedWithFullPermissions] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readers2intrefs] operator[SEP] identifier[containsKey] operator[SEP] identifier[reader] operator[SEP] operator[SEP] { identifier[reader] operator[=] Keyword[new] identifier[PdfReader] operator[SEP] identifier[reader] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[reader] operator[SEP] identifier[isTampered] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DocumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[reader] operator[SEP] identifier[consolidateNamedDestinations] operator[SEP] operator[SEP] operator[SEP] identifier[reader] operator[SEP] identifier[setTampered] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } identifier[reader] operator[SEP] identifier[shuffleSubsetNames] operator[SEP] operator[SEP] operator[SEP] identifier[readers2intrefs] operator[SEP] identifier[put] operator[SEP] identifier[reader] , Keyword[new] identifier[IntHashtable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] identifier[reader] operator[SEP] identifier[getAcroFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[updateCalculationOrder] operator[SEP] identifier[reader] operator[SEP] operator[SEP] }
public FessMessages addErrorsFailedToUploadMappingFile(String property) { assertPropertyNotNull(property); add(property, new UserMessage(ERRORS_failed_to_upload_mapping_file)); return this; }
class class_name[name] begin[{] method[addErrorsFailedToUploadMappingFile, return_type[type[FessMessages]], modifier[public], parameter[property]] begin[{] call[.assertPropertyNotNull, parameter[member[.property]]] call[.add, parameter[member[.property], ClassCreator(arguments=[MemberReference(member=ERRORS_failed_to_upload_mapping_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=UserMessage, sub_type=None))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FessMessages] identifier[addErrorsFailedToUploadMappingFile] operator[SEP] identifier[String] identifier[property] operator[SEP] { identifier[assertPropertyNotNull] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[property] , Keyword[new] identifier[UserMessage] operator[SEP] identifier[ERRORS_failed_to_upload_mapping_file] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public CommerceWishList fetchByPrimaryKey(Serializable primaryKey) { Serializable serializable = entityCache.getResult(CommerceWishListModelImpl.ENTITY_CACHE_ENABLED, CommerceWishListImpl.class, primaryKey); if (serializable == nullModel) { return null; } CommerceWishList commerceWishList = (CommerceWishList)serializable; if (commerceWishList == null) { Session session = null; try { session = openSession(); commerceWishList = (CommerceWishList)session.get(CommerceWishListImpl.class, primaryKey); if (commerceWishList != null) { cacheResult(commerceWishList); } else { entityCache.putResult(CommerceWishListModelImpl.ENTITY_CACHE_ENABLED, CommerceWishListImpl.class, primaryKey, nullModel); } } catch (Exception e) { entityCache.removeResult(CommerceWishListModelImpl.ENTITY_CACHE_ENABLED, CommerceWishListImpl.class, primaryKey); throw processException(e); } finally { closeSession(session); } } return commerceWishList; }
class class_name[name] begin[{] method[fetchByPrimaryKey, return_type[type[CommerceWishList]], modifier[public], parameter[primaryKey]] begin[{] local_variable[type[Serializable], serializable] if[binary_operation[member[.serializable], ==, member[.nullModel]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[CommerceWishList], commerceWishList] if[binary_operation[member[.commerceWishList], ==, literal[null]]] begin[{] local_variable[type[Session], session] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=commerceWishList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceWishListImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommerceWishList, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=commerceWishList, 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=ENTITY_CACHE_ENABLED, postfix_operators=[], prefix_operators=[], qualifier=CommerceWishListModelImpl, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceWishListImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nullModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putResult, postfix_operators=[], prefix_operators=[], qualifier=entityCache, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commerceWishList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cacheResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENTITY_CACHE_ENABLED, postfix_operators=[], prefix_operators=[], qualifier=CommerceWishListModelImpl, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceWishListImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeResult, postfix_operators=[], prefix_operators=[], qualifier=entityCache, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] return[member[.commerceWishList]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceWishList] identifier[fetchByPrimaryKey] operator[SEP] identifier[Serializable] identifier[primaryKey] operator[SEP] { identifier[Serializable] identifier[serializable] operator[=] identifier[entityCache] operator[SEP] identifier[getResult] operator[SEP] identifier[CommerceWishListModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceWishListImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serializable] operator[==] identifier[nullModel] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[CommerceWishList] identifier[commerceWishList] operator[=] operator[SEP] identifier[CommerceWishList] operator[SEP] identifier[serializable] operator[SEP] Keyword[if] operator[SEP] identifier[commerceWishList] operator[==] Other[null] operator[SEP] { identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[commerceWishList] operator[=] operator[SEP] identifier[CommerceWishList] operator[SEP] identifier[session] operator[SEP] identifier[get] operator[SEP] identifier[CommerceWishListImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceWishList] operator[!=] Other[null] operator[SEP] { identifier[cacheResult] operator[SEP] identifier[commerceWishList] operator[SEP] operator[SEP] } Keyword[else] { identifier[entityCache] operator[SEP] identifier[putResult] operator[SEP] identifier[CommerceWishListModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceWishListImpl] operator[SEP] Keyword[class] , identifier[primaryKey] , identifier[nullModel] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[entityCache] operator[SEP] identifier[removeResult] operator[SEP] identifier[CommerceWishListModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceWishListImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } } Keyword[return] identifier[commerceWishList] operator[SEP] }
public void setDateFormatString(String dfString) { for (int i = 0; i < 4; i++) { ((JDateChooser) components[i]).setDateFormatString(dfString); } }
class class_name[name] begin[{] method[setDateFormatString, return_type[void], modifier[public], parameter[dfString]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=components, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=JDateChooser, sub_type=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), 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) end[}] END[}]
Keyword[public] Keyword[void] identifier[setDateFormatString] operator[SEP] identifier[String] identifier[dfString] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Other[4] operator[SEP] identifier[i] operator[++] operator[SEP] { operator[SEP] operator[SEP] identifier[JDateChooser] operator[SEP] identifier[components] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[setDateFormatString] operator[SEP] identifier[dfString] operator[SEP] operator[SEP] } }
public void suspend() { if (this.runningState != State.RUNNING) { throw new IllegalStateException("Stopwatch must be running to suspend. "); } this.stopTime = System.nanoTime(); this.runningState = State.SUSPENDED; }
class class_name[name] begin[{] method[suspend, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[THIS[member[None.runningState]], !=, member[State.RUNNING]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stopwatch must be running to suspend. ")], 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) else begin[{] None end[}] assign[THIS[member[None.stopTime]], call[System.nanoTime, parameter[]]] assign[THIS[member[None.runningState]], member[State.SUSPENDED]] end[}] END[}]
Keyword[public] Keyword[void] identifier[suspend] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[runningState] operator[!=] identifier[State] operator[SEP] identifier[RUNNING] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[stopTime] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[runningState] operator[=] identifier[State] operator[SEP] identifier[SUSPENDED] operator[SEP] }
public void getAllEventDetailedInfo(Callback<EventDetail> callback) throws NullPointerException { gw2API.getAllEventDetailedInfo(GuildWars2.lang.getValue()).enqueue(callback); }
class class_name[name] begin[{] method[getAllEventDetailedInfo, return_type[void], modifier[public], parameter[callback]] begin[{] call[gw2API.getAllEventDetailedInfo, parameter[call[GuildWars2.lang.getValue, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[getAllEventDetailedInfo] operator[SEP] identifier[Callback] operator[<] identifier[EventDetail] operator[>] identifier[callback] operator[SEP] Keyword[throws] identifier[NullPointerException] { identifier[gw2API] operator[SEP] identifier[getAllEventDetailedInfo] operator[SEP] identifier[GuildWars2] operator[SEP] identifier[lang] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enqueue] operator[SEP] identifier[callback] operator[SEP] operator[SEP] }
public static Response createLinksHandler(ParaObject pobj, String id2) { try (final Metrics.Context context = Metrics.time(null, RestUtils.class, "links", "create")) { if (id2 != null && pobj != null) { String linkid = pobj.link(id2); if (linkid == null) { return getStatusResponse(Response.Status.BAD_REQUEST, "Failed to create link."); } else { return Response.ok(linkid, MediaType.TEXT_PLAIN_TYPE).build(); } } else { return getStatusResponse(Response.Status.BAD_REQUEST, "Parameters 'type' and 'id' are missing."); } } }
class class_name[name] begin[{] method[createLinksHandler, return_type[type[Response]], modifier[public static], parameter[pobj, id2]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=id2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=pobj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=BAD_REQUEST, postfix_operators=[], prefix_operators=[], qualifier=Response.Status, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameters 'type' and 'id' are missing.")], member=getStatusResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=link, postfix_operators=[], prefix_operators=[], qualifier=pobj, selectors=[], type_arguments=None), name=linkid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=linkid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=linkid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TEXT_PLAIN_TYPE, postfix_operators=[], prefix_operators=[], qualifier=MediaType, selectors=[])], member=ok, postfix_operators=[], prefix_operators=[], qualifier=Response, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=BAD_REQUEST, postfix_operators=[], prefix_operators=[], qualifier=Response.Status, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to create link.")], member=getStatusResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=context, type=ReferenceType(arguments=None, dimensions=[], name=Metrics, sub_type=ReferenceType(arguments=None, dimensions=None, name=Context, sub_type=None)), value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RestUtils, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="links"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="create")], member=time, postfix_operators=[], prefix_operators=[], qualifier=Metrics, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[public] Keyword[static] identifier[Response] identifier[createLinksHandler] operator[SEP] identifier[ParaObject] identifier[pobj] , identifier[String] identifier[id2] operator[SEP] { Keyword[try] operator[SEP] Keyword[final] identifier[Metrics] operator[SEP] identifier[Context] identifier[context] operator[=] identifier[Metrics] operator[SEP] identifier[time] operator[SEP] Other[null] , identifier[RestUtils] operator[SEP] Keyword[class] , literal[String] , literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[id2] operator[!=] Other[null] operator[&&] identifier[pobj] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[linkid] operator[=] identifier[pobj] operator[SEP] identifier[link] operator[SEP] identifier[id2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[linkid] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[getStatusResponse] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[BAD_REQUEST] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[Response] operator[SEP] identifier[ok] operator[SEP] identifier[linkid] , identifier[MediaType] operator[SEP] identifier[TEXT_PLAIN_TYPE] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] identifier[getStatusResponse] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[BAD_REQUEST] , literal[String] operator[SEP] operator[SEP] } } }
public static XMLStreamException unexpectedElement(final XMLExtendedStreamReader reader) { final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.unexpectedElement(reader.getName(), reader.getLocation()); return new XMLStreamValidationException(ex.getMessage(), ValidationError.from(ex, ErrorType.UNEXPECTED_ELEMENT) .element(reader.getName()), ex); }
class class_name[name] begin[{] method[unexpectedElement, return_type[type[XMLStreamException]], modifier[public static], parameter[reader]] begin[{] local_variable[type[XMLStreamException], ex] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNEXPECTED_ELEMENT, postfix_operators=[], prefix_operators=[], qualifier=ErrorType, selectors=[])], member=from, postfix_operators=[], prefix_operators=[], qualifier=ValidationError, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], member=element, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=ex, 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=XMLStreamValidationException, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[XMLStreamException] identifier[unexpectedElement] operator[SEP] Keyword[final] identifier[XMLExtendedStreamReader] identifier[reader] operator[SEP] { Keyword[final] identifier[XMLStreamException] identifier[ex] operator[=] identifier[ControllerLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[reader] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[XMLStreamValidationException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ValidationError] operator[SEP] identifier[from] operator[SEP] identifier[ex] , identifier[ErrorType] operator[SEP] identifier[UNEXPECTED_ELEMENT] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[reader] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] }
private ExtensionUserManagement getExtensionUserManagement() { if (extensionUsers == null) { extensionUsers = Control.getSingleton().getExtensionLoader().getExtension(ExtensionUserManagement.class); } return extensionUsers; }
class class_name[name] begin[{] method[getExtensionUserManagement, return_type[type[ExtensionUserManagement]], modifier[private], parameter[]] begin[{] if[binary_operation[member[.extensionUsers], ==, literal[null]]] begin[{] assign[member[.extensionUsers], call[Control.getSingleton, parameter[]]] else begin[{] None end[}] return[member[.extensionUsers]] end[}] END[}]
Keyword[private] identifier[ExtensionUserManagement] identifier[getExtensionUserManagement] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[extensionUsers] operator[==] Other[null] operator[SEP] { identifier[extensionUsers] operator[=] identifier[Control] operator[SEP] identifier[getSingleton] operator[SEP] operator[SEP] operator[SEP] identifier[getExtensionLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getExtension] operator[SEP] identifier[ExtensionUserManagement] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[return] identifier[extensionUsers] operator[SEP] }
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException { log.fine("void service(HttpServletRequest, HttpServletResponse): called"); // Read the parameters and attributes from the request String contentType = (String) request.getAttribute("contentType"); String contentDisposition = (String) request.getAttribute("contentDisposition"); InputStream inputStream = (InputStream) request.getAttribute("inputStream"); // Build the response header // response.addHeader("Content-disposition", "attachment; filename=" + fileName); if (contentType != null) { response.setContentType(contentType); } if (contentDisposition != null) { response.addHeader("Content-disposition", contentDisposition); } // response.setContentLength((int)f.length()); // Create a stream to write the data out to BufferedOutputStream outputStream = new BufferedOutputStream(response.getOutputStream()); // Read the entire input stream until no more bytes can be read and write the results into the response // This is done in chunks of 8k at a time. int length = -1; byte[] chunk = new byte[8192]; while ((length = inputStream.read(chunk)) != -1) { outputStream.write(chunk, 0, length); } // Clear up any open stream and ensure that they are flushed outputStream.flush(); inputStream.close(); }
class class_name[name] begin[{] method[service, return_type[void], modifier[public], parameter[request, response]] begin[{] call[log.fine, parameter[literal["void service(HttpServletRequest, HttpServletResponse): called"]]] local_variable[type[String], contentType] local_variable[type[String], contentDisposition] local_variable[type[InputStream], inputStream] if[binary_operation[member[.contentType], !=, literal[null]]] begin[{] call[response.setContentType, parameter[member[.contentType]]] else begin[{] None end[}] if[binary_operation[member[.contentDisposition], !=, literal[null]]] begin[{] call[response.addHeader, parameter[literal["Content-disposition"], member[.contentDisposition]]] else begin[{] None end[}] local_variable[type[BufferedOutputStream], outputStream] local_variable[type[int], length] local_variable[type[byte], chunk] while[binary_operation[assign[member[.length], call[inputStream.read, parameter[member[.chunk]]]], !=, literal[1]]] begin[{] call[outputStream.write, parameter[member[.chunk], literal[0], member[.length]]] end[}] call[outputStream.flush, parameter[]] call[inputStream.close, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[service] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] operator[SEP] Keyword[throws] identifier[IOException] { identifier[log] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[contentType] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[request] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[contentDisposition] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[request] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[InputStream] identifier[inputStream] operator[=] operator[SEP] identifier[InputStream] operator[SEP] identifier[request] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contentType] operator[!=] Other[null] operator[SEP] { identifier[response] operator[SEP] identifier[setContentType] operator[SEP] identifier[contentType] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contentDisposition] operator[!=] Other[null] operator[SEP] { identifier[response] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , identifier[contentDisposition] operator[SEP] operator[SEP] } identifier[BufferedOutputStream] identifier[outputStream] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] identifier[response] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] operator[-] Other[1] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[chunk] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[8192] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[length] operator[=] identifier[inputStream] operator[SEP] identifier[read] operator[SEP] identifier[chunk] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[outputStream] operator[SEP] identifier[write] operator[SEP] identifier[chunk] , Other[0] , identifier[length] operator[SEP] operator[SEP] } identifier[outputStream] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[inputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] }
private void loadStream(InputStream stream) { int iPos = -1; String strLine = null; String strSection = null; String strRemarks = null; BufferedReader objBRdr = null; InputStreamReader objFRdr = null; INISection objSec = null; try { objFRdr = new InputStreamReader(stream); if (objFRdr != null) { objBRdr = new BufferedReader(objFRdr); if (objBRdr != null) { while (objBRdr.ready()) { iPos = -1; strLine = null; strLine = objBRdr.readLine().trim(); if (strLine == null) { } else if (strLine.length() == 0) { } else if (strLine.substring(0, 1).equals(";")) { if (strRemarks == null) strRemarks = strLine.substring(1); else if (strRemarks.length() == 0) strRemarks = strLine.substring(1); else strRemarks = strRemarks + "\r\n" + strLine.substring(1); } else if (strLine.startsWith("[") && strLine.endsWith("]")) { // Section start reached create new section if (objSec != null) this.mhmapSections.put(strSection.trim(), objSec); objSec = null; strSection = strLine.substring(1, strLine.length() - 1); objSec = new INISection(strSection.trim(), strRemarks); strRemarks = null; } else if ((iPos = strLine.indexOf("=")) > 0 && objSec != null) { // read the key value pair 012345=789 objSec.setProperty(strLine.substring(0, iPos).trim(), strLine.substring(iPos + 1).trim(), strRemarks); strRemarks = null; } else { objSec.setProperty(strLine, "", strRemarks); } } if (objSec != null) this.mhmapSections.put(strSection.trim(), objSec); this.mblnLoaded = true; } } } catch (FileNotFoundException FNFExIgnore) { this.mhmapSections.clear(); } catch (IOException IOExIgnore) { this.mhmapSections.clear(); } catch (NullPointerException NPExIgnore) { this.mhmapSections.clear(); } finally { if (objBRdr != null) { closeReader(objBRdr); objBRdr = null; } if (objFRdr != null) { closeReader(objFRdr); objFRdr = null; } if (objSec != null) objSec = null; } }
class class_name[name] begin[{] method[loadStream, return_type[void], modifier[private], parameter[stream]] begin[{] local_variable[type[int], iPos] local_variable[type[String], strLine] local_variable[type[String], strSection] local_variable[type[String], strRemarks] local_variable[type[BufferedReader], objBRdr] local_variable[type[InputStreamReader], objFRdr] local_variable[type[INISection], objSec] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=objFRdr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=stream, 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=InputStreamReader, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objFRdr, 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=Assignment(expressionl=MemberReference(member=objBRdr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=objFRdr, 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=BufferedReader, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objBRdr, 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=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=strLine, 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=strLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=objBRdr, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=strLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=iPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=objSec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=strLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=objSec, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=iPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=iPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=objSec, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objSec, 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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mhmapSections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=strSection, selectors=[], type_arguments=None), MemberReference(member=objSec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=objSec, 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=strSection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=objSec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=strSection, selectors=[], type_arguments=None), MemberReference(member=strRemarks, 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=INISection, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=strRemarks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\r\n"), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None), operator=+)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=strRemarks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=strLine, selectors=[], type_arguments=None)), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[])), label=None, then_statement=BlockStatement(label=None, statements=[]))]), condition=MethodInvocation(arguments=[], member=ready, postfix_operators=[], prefix_operators=[], qualifier=objBRdr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objSec, 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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mhmapSections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=strSection, selectors=[], type_arguments=None), MemberReference(member=objSec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mblnLoaded, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mhmapSections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=FNFExIgnore, types=['FileNotFoundException'])), CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mhmapSections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=IOExIgnore, types=['IOException'])), CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mhmapSections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=NPExIgnore, types=['NullPointerException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objBRdr, 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=[MemberReference(member=objBRdr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=objBRdr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objFRdr, 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=[MemberReference(member=objFRdr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=objFRdr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objSec, 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=objSec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None))], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[loadStream] operator[SEP] identifier[InputStream] identifier[stream] operator[SEP] { Keyword[int] identifier[iPos] operator[=] operator[-] Other[1] operator[SEP] identifier[String] identifier[strLine] operator[=] Other[null] operator[SEP] identifier[String] identifier[strSection] operator[=] Other[null] operator[SEP] identifier[String] identifier[strRemarks] operator[=] Other[null] operator[SEP] identifier[BufferedReader] identifier[objBRdr] operator[=] Other[null] operator[SEP] identifier[InputStreamReader] identifier[objFRdr] operator[=] Other[null] operator[SEP] identifier[INISection] identifier[objSec] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[objFRdr] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[stream] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[objFRdr] operator[!=] Other[null] operator[SEP] { identifier[objBRdr] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] identifier[objFRdr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[objBRdr] operator[!=] Other[null] operator[SEP] { Keyword[while] operator[SEP] identifier[objBRdr] operator[SEP] identifier[ready] operator[SEP] operator[SEP] operator[SEP] { identifier[iPos] operator[=] operator[-] Other[1] operator[SEP] identifier[strLine] operator[=] Other[null] operator[SEP] identifier[strLine] operator[=] identifier[objBRdr] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strLine] operator[==] Other[null] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[strLine] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[strLine] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[strRemarks] operator[==] Other[null] operator[SEP] identifier[strRemarks] operator[=] identifier[strLine] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[strRemarks] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] identifier[strRemarks] operator[=] identifier[strLine] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[else] identifier[strRemarks] operator[=] identifier[strRemarks] operator[+] literal[String] operator[+] identifier[strLine] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[strLine] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[strLine] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[objSec] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[mhmapSections] operator[SEP] identifier[put] operator[SEP] identifier[strSection] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[objSec] operator[SEP] operator[SEP] identifier[objSec] operator[=] Other[null] operator[SEP] identifier[strSection] operator[=] identifier[strLine] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[strLine] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[objSec] operator[=] Keyword[new] identifier[INISection] operator[SEP] identifier[strSection] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[strRemarks] operator[SEP] operator[SEP] identifier[strRemarks] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[iPos] operator[=] identifier[strLine] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[objSec] operator[!=] Other[null] operator[SEP] { identifier[objSec] operator[SEP] identifier[setProperty] operator[SEP] identifier[strLine] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[iPos] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[strLine] operator[SEP] identifier[substring] operator[SEP] identifier[iPos] operator[+] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[strRemarks] operator[SEP] operator[SEP] identifier[strRemarks] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[objSec] operator[SEP] identifier[setProperty] operator[SEP] identifier[strLine] , literal[String] , identifier[strRemarks] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[objSec] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[mhmapSections] operator[SEP] identifier[put] operator[SEP] identifier[strSection] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[objSec] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[mblnLoaded] operator[=] literal[boolean] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[FNFExIgnore] operator[SEP] { Keyword[this] operator[SEP] identifier[mhmapSections] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[IOExIgnore] operator[SEP] { Keyword[this] operator[SEP] identifier[mhmapSections] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NullPointerException] identifier[NPExIgnore] operator[SEP] { Keyword[this] operator[SEP] identifier[mhmapSections] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[objBRdr] operator[!=] Other[null] operator[SEP] { identifier[closeReader] operator[SEP] identifier[objBRdr] operator[SEP] operator[SEP] identifier[objBRdr] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[objFRdr] operator[!=] Other[null] operator[SEP] { identifier[closeReader] operator[SEP] identifier[objFRdr] operator[SEP] operator[SEP] identifier[objFRdr] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[objSec] operator[!=] Other[null] operator[SEP] identifier[objSec] operator[=] Other[null] operator[SEP] } }
public void apply() { Keyspace ks = Keyspace.open(keyspaceName); ks.apply(this, ks.metadata.durableWrites); }
class class_name[name] begin[{] method[apply, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Keyspace], ks] call[ks.apply, parameter[THIS[], member[ks.metadata.durableWrites]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[apply] operator[SEP] operator[SEP] { identifier[Keyspace] identifier[ks] operator[=] identifier[Keyspace] operator[SEP] identifier[open] operator[SEP] identifier[keyspaceName] operator[SEP] operator[SEP] identifier[ks] operator[SEP] identifier[apply] operator[SEP] Keyword[this] , identifier[ks] operator[SEP] identifier[metadata] operator[SEP] identifier[durableWrites] operator[SEP] operator[SEP] }
public List<String> getSubset(int numShards, Collection<String> primary) { /** * If netmask in unset, we'll use manual */ if (networkMask == null) return getIntersections(numShards, primary); List<String> addresses = new ArrayList<>(); SubnetUtils utils = new SubnetUtils(networkMask); Collections.shuffle(informationCollection); for (NetworkInformation information : informationCollection) { for (String ip : information.getIpAddresses()) { if (primary != null && primary.contains(ip)) continue; if (utils.getInfo().isInRange(ip)) { log.debug("Picked {} as {}", ip, primary == null ? "Shard" : "Backup"); addresses.add(ip); } if (addresses.size() >= numShards) break; } if (addresses.size() >= numShards) break; } return addresses; }
class class_name[name] begin[{] method[getSubset, return_type[type[List]], modifier[public], parameter[numShards, primary]] begin[{] if[binary_operation[member[.networkMask], ==, literal[null]]] begin[{] return[call[.getIntersections, parameter[member[.numShards], member[.primary]]]] else begin[{] None end[}] local_variable[type[List], addresses] local_variable[type[SubnetUtils], utils] call[Collections.shuffle, parameter[member[.informationCollection]]] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=primary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=primary, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getInfo, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[MethodInvocation(arguments=[MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInRange, 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=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Picked {} as {}"), MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=primary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Backup"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Shard"))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=addresses, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=addresses, selectors=[], type_arguments=None), operandr=MemberReference(member=numShards, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getIpAddresses, postfix_operators=[], prefix_operators=[], qualifier=information, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ip)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=addresses, selectors=[], type_arguments=None), operandr=MemberReference(member=numShards, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=EnhancedForControl(iterable=MemberReference(member=informationCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=information)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NetworkInformation, sub_type=None))), label=None) return[member[.addresses]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getSubset] operator[SEP] Keyword[int] identifier[numShards] , identifier[Collection] operator[<] identifier[String] operator[>] identifier[primary] operator[SEP] { Keyword[if] operator[SEP] identifier[networkMask] operator[==] Other[null] operator[SEP] Keyword[return] identifier[getIntersections] operator[SEP] identifier[numShards] , identifier[primary] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[addresses] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[SubnetUtils] identifier[utils] operator[=] Keyword[new] identifier[SubnetUtils] operator[SEP] identifier[networkMask] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[shuffle] operator[SEP] identifier[informationCollection] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[NetworkInformation] identifier[information] operator[:] identifier[informationCollection] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[ip] operator[:] identifier[information] operator[SEP] identifier[getIpAddresses] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[primary] operator[!=] Other[null] operator[&&] identifier[primary] operator[SEP] identifier[contains] operator[SEP] identifier[ip] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[utils] operator[SEP] identifier[getInfo] operator[SEP] operator[SEP] operator[SEP] identifier[isInRange] operator[SEP] identifier[ip] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[ip] , identifier[primary] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[addresses] operator[SEP] identifier[add] operator[SEP] identifier[ip] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[addresses] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>=] identifier[numShards] operator[SEP] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[addresses] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>=] identifier[numShards] operator[SEP] Keyword[break] operator[SEP] } Keyword[return] identifier[addresses] operator[SEP] }
public void marshall(CreateProtectionRequest createProtectionRequest, ProtocolMarshaller protocolMarshaller) { if (createProtectionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createProtectionRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createProtectionRequest.getResourceArn(), RESOURCEARN_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[createProtectionRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createProtectionRequest], ==, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=createProtectionRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_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=getResourceArn, postfix_operators=[], prefix_operators=[], qualifier=createProtectionRequest, selectors=[], type_arguments=None), MemberReference(member=RESOURCEARN_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[CreateProtectionRequest] identifier[createProtectionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createProtectionRequest] 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[createProtectionRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createProtectionRequest] operator[SEP] identifier[getResourceArn] operator[SEP] operator[SEP] , identifier[RESOURCEARN_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 public CommerceCurrency fetchByG_C(long groupId, String code) { return fetchByG_C(groupId, code, true); }
class class_name[name] begin[{] method[fetchByG_C, return_type[type[CommerceCurrency]], modifier[public], parameter[groupId, code]] begin[{] return[call[.fetchByG_C, parameter[member[.groupId], member[.code], literal[true]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceCurrency] identifier[fetchByG_C] operator[SEP] Keyword[long] identifier[groupId] , identifier[String] identifier[code] operator[SEP] { Keyword[return] identifier[fetchByG_C] operator[SEP] identifier[groupId] , identifier[code] , literal[boolean] operator[SEP] operator[SEP] }
@Override public BytesInput getBytes() { // The Page Header should include: blockSizeInValues, numberOfMiniBlocks, totalValueCount if (deltaValuesToFlush != 0) { flushBlockBuffer(); } return BytesInput.concat( config.toBytesInput(), BytesInput.fromUnsignedVarInt(totalValueCount), BytesInput.fromZigZagVarLong(firstValue), BytesInput.from(baos)); }
class class_name[name] begin[{] method[getBytes, return_type[type[BytesInput]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.deltaValuesToFlush], !=, literal[0]]] begin[{] call[.flushBlockBuffer, parameter[]] else begin[{] None end[}] return[call[BytesInput.concat, parameter[call[config.toBytesInput, parameter[]], call[BytesInput.fromUnsignedVarInt, parameter[member[.totalValueCount]]], call[BytesInput.fromZigZagVarLong, parameter[member[.firstValue]]], call[BytesInput.from, parameter[member[.baos]]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BytesInput] identifier[getBytes] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[deltaValuesToFlush] operator[!=] Other[0] operator[SEP] { identifier[flushBlockBuffer] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[BytesInput] operator[SEP] identifier[concat] operator[SEP] identifier[config] operator[SEP] identifier[toBytesInput] operator[SEP] operator[SEP] , identifier[BytesInput] operator[SEP] identifier[fromUnsignedVarInt] operator[SEP] identifier[totalValueCount] operator[SEP] , identifier[BytesInput] operator[SEP] identifier[fromZigZagVarLong] operator[SEP] identifier[firstValue] operator[SEP] , identifier[BytesInput] operator[SEP] identifier[from] operator[SEP] identifier[baos] operator[SEP] operator[SEP] operator[SEP] }
public static BatchFraction createDefaultFraction() { final BatchFraction fraction = new BatchFraction(); final InMemoryJobRepository<?> jobRepository = new InMemoryJobRepository<>(DEFAULT_JOB_REPOSITORY_NAME); fraction.inMemoryJobRepository(jobRepository) .defaultJobRepository(jobRepository.getKey()); // Default thread-pool final ThreadPool<?> threadPool = new ThreadPool<>(DEFAULT_THREAD_POOL_NAME); threadPool.maxThreads(ProcessorInfo.availableProcessors()) .keepaliveTime("time", "30") .keepaliveTime("unit", "seconds"); fraction.threadPool(threadPool) .defaultThreadPool(threadPool.getKey()); return fraction; }
class class_name[name] begin[{] method[createDefaultFraction, return_type[type[BatchFraction]], modifier[public static], parameter[]] begin[{] local_variable[type[BatchFraction], fraction] local_variable[type[InMemoryJobRepository], jobRepository] call[fraction.inMemoryJobRepository, parameter[member[.jobRepository]]] local_variable[type[ThreadPool], threadPool] call[threadPool.maxThreads, parameter[call[ProcessorInfo.availableProcessors, parameter[]]]] call[fraction.threadPool, parameter[member[.threadPool]]] return[member[.fraction]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BatchFraction] identifier[createDefaultFraction] operator[SEP] operator[SEP] { Keyword[final] identifier[BatchFraction] identifier[fraction] operator[=] Keyword[new] identifier[BatchFraction] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[InMemoryJobRepository] operator[<] operator[?] operator[>] identifier[jobRepository] operator[=] Keyword[new] identifier[InMemoryJobRepository] operator[<] operator[>] operator[SEP] identifier[DEFAULT_JOB_REPOSITORY_NAME] operator[SEP] operator[SEP] identifier[fraction] operator[SEP] identifier[inMemoryJobRepository] operator[SEP] identifier[jobRepository] operator[SEP] operator[SEP] identifier[defaultJobRepository] operator[SEP] identifier[jobRepository] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ThreadPool] operator[<] operator[?] operator[>] identifier[threadPool] operator[=] Keyword[new] identifier[ThreadPool] operator[<] operator[>] operator[SEP] identifier[DEFAULT_THREAD_POOL_NAME] operator[SEP] operator[SEP] identifier[threadPool] operator[SEP] identifier[maxThreads] operator[SEP] identifier[ProcessorInfo] operator[SEP] identifier[availableProcessors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[keepaliveTime] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[keepaliveTime] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[fraction] operator[SEP] identifier[threadPool] operator[SEP] identifier[threadPool] operator[SEP] operator[SEP] identifier[defaultThreadPool] operator[SEP] identifier[threadPool] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fraction] operator[SEP] }
public GeometryType getGeometryType(String name) { Variable geometryVar = ds.findVariable(name); if(geometryVar == null) return null; // CFConvention if(ds.findGlobalAttribute(CF.CONVENTIONS) != null) if(ucar.nc2.dataset.conv.CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) { Attribute geometryTypeAttr = null; String geometry_type = null; geometryTypeAttr = geometryVar.findAttribute(CF.GEOMETRY_TYPE); if(geometryTypeAttr == null) return null; geometry_type = geometryTypeAttr.getStringValue(); switch(geometry_type) { case CF.POLYGON: return GeometryType.POLYGON; case CF.LINE: return GeometryType.LINE; case CF.POINT: return GeometryType.POINT; default: return null; } } return null; }
class class_name[name] begin[{] method[getGeometryType, return_type[type[GeometryType]], modifier[public], parameter[name]] begin[{] local_variable[type[Variable], geometryVar] if[binary_operation[member[.geometryVar], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[call[ds.findGlobalAttribute, parameter[member[CF.CONVENTIONS]]], !=, literal[null]]] begin[{] if[binary_operation[call[ucar.nc2.dataset.conv.CF1Convention.getVersion, parameter[call[ds.findGlobalAttribute, parameter[member[CF.CONVENTIONS]]]]], >=, literal[8]]] begin[{] local_variable[type[Attribute], geometryTypeAttr] local_variable[type[String], geometry_type] assign[member[.geometryTypeAttr], call[geometryVar.findAttribute, parameter[member[CF.GEOMETRY_TYPE]]]] if[binary_operation[member[.geometryTypeAttr], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] assign[member[.geometry_type], call[geometryTypeAttr.getStringValue, parameter[]]] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=POLYGON, postfix_operators=[], prefix_operators=[], qualifier=CF, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=POLYGON, postfix_operators=[], prefix_operators=[], qualifier=GeometryType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=LINE, postfix_operators=[], prefix_operators=[], qualifier=CF, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=LINE, postfix_operators=[], prefix_operators=[], qualifier=GeometryType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=POINT, postfix_operators=[], prefix_operators=[], qualifier=CF, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=POINT, postfix_operators=[], prefix_operators=[], qualifier=GeometryType, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])], expression=MemberReference(member=geometry_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[GeometryType] identifier[getGeometryType] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[Variable] identifier[geometryVar] operator[=] identifier[ds] operator[SEP] identifier[findVariable] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[geometryVar] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ds] operator[SEP] identifier[findGlobalAttribute] operator[SEP] identifier[CF] operator[SEP] identifier[CONVENTIONS] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ucar] operator[SEP] identifier[nc2] operator[SEP] identifier[dataset] operator[SEP] identifier[conv] operator[SEP] identifier[CF1Convention] operator[SEP] identifier[getVersion] operator[SEP] identifier[ds] operator[SEP] identifier[findGlobalAttribute] operator[SEP] identifier[CF] operator[SEP] identifier[CONVENTIONS] operator[SEP] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[8] operator[SEP] { identifier[Attribute] identifier[geometryTypeAttr] operator[=] Other[null] operator[SEP] identifier[String] identifier[geometry_type] operator[=] Other[null] operator[SEP] identifier[geometryTypeAttr] operator[=] identifier[geometryVar] operator[SEP] identifier[findAttribute] operator[SEP] identifier[CF] operator[SEP] identifier[GEOMETRY_TYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[geometryTypeAttr] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[geometry_type] operator[=] identifier[geometryTypeAttr] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[geometry_type] operator[SEP] { Keyword[case] identifier[CF] operator[SEP] identifier[POLYGON] operator[:] Keyword[return] identifier[GeometryType] operator[SEP] identifier[POLYGON] operator[SEP] Keyword[case] identifier[CF] operator[SEP] identifier[LINE] operator[:] Keyword[return] identifier[GeometryType] operator[SEP] identifier[LINE] operator[SEP] Keyword[case] identifier[CF] operator[SEP] identifier[POINT] operator[:] Keyword[return] identifier[GeometryType] operator[SEP] identifier[POINT] operator[SEP] Keyword[default] operator[:] Keyword[return] Other[null] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }