code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public Matrix4d affineSpan(Vector3d corner, Vector3d xDir, Vector3d yDir, Vector3d zDir) { double a = m10 * m22, b = m10 * m21, c = m10 * m02, d = m10 * m01; double e = m11 * m22, f = m11 * m20, g = m11 * m02, h = m11 * m00; double i = m12 * m21, j = m12 * m20, k = m12 * m01, l = m12 * m00; double m = m20 * m02, n = m20 * m01, o = m21 * m02, p = m21 * m00; double q = m22 * m01, r = m22 * m00; double s = 1.0 / (m00 * m11 - m01 * m10) * m22 + (m02 * m10 - m00 * m12) * m21 + (m01 * m12 - m02 * m11) * m20; double nm00 = (e - i) * s, nm01 = (o - q) * s, nm02 = (k - g) * s; double nm10 = (j - a) * s, nm11 = (r - m) * s, nm12 = (c - l) * s; double nm20 = (b - f) * s, nm21 = (n - p) * s, nm22 = (h - d) * s; corner.x = -nm00 - nm10 - nm20 + (a * m31 - b * m32 + f * m32 - e * m30 + i * m30 - j * m31) * s; corner.y = -nm01 - nm11 - nm21 + (m * m31 - n * m32 + p * m32 - o * m30 + q * m30 - r * m31) * s; corner.z = -nm02 - nm12 - nm22 + (g * m30 - k * m30 + l * m31 - c * m31 + d * m32 - h * m32) * s; xDir.x = 2.0 * nm00; xDir.y = 2.0 * nm01; xDir.z = 2.0 * nm02; yDir.x = 2.0 * nm10; yDir.y = 2.0 * nm11; yDir.z = 2.0 * nm12; zDir.x = 2.0 * nm20; zDir.y = 2.0 * nm21; zDir.z = 2.0 * nm22; return this; }
class class_name[name] begin[{] method[affineSpan, return_type[type[Matrix4d]], modifier[public], parameter[corner, xDir, yDir, zDir]] begin[{] local_variable[type[double], a] local_variable[type[double], e] local_variable[type[double], i] local_variable[type[double], m] local_variable[type[double], q] local_variable[type[double], s] local_variable[type[double], nm00] local_variable[type[double], nm10] local_variable[type[double], nm20] assign[member[corner.x], binary_operation[binary_operation[binary_operation[member[.nm00], -, member[.nm10]], -, member[.nm20]], +, binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.a], *, member[.m31]], -, binary_operation[member[.b], *, member[.m32]]], +, binary_operation[member[.f], *, member[.m32]]], -, binary_operation[member[.e], *, member[.m30]]], +, binary_operation[member[.i], *, member[.m30]]], -, binary_operation[member[.j], *, member[.m31]]], *, member[.s]]]] assign[member[corner.y], binary_operation[binary_operation[binary_operation[member[.nm01], -, member[.nm11]], -, member[.nm21]], +, binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.m], *, member[.m31]], -, binary_operation[member[.n], *, member[.m32]]], +, binary_operation[member[.p], *, member[.m32]]], -, binary_operation[member[.o], *, member[.m30]]], +, binary_operation[member[.q], *, member[.m30]]], -, binary_operation[member[.r], *, member[.m31]]], *, member[.s]]]] assign[member[corner.z], binary_operation[binary_operation[binary_operation[member[.nm02], -, member[.nm12]], -, member[.nm22]], +, binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.g], *, member[.m30]], -, binary_operation[member[.k], *, member[.m30]]], +, binary_operation[member[.l], *, member[.m31]]], -, binary_operation[member[.c], *, member[.m31]]], +, binary_operation[member[.d], *, member[.m32]]], -, binary_operation[member[.h], *, member[.m32]]], *, member[.s]]]] assign[member[xDir.x], binary_operation[literal[2.0], *, member[.nm00]]] assign[member[xDir.y], binary_operation[literal[2.0], *, member[.nm01]]] assign[member[xDir.z], binary_operation[literal[2.0], *, member[.nm02]]] assign[member[yDir.x], binary_operation[literal[2.0], *, member[.nm10]]] assign[member[yDir.y], binary_operation[literal[2.0], *, member[.nm11]]] assign[member[yDir.z], binary_operation[literal[2.0], *, member[.nm12]]] assign[member[zDir.x], binary_operation[literal[2.0], *, member[.nm20]]] assign[member[zDir.y], binary_operation[literal[2.0], *, member[.nm21]]] assign[member[zDir.z], binary_operation[literal[2.0], *, member[.nm22]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Matrix4d] identifier[affineSpan] operator[SEP] identifier[Vector3d] identifier[corner] , identifier[Vector3d] identifier[xDir] , identifier[Vector3d] identifier[yDir] , identifier[Vector3d] identifier[zDir] operator[SEP] { Keyword[double] identifier[a] operator[=] identifier[m10] operator[*] identifier[m22] , identifier[b] operator[=] identifier[m10] operator[*] identifier[m21] , identifier[c] operator[=] identifier[m10] operator[*] identifier[m02] , identifier[d] operator[=] identifier[m10] operator[*] identifier[m01] operator[SEP] Keyword[double] identifier[e] operator[=] identifier[m11] operator[*] identifier[m22] , identifier[f] operator[=] identifier[m11] operator[*] identifier[m20] , identifier[g] operator[=] identifier[m11] operator[*] identifier[m02] , identifier[h] operator[=] identifier[m11] operator[*] identifier[m00] operator[SEP] Keyword[double] identifier[i] operator[=] identifier[m12] operator[*] identifier[m21] , identifier[j] operator[=] identifier[m12] operator[*] identifier[m20] , identifier[k] operator[=] identifier[m12] operator[*] identifier[m01] , identifier[l] operator[=] identifier[m12] operator[*] identifier[m00] operator[SEP] Keyword[double] identifier[m] operator[=] identifier[m20] operator[*] identifier[m02] , identifier[n] operator[=] identifier[m20] operator[*] identifier[m01] , identifier[o] operator[=] identifier[m21] operator[*] identifier[m02] , identifier[p] operator[=] identifier[m21] operator[*] identifier[m00] operator[SEP] Keyword[double] identifier[q] operator[=] identifier[m22] operator[*] identifier[m01] , identifier[r] operator[=] identifier[m22] operator[*] identifier[m00] operator[SEP] Keyword[double] identifier[s] operator[=] literal[Float] operator[/] operator[SEP] identifier[m00] operator[*] identifier[m11] operator[-] identifier[m01] operator[*] identifier[m10] operator[SEP] operator[*] identifier[m22] operator[+] operator[SEP] identifier[m02] operator[*] identifier[m10] operator[-] identifier[m00] operator[*] identifier[m12] operator[SEP] operator[*] identifier[m21] operator[+] operator[SEP] identifier[m01] operator[*] identifier[m12] operator[-] identifier[m02] operator[*] identifier[m11] operator[SEP] operator[*] identifier[m20] operator[SEP] Keyword[double] identifier[nm00] operator[=] operator[SEP] identifier[e] operator[-] identifier[i] operator[SEP] operator[*] identifier[s] , identifier[nm01] operator[=] operator[SEP] identifier[o] operator[-] identifier[q] operator[SEP] operator[*] identifier[s] , identifier[nm02] operator[=] operator[SEP] identifier[k] operator[-] identifier[g] operator[SEP] operator[*] identifier[s] operator[SEP] Keyword[double] identifier[nm10] operator[=] operator[SEP] identifier[j] operator[-] identifier[a] operator[SEP] operator[*] identifier[s] , identifier[nm11] operator[=] operator[SEP] identifier[r] operator[-] identifier[m] operator[SEP] operator[*] identifier[s] , identifier[nm12] operator[=] operator[SEP] identifier[c] operator[-] identifier[l] operator[SEP] operator[*] identifier[s] operator[SEP] Keyword[double] identifier[nm20] operator[=] operator[SEP] identifier[b] operator[-] identifier[f] operator[SEP] operator[*] identifier[s] , identifier[nm21] operator[=] operator[SEP] identifier[n] operator[-] identifier[p] operator[SEP] operator[*] identifier[s] , identifier[nm22] operator[=] operator[SEP] identifier[h] operator[-] identifier[d] operator[SEP] operator[*] identifier[s] operator[SEP] identifier[corner] operator[SEP] identifier[x] operator[=] operator[-] identifier[nm00] operator[-] identifier[nm10] operator[-] identifier[nm20] operator[+] operator[SEP] identifier[a] operator[*] identifier[m31] operator[-] identifier[b] operator[*] identifier[m32] operator[+] identifier[f] operator[*] identifier[m32] operator[-] identifier[e] operator[*] identifier[m30] operator[+] identifier[i] operator[*] identifier[m30] operator[-] identifier[j] operator[*] identifier[m31] operator[SEP] operator[*] identifier[s] operator[SEP] identifier[corner] operator[SEP] identifier[y] operator[=] operator[-] identifier[nm01] operator[-] identifier[nm11] operator[-] identifier[nm21] operator[+] operator[SEP] identifier[m] operator[*] identifier[m31] operator[-] identifier[n] operator[*] identifier[m32] operator[+] identifier[p] operator[*] identifier[m32] operator[-] identifier[o] operator[*] identifier[m30] operator[+] identifier[q] operator[*] identifier[m30] operator[-] identifier[r] operator[*] identifier[m31] operator[SEP] operator[*] identifier[s] operator[SEP] identifier[corner] operator[SEP] identifier[z] operator[=] operator[-] identifier[nm02] operator[-] identifier[nm12] operator[-] identifier[nm22] operator[+] operator[SEP] identifier[g] operator[*] identifier[m30] operator[-] identifier[k] operator[*] identifier[m30] operator[+] identifier[l] operator[*] identifier[m31] operator[-] identifier[c] operator[*] identifier[m31] operator[+] identifier[d] operator[*] identifier[m32] operator[-] identifier[h] operator[*] identifier[m32] operator[SEP] operator[*] identifier[s] operator[SEP] identifier[xDir] operator[SEP] identifier[x] operator[=] literal[Float] operator[*] identifier[nm00] operator[SEP] identifier[xDir] operator[SEP] identifier[y] operator[=] literal[Float] operator[*] identifier[nm01] operator[SEP] identifier[xDir] operator[SEP] identifier[z] operator[=] literal[Float] operator[*] identifier[nm02] operator[SEP] identifier[yDir] operator[SEP] identifier[x] operator[=] literal[Float] operator[*] identifier[nm10] operator[SEP] identifier[yDir] operator[SEP] identifier[y] operator[=] literal[Float] operator[*] identifier[nm11] operator[SEP] identifier[yDir] operator[SEP] identifier[z] operator[=] literal[Float] operator[*] identifier[nm12] operator[SEP] identifier[zDir] operator[SEP] identifier[x] operator[=] literal[Float] operator[*] identifier[nm20] operator[SEP] identifier[zDir] operator[SEP] identifier[y] operator[=] literal[Float] operator[*] identifier[nm21] operator[SEP] identifier[zDir] operator[SEP] identifier[z] operator[=] literal[Float] operator[*] identifier[nm22] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public String asString() { final Class<?> callerClass = ReflectionHelper.getDirectCallerClass(); return evaluateSingeValue(String.class, callerClass); }
class class_name[name] begin[{] method[asString, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[Class], callerClass] return[call[.evaluateSingeValue, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), member[.callerClass]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[asString] operator[SEP] operator[SEP] { Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[callerClass] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getDirectCallerClass] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[evaluateSingeValue] operator[SEP] identifier[String] operator[SEP] Keyword[class] , identifier[callerClass] operator[SEP] operator[SEP] }
public @Nullable Page getPage(@NotNull Predicate<Page> filter) { return getPage(filter, (Page)null); }
class class_name[name] begin[{] method[getPage, return_type[type[Page]], modifier[public], parameter[filter]] begin[{] return[call[.getPage, parameter[member[.filter], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Page, sub_type=None))]]] end[}] END[}]
Keyword[public] annotation[@] identifier[Nullable] identifier[Page] identifier[getPage] operator[SEP] annotation[@] identifier[NotNull] identifier[Predicate] operator[<] identifier[Page] operator[>] identifier[filter] operator[SEP] { Keyword[return] identifier[getPage] operator[SEP] identifier[filter] , operator[SEP] identifier[Page] operator[SEP] Other[null] operator[SEP] operator[SEP] }
public static void logMeasures(HLAMeasure[] measures, final Logger log) { log.info("\nAvailable measures are:"); log.info("======================"); for (HLAMeasure currMeasure : measures) { log.info(" - " + currMeasure.getSonarName()); } LogHelper.moo(log); }
class class_name[name] begin[{] method[logMeasures, return_type[void], modifier[public static], parameter[measures, log]] begin[{] call[log.info, parameter[literal["\nAvailable measures are:"]]] call[log.info, parameter[literal["======================"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operandr=MethodInvocation(arguments=[], member=getSonarName, postfix_operators=[], prefix_operators=[], qualifier=currMeasure, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=measures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=currMeasure)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HLAMeasure, sub_type=None))), label=None) call[LogHelper.moo, parameter[member[.log]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[logMeasures] operator[SEP] identifier[HLAMeasure] operator[SEP] operator[SEP] identifier[measures] , Keyword[final] identifier[Logger] identifier[log] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[HLAMeasure] identifier[currMeasure] operator[:] identifier[measures] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[currMeasure] operator[SEP] identifier[getSonarName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[LogHelper] operator[SEP] identifier[moo] operator[SEP] identifier[log] operator[SEP] operator[SEP] }
public static boolean async(InvocationContext context) { return !isDetached(context, Async.class) && (context.getRequest().isAnnotationPresent(Async.class) || (context.getEndpoint().isAnnotationPresent(Async.class))); }
class class_name[name] begin[{] method[async, return_type[type[boolean]], modifier[public static], parameter[context]] begin[{] return[binary_operation[call[.isDetached, parameter[member[.context], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Async, sub_type=None))]], &&, binary_operation[call[context.getRequest, parameter[]], ||, call[context.getEndpoint, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[async] operator[SEP] identifier[InvocationContext] identifier[context] operator[SEP] { Keyword[return] operator[!] identifier[isDetached] operator[SEP] identifier[context] , identifier[Async] operator[SEP] Keyword[class] operator[SEP] operator[&&] operator[SEP] identifier[context] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Async] operator[SEP] Keyword[class] operator[SEP] operator[||] operator[SEP] identifier[context] operator[SEP] identifier[getEndpoint] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Async] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static String printRules() { theRules.get(0).getSAXRules(); expandRules(); Vector<SAXRule> rules = new Vector<SAXRule>(numRules.intValue()); SAXRule currentRule; SAXRule referedTo; SAXSymbol sym; int index; int processedRules = 0; StringBuilder text = new StringBuilder(); text.append("Number\tName\tLevel\tOccurr.\tUsage\tYield\tRule str\tExpaneded\tIndexes\n"); rules.addElement(theRules.get(0)); // add-on - keeping the rule string, will be used in order to expand rules StringBuilder currentRuleString = new StringBuilder(); while (processedRules < rules.size()) { currentRule = rules.elementAt(processedRules); // seninp: adding to original output rule occurrence indexes // text.append(SPACE); text.append(arrRuleRecords.get(processedRules).getRuleNumber()).append(TAB); text.append(arrRuleRecords.get(processedRules).getRuleName()).append(TAB); text.append(arrRuleRecords.get(processedRules).getRuleLevel()).append(TAB); text.append(arrRuleRecords.get(processedRules).getOccurrences().size()).append(TAB); text.append(arrRuleRecords.get(processedRules).getRuleUseFrequency()).append(TAB); text.append(arrRuleRecords.get(processedRules).getRuleYield()).append(TAB); for (sym = currentRule.first(); (!sym.isGuard()); sym = sym.n) { if (sym.isNonTerminal()) { referedTo = ((SAXNonTerminal) sym).r; if ((rules.size() > referedTo.index) && (rules.elementAt(referedTo.index) == referedTo)) { index = referedTo.index; } else { index = rules.size(); referedTo.index = index; rules.addElement(referedTo); } text.append('R'); text.append(index); currentRuleString.append('R'); currentRuleString.append(index); } else { if (sym.value.equals(" ")) { text.append('_'); currentRuleString.append('_'); } else { if (sym.value.equals("\n")) { text.append("\\n"); currentRuleString.append("\\n"); } else { text.append(sym.value); currentRuleString.append(sym.value); } } } text.append(' '); currentRuleString.append(' '); } text.append(TAB).append(arrRuleRecords.get(processedRules).getExpandedRuleString()) .append(TAB); text.append(Arrays.toString(currentRule.getIndexes())).append(CR); processedRules++; currentRuleString = new StringBuilder(); } return text.toString(); }
class class_name[name] begin[{] method[printRules, return_type[type[String]], modifier[public static], parameter[]] begin[{] call[theRules.get, parameter[literal[0]]] call[.expandRules, parameter[]] local_variable[type[Vector], rules] local_variable[type[SAXRule], currentRule] local_variable[type[SAXRule], referedTo] local_variable[type[SAXSymbol], sym] local_variable[type[int], index] local_variable[type[int], processedRules] local_variable[type[StringBuilder], text] call[text.append, parameter[literal["Number\tName\tLevel\tOccurr.\tUsage\tYield\tRule str\tExpaneded\tIndexes\n"]]] call[rules.addElement, parameter[call[theRules.get, parameter[literal[0]]]]] local_variable[type[StringBuilder], currentRuleString] while[binary_operation[member[.processedRules], <, call[rules.size, parameter[]]]] begin[{] assign[member[.currentRule], call[rules.elementAt, parameter[member[.processedRules]]]] call[text.append, parameter[member[.SPACE]]] call[text.append, parameter[call[arrRuleRecords.get, parameter[member[.processedRules]]]]] call[text.append, parameter[call[arrRuleRecords.get, parameter[member[.processedRules]]]]] call[text.append, parameter[call[arrRuleRecords.get, parameter[member[.processedRules]]]]] call[text.append, parameter[call[arrRuleRecords.get, parameter[member[.processedRules]]]]] call[text.append, parameter[call[arrRuleRecords.get, parameter[member[.processedRules]]]]] call[text.append, parameter[call[arrRuleRecords.get, parameter[member[.processedRules]]]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isNonTerminal, postfix_operators=[], prefix_operators=[], qualifier=sym, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=sym.value, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=sym.value, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=sym, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=sym, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=currentRuleString, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\n")], member=append, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\n")], member=append, postfix_operators=[], prefix_operators=[], qualifier=currentRuleString, selectors=[], type_arguments=None), label=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=text, selectors=[], 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=currentRuleString, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=referedTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SAXNonTerminal, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rules, selectors=[], type_arguments=None), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=referedTo, selectors=[]), operator=>), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=referedTo, selectors=[])], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=rules, selectors=[], type_arguments=None), operandr=MemberReference(member=referedTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rules, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=referedTo, selectors=[]), type==, value=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=referedTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addElement, postfix_operators=[], prefix_operators=[], qualifier=rules, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=referedTo, selectors=[])), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='R')], member=append, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='R')], member=append, postfix_operators=[], prefix_operators=[], qualifier=currentRuleString, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=currentRuleString, selectors=[], 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=text, selectors=[], 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=currentRuleString, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=isGuard, postfix_operators=[], prefix_operators=[], qualifier=sym, selectors=[], type_arguments=None), init=[Assignment(expressionl=MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=first, postfix_operators=[], prefix_operators=[], qualifier=currentRule, selectors=[], type_arguments=None))], update=[Assignment(expressionl=MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=sym, selectors=[]))]), label=None) call[text.append, parameter[member[.TAB]]] call[text.append, parameter[call[Arrays.toString, parameter[call[currentRule.getIndexes, parameter[]]]]]] member[.processedRules] assign[member[.currentRuleString], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))] end[}] return[call[text.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[printRules] operator[SEP] operator[SEP] { identifier[theRules] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getSAXRules] operator[SEP] operator[SEP] operator[SEP] identifier[expandRules] operator[SEP] operator[SEP] operator[SEP] identifier[Vector] operator[<] identifier[SAXRule] operator[>] identifier[rules] operator[=] Keyword[new] identifier[Vector] operator[<] identifier[SAXRule] operator[>] operator[SEP] identifier[numRules] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SAXRule] identifier[currentRule] operator[SEP] identifier[SAXRule] identifier[referedTo] operator[SEP] identifier[SAXSymbol] identifier[sym] operator[SEP] Keyword[int] identifier[index] operator[SEP] Keyword[int] identifier[processedRules] operator[=] Other[0] operator[SEP] identifier[StringBuilder] identifier[text] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[rules] operator[SEP] identifier[addElement] operator[SEP] identifier[theRules] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[currentRuleString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[processedRules] operator[<] identifier[rules] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[currentRule] operator[=] identifier[rules] operator[SEP] identifier[elementAt] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[SPACE] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[getRuleNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[getRuleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[getRuleLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[getOccurrences] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[getRuleUseFrequency] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[getRuleYield] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[sym] operator[=] identifier[currentRule] operator[SEP] identifier[first] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[!] identifier[sym] operator[SEP] identifier[isGuard] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sym] operator[=] identifier[sym] operator[SEP] identifier[n] operator[SEP] { Keyword[if] operator[SEP] identifier[sym] operator[SEP] identifier[isNonTerminal] operator[SEP] operator[SEP] operator[SEP] { identifier[referedTo] operator[=] operator[SEP] operator[SEP] identifier[SAXNonTerminal] operator[SEP] identifier[sym] operator[SEP] operator[SEP] identifier[r] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[rules] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] identifier[referedTo] operator[SEP] identifier[index] operator[SEP] operator[&&] operator[SEP] identifier[rules] operator[SEP] identifier[elementAt] operator[SEP] identifier[referedTo] operator[SEP] identifier[index] operator[SEP] operator[==] identifier[referedTo] operator[SEP] operator[SEP] { identifier[index] operator[=] identifier[referedTo] operator[SEP] identifier[index] operator[SEP] } Keyword[else] { identifier[index] operator[=] identifier[rules] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[referedTo] operator[SEP] identifier[index] operator[=] identifier[index] operator[SEP] identifier[rules] operator[SEP] identifier[addElement] operator[SEP] identifier[referedTo] operator[SEP] operator[SEP] } identifier[text] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[currentRuleString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[currentRuleString] operator[SEP] identifier[append] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[sym] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[text] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[currentRuleString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[sym] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[text] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[currentRuleString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[sym] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[currentRuleString] operator[SEP] identifier[append] operator[SEP] identifier[sym] operator[SEP] identifier[value] operator[SEP] operator[SEP] } } } identifier[text] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[currentRuleString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[processedRules] operator[SEP] operator[SEP] identifier[getExpandedRuleString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TAB] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[append] operator[SEP] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[currentRule] operator[SEP] identifier[getIndexes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CR] operator[SEP] operator[SEP] identifier[processedRules] operator[++] operator[SEP] identifier[currentRuleString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[text] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public String convertToJson(Properties properties) throws ParsePropertiesException { for (Map.Entry<Object, Object> entry : properties.entrySet()) { if (!(entry.getKey() instanceof String)) { throw new ParsePropertiesException(format(PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE, entry.getKey().getClass(), entry.getKey() == null ? "null" : entry.getKey())); } } return convertFromValuesAsObjectMap(propertiesToMap(properties)); }
class class_name[name] begin[{] method[convertToJson, return_type[type[String]], modifier[public], parameter[properties]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null"))], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParsePropertiesException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=properties, 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=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[call[.convertFromValuesAsObjectMap, parameter[call[.propertiesToMap, parameter[member[.properties]]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[convertToJson] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] Keyword[throws] identifier[ParsePropertiesException] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[properties] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ParsePropertiesException] operator[SEP] identifier[format] operator[SEP] identifier[PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[convertFromValuesAsObjectMap] operator[SEP] identifier[propertiesToMap] operator[SEP] identifier[properties] operator[SEP] operator[SEP] operator[SEP] }
public void buildCategoryTree(List<CmsCategoryTreeEntry> treeEntries, Collection<String> selectedCategories) { m_valuesSet = 0; m_allSidePath.clear(); m_categories.removeFromParent(); m_categories.clear(); if ((treeEntries != null) && !treeEntries.isEmpty()) { // add the first level and children for (CmsCategoryTreeEntry category : treeEntries) { // set the category tree item and add to list CmsTreeItem treeItem; boolean hasSelectedChildren = hasSelectedChildren(category.getChildren(), selectedCategories); if (!category.getPath().isEmpty() || hasSelectedChildren) { if (m_selectParent || !hasSelectedChildren) { treeItem = buildTreeItem(category, selectedCategories, false); if (treeItem.isOpen()) { m_allSidePath.add(category.getSitePath()); } } else { treeItem = buildTreeItem(category, selectedCategories, true); } if (treeItem.isOpen()) { m_singleSidePath = category.getSitePath(); m_valuesSet++; addChildren(treeItem, category.getChildren(), selectedCategories); } } } } m_scrollPanel.add(m_categories); m_scrollPanel.onResizeDescendant(); }
class class_name[name] begin[{] method[buildCategoryTree, return_type[void], modifier[public], parameter[treeEntries, selectedCategories]] begin[{] assign[member[.m_valuesSet], literal[0]] call[m_allSidePath.clear, parameter[]] call[m_categories.removeFromParent, parameter[]] call[m_categories.clear, parameter[]] if[binary_operation[binary_operation[member[.treeEntries], !=, literal[null]], &&, call[treeEntries.isEmpty, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=treeItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsTreeItem, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=category, selectors=[], type_arguments=None), MemberReference(member=selectedCategories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasSelectedChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=hasSelectedChildren)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=['!'], qualifier=category, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=hasSelectedChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_selectParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=hasSelectedChildren, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=treeItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=category, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selectedCategories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=buildTreeItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=treeItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=category, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selectedCategories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=buildTreeItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isOpen, postfix_operators=[], prefix_operators=[], qualifier=treeItem, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=category, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=m_allSidePath, selectors=[], type_arguments=None), label=None)]))])), IfStatement(condition=MethodInvocation(arguments=[], member=isOpen, postfix_operators=[], prefix_operators=[], qualifier=treeItem, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_singleSidePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=category, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=m_valuesSet, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=treeItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=category, selectors=[], type_arguments=None), MemberReference(member=selectedCategories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=treeEntries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=category)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsCategoryTreeEntry, sub_type=None))), label=None) else begin[{] None end[}] call[m_scrollPanel.add, parameter[member[.m_categories]]] call[m_scrollPanel.onResizeDescendant, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[buildCategoryTree] operator[SEP] identifier[List] operator[<] identifier[CmsCategoryTreeEntry] operator[>] identifier[treeEntries] , identifier[Collection] operator[<] identifier[String] operator[>] identifier[selectedCategories] operator[SEP] { identifier[m_valuesSet] operator[=] Other[0] operator[SEP] identifier[m_allSidePath] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_categories] operator[SEP] identifier[removeFromParent] operator[SEP] operator[SEP] operator[SEP] identifier[m_categories] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[treeEntries] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[treeEntries] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[CmsCategoryTreeEntry] identifier[category] operator[:] identifier[treeEntries] operator[SEP] { identifier[CmsTreeItem] identifier[treeItem] operator[SEP] Keyword[boolean] identifier[hasSelectedChildren] operator[=] identifier[hasSelectedChildren] operator[SEP] identifier[category] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] , identifier[selectedCategories] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[category] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[hasSelectedChildren] operator[SEP] { Keyword[if] operator[SEP] identifier[m_selectParent] operator[||] operator[!] identifier[hasSelectedChildren] operator[SEP] { identifier[treeItem] operator[=] identifier[buildTreeItem] operator[SEP] identifier[category] , identifier[selectedCategories] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[treeItem] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] { identifier[m_allSidePath] operator[SEP] identifier[add] operator[SEP] identifier[category] operator[SEP] identifier[getSitePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[treeItem] operator[=] identifier[buildTreeItem] operator[SEP] identifier[category] , identifier[selectedCategories] , literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[treeItem] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] { identifier[m_singleSidePath] operator[=] identifier[category] operator[SEP] identifier[getSitePath] operator[SEP] operator[SEP] operator[SEP] identifier[m_valuesSet] operator[++] operator[SEP] identifier[addChildren] operator[SEP] identifier[treeItem] , identifier[category] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] , identifier[selectedCategories] operator[SEP] operator[SEP] } } } } identifier[m_scrollPanel] operator[SEP] identifier[add] operator[SEP] identifier[m_categories] operator[SEP] operator[SEP] identifier[m_scrollPanel] operator[SEP] identifier[onResizeDescendant] operator[SEP] operator[SEP] operator[SEP] }
public StopRecordingResponse stopRecording(String sessionId) { checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty string."); StopRecordingRequest request = new StopRecordingRequest().withSessionId(sessionId); InternalRequest internalRequest = createRequest(HttpMethodName.PUT, request, LIVE_SESSION, sessionId); internalRequest.addParameter(RECORDING, null); return invokeHttpClient(internalRequest, StopRecordingResponse.class); }
class class_name[name] begin[{] method[stopRecording, return_type[type[StopRecordingResponse]], modifier[public], parameter[sessionId]] begin[{] call[.checkStringNotEmpty, parameter[member[.sessionId], literal["The parameter sessionId should NOT be null or empty string."]]] local_variable[type[StopRecordingRequest], request] local_variable[type[InternalRequest], internalRequest] call[internalRequest.addParameter, parameter[member[.RECORDING], literal[null]]] return[call[.invokeHttpClient, parameter[member[.internalRequest], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StopRecordingResponse, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[StopRecordingResponse] identifier[stopRecording] operator[SEP] identifier[String] identifier[sessionId] operator[SEP] { identifier[checkStringNotEmpty] operator[SEP] identifier[sessionId] , literal[String] operator[SEP] operator[SEP] identifier[StopRecordingRequest] identifier[request] operator[=] Keyword[new] identifier[StopRecordingRequest] operator[SEP] operator[SEP] operator[SEP] identifier[withSessionId] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] identifier[InternalRequest] identifier[internalRequest] operator[=] identifier[createRequest] operator[SEP] identifier[HttpMethodName] operator[SEP] identifier[PUT] , identifier[request] , identifier[LIVE_SESSION] , identifier[sessionId] operator[SEP] operator[SEP] identifier[internalRequest] operator[SEP] identifier[addParameter] operator[SEP] identifier[RECORDING] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[invokeHttpClient] operator[SEP] identifier[internalRequest] , identifier[StopRecordingResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public String getContainer(String property) { if (property == null) { return null; } if (JsonLdConsts.GRAPH.equals(property)) { return JsonLdConsts.SET; } if (!property.equals(JsonLdConsts.TYPE) && JsonLdUtils.isKeyword(property)) { return property; } final Map<String, Object> td = (Map<String, Object>) termDefinitions.get(property); if (td == null) { return null; } return (String) td.get(JsonLdConsts.CONTAINER); }
class class_name[name] begin[{] method[getContainer, return_type[type[String]], modifier[public], parameter[property]] begin[{] if[binary_operation[member[.property], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[JsonLdConsts.GRAPH.equals, parameter[member[.property]]]] begin[{] return[member[JsonLdConsts.SET]] else begin[{] None end[}] if[binary_operation[call[property.equals, parameter[member[JsonLdConsts.TYPE]]], &&, call[JsonLdUtils.isKeyword, parameter[member[.property]]]]] begin[{] return[member[.property]] else begin[{] None end[}] local_variable[type[Map], td] if[binary_operation[member[.td], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=CONTAINER, postfix_operators=[], prefix_operators=[], qualifier=JsonLdConsts, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=td, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))] end[}] END[}]
Keyword[public] identifier[String] identifier[getContainer] operator[SEP] identifier[String] identifier[property] operator[SEP] { Keyword[if] operator[SEP] identifier[property] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[JsonLdConsts] operator[SEP] identifier[GRAPH] operator[SEP] identifier[equals] operator[SEP] identifier[property] operator[SEP] operator[SEP] { Keyword[return] identifier[JsonLdConsts] operator[SEP] identifier[SET] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[property] operator[SEP] identifier[equals] operator[SEP] identifier[JsonLdConsts] operator[SEP] identifier[TYPE] operator[SEP] operator[&&] identifier[JsonLdUtils] operator[SEP] identifier[isKeyword] operator[SEP] identifier[property] operator[SEP] operator[SEP] { Keyword[return] identifier[property] operator[SEP] } Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[td] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[termDefinitions] operator[SEP] identifier[get] operator[SEP] identifier[property] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[td] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] operator[SEP] identifier[String] operator[SEP] identifier[td] operator[SEP] identifier[get] operator[SEP] identifier[JsonLdConsts] operator[SEP] identifier[CONTAINER] operator[SEP] operator[SEP] }
private String getPrefixKey(String key, SortedMap<String, ?> whiteList) { String prefixKey = null; if (whiteList.containsKey(key)) { return key; } SortedMap<String, ?> headMap = whiteList.headMap(key); if (!headMap.isEmpty() && key.startsWith(headMap.lastKey())) { prefixKey = headMap.lastKey(); } return prefixKey; }
class class_name[name] begin[{] method[getPrefixKey, return_type[type[String]], modifier[private], parameter[key, whiteList]] begin[{] local_variable[type[String], prefixKey] if[call[whiteList.containsKey, parameter[member[.key]]]] begin[{] return[member[.key]] else begin[{] None end[}] local_variable[type[SortedMap], headMap] if[binary_operation[call[headMap.isEmpty, parameter[]], &&, call[key.startsWith, parameter[call[headMap.lastKey, parameter[]]]]]] begin[{] assign[member[.prefixKey], call[headMap.lastKey, parameter[]]] else begin[{] None end[}] return[member[.prefixKey]] end[}] END[}]
Keyword[private] identifier[String] identifier[getPrefixKey] operator[SEP] identifier[String] identifier[key] , identifier[SortedMap] operator[<] identifier[String] , operator[?] operator[>] identifier[whiteList] operator[SEP] { identifier[String] identifier[prefixKey] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[whiteList] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[return] identifier[key] operator[SEP] } identifier[SortedMap] operator[<] identifier[String] , operator[?] operator[>] identifier[headMap] operator[=] identifier[whiteList] operator[SEP] identifier[headMap] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[headMap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] identifier[headMap] operator[SEP] identifier[lastKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[prefixKey] operator[=] identifier[headMap] operator[SEP] identifier[lastKey] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[prefixKey] operator[SEP] }
@Override public Schema convertSchema(Schema inputSchema, WorkUnitState workUnit) throws SchemaConversionException { if (this.fieldRemover.isPresent()) { return this.fieldRemover.get().removeFields(inputSchema); } return inputSchema; }
class class_name[name] begin[{] method[convertSchema, return_type[type[Schema]], modifier[public], parameter[inputSchema, workUnit]] begin[{] if[THIS[member[None.fieldRemover]call[None.isPresent, parameter[]]]] begin[{] return[THIS[member[None.fieldRemover]call[None.get, parameter[]]call[None.removeFields, parameter[member[.inputSchema]]]]] else begin[{] None end[}] return[member[.inputSchema]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Schema] identifier[convertSchema] operator[SEP] identifier[Schema] identifier[inputSchema] , identifier[WorkUnitState] identifier[workUnit] operator[SEP] Keyword[throws] identifier[SchemaConversionException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[fieldRemover] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[fieldRemover] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[removeFields] operator[SEP] identifier[inputSchema] operator[SEP] operator[SEP] } Keyword[return] identifier[inputSchema] operator[SEP] }
public Set<CoreDocumentSynchronizationConfig> getSynchronizedDocuments( final MongoNamespace namespace ) { this.waitUntilInitialized(); try { ongoingOperationsGroup.enter(); return this.syncConfig.getSynchronizedDocuments(namespace); } finally { ongoingOperationsGroup.exit(); } }
class class_name[name] begin[{] method[getSynchronizedDocuments, return_type[type[Set]], modifier[public], parameter[namespace]] begin[{] THIS[call[None.waitUntilInitialized, parameter[]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=enter, postfix_operators=[], prefix_operators=[], qualifier=ongoingOperationsGroup, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=syncConfig, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSynchronizedDocuments, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=exit, postfix_operators=[], prefix_operators=[], qualifier=ongoingOperationsGroup, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[CoreDocumentSynchronizationConfig] operator[>] identifier[getSynchronizedDocuments] operator[SEP] Keyword[final] identifier[MongoNamespace] identifier[namespace] operator[SEP] { Keyword[this] operator[SEP] identifier[waitUntilInitialized] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[ongoingOperationsGroup] operator[SEP] identifier[enter] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[syncConfig] operator[SEP] identifier[getSynchronizedDocuments] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] } Keyword[finally] { identifier[ongoingOperationsGroup] operator[SEP] identifier[exit] operator[SEP] operator[SEP] operator[SEP] } }
@Override public Row buildRow(final DefaultDataSet ds) { String line = null; try { while ((line = br.readLine()) != null) { lineCount++; // empty line skip past it if (line.trim().length() == 0) { continue; } final String mdkey = FixedWidthParserUtils.getCMDKey(getPzMetaData(), line); final Row row = new Row(); row.setRowNumber(lineCount); row.setMdkey(mdkey.equals(FPConstants.DETAIL_ID) ? null : mdkey); final List<ColumnMetaData> cmds = ParserUtils.getColumnMetaData(mdkey, getPzMetaData()); final int recordLength = ((Integer) recordLengths.get(mdkey)).intValue(); if (line.length() > recordLength) { // Incorrect record length on line log the error. Line will not // be included in the // dataset if (isIgnoreExtraColumns()) { addError(ds, "TRUNCATED LINE TO CORRECT LENGTH", lineCount, 1); // user has chosen to ignore the fact that we have too many bytes in the fixed // width file. Truncate the line to the correct length row.addColumn(FixedWidthParserUtils.splitFixedText(cmds, line.substring(0, recordLength), isPreserveLeadingWhitespace(), isPreserveTrailingWhitespace())); } else { addError(ds, "LINE TOO LONG. LINE IS " + line.length() + " LONG. SHOULD BE " + recordLength, lineCount, 2, isStoreRawDataToDataError() ? line : null); continue; } } else if (line.length() < recordLength) { if (isHandlingShortLines()) { // log a warning addError(ds, "PADDED LINE TO CORRECT RECORD LENGTH", lineCount, 1); // We can pad this line out row.addColumn(FixedWidthParserUtils.splitFixedText(cmds, line + ParserUtils.padding(recordLength - line.length(), ' '), isPreserveLeadingWhitespace(), isPreserveTrailingWhitespace())); } else { addError(ds, "LINE TOO SHORT. LINE IS " + line.length() + " LONG. SHOULD BE " + recordLength, lineCount, 2, isStoreRawDataToDataError() ? line : null); continue; } } else { row.addColumn(FixedWidthParserUtils.splitFixedText(cmds, line, isPreserveLeadingWhitespace(), isPreserveTrailingWhitespace())); } if (isFlagEmptyRows()) { // user has elected to have the parser flag rows that are empty row.setEmpty(ParserUtils.isListElementsEmpty(row.getCols())); } if (isStoreRawDataToDataSet()) { // user told the parser to keep a copy of the raw data in the row // WARNING potential for high memory usage here row.setRawData(line); } return row; } } catch (final IOException e) { throw new FPException("Error Fetching Record From File...", e); } return null; }
class class_name[name] begin[{] method[buildRow, return_type[type[Row]], modifier[public], parameter[ds]] begin[{] local_variable[type[String], line] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=lineCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPzMetaData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCMDKey, postfix_operators=[], prefix_operators=[], qualifier=FixedWidthParserUtils, selectors=[], type_arguments=None), name=mdkey)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Row, sub_type=None)), name=row)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lineCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRowNumber, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=DETAIL_ID, postfix_operators=[], prefix_operators=[], qualifier=FPConstants, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=mdkey, selectors=[], type_arguments=None), if_false=MemberReference(member=mdkey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))], member=setMdkey, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=mdkey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPzMetaData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getColumnMetaData, postfix_operators=[], prefix_operators=[], qualifier=ParserUtils, selectors=[], type_arguments=None), name=cmds)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ColumnMetaData, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=mdkey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=recordLengths, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=recordLength)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cmds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=isPreserveLeadingWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isPreserveTrailingWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=splitFixedText, postfix_operators=[], prefix_operators=[], qualifier=FixedWidthParserUtils, selectors=[], type_arguments=None)], member=addColumn, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isHandlingShortLines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="LINE TOO SHORT. LINE IS "), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" LONG. SHOULD BE "), operator=+), operandr=MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=lineCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), TernaryExpression(condition=MethodInvocation(arguments=[], member=isStoreRawDataToDataError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member=addError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PADDED LINE TO CORRECT RECORD LENGTH"), MemberReference(member=lineCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=addError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cmds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operator=-), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=padding, postfix_operators=[], prefix_operators=[], qualifier=ParserUtils, selectors=[], type_arguments=None), operator=+), MethodInvocation(arguments=[], member=isPreserveLeadingWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isPreserveTrailingWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=splitFixedText, postfix_operators=[], prefix_operators=[], qualifier=FixedWidthParserUtils, selectors=[], type_arguments=None)], member=addColumn, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isIgnoreExtraColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="LINE TOO LONG. LINE IS "), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" LONG. SHOULD BE "), operator=+), operandr=MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=lineCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), TernaryExpression(condition=MethodInvocation(arguments=[], member=isStoreRawDataToDataError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member=addError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TRUNCATED LINE TO CORRECT LENGTH"), MemberReference(member=lineCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=addError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cmds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isPreserveLeadingWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isPreserveTrailingWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=splitFixedText, postfix_operators=[], prefix_operators=[], qualifier=FixedWidthParserUtils, selectors=[], type_arguments=None)], member=addColumn, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None)]))])), IfStatement(condition=MethodInvocation(arguments=[], member=isFlagEmptyRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCols, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=isListElementsEmpty, postfix_operators=[], prefix_operators=[], qualifier=ParserUtils, selectors=[], type_arguments=None)], member=setEmpty, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isStoreRawDataToDataSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRawData, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error Fetching Record From File..."), 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=FPException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Row] identifier[buildRow] operator[SEP] Keyword[final] identifier[DefaultDataSet] identifier[ds] operator[SEP] { identifier[String] identifier[line] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[lineCount] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[final] identifier[String] identifier[mdkey] operator[=] identifier[FixedWidthParserUtils] operator[SEP] identifier[getCMDKey] operator[SEP] identifier[getPzMetaData] operator[SEP] operator[SEP] , identifier[line] operator[SEP] operator[SEP] Keyword[final] identifier[Row] identifier[row] operator[=] Keyword[new] identifier[Row] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[setRowNumber] operator[SEP] identifier[lineCount] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[setMdkey] operator[SEP] identifier[mdkey] operator[SEP] identifier[equals] operator[SEP] identifier[FPConstants] operator[SEP] identifier[DETAIL_ID] operator[SEP] operator[?] Other[null] operator[:] identifier[mdkey] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ColumnMetaData] operator[>] identifier[cmds] operator[=] identifier[ParserUtils] operator[SEP] identifier[getColumnMetaData] operator[SEP] identifier[mdkey] , identifier[getPzMetaData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[recordLength] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[recordLengths] operator[SEP] identifier[get] operator[SEP] identifier[mdkey] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[recordLength] operator[SEP] { Keyword[if] operator[SEP] identifier[isIgnoreExtraColumns] operator[SEP] operator[SEP] operator[SEP] { identifier[addError] operator[SEP] identifier[ds] , literal[String] , identifier[lineCount] , Other[1] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[addColumn] operator[SEP] identifier[FixedWidthParserUtils] operator[SEP] identifier[splitFixedText] operator[SEP] identifier[cmds] , identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[recordLength] operator[SEP] , identifier[isPreserveLeadingWhitespace] operator[SEP] operator[SEP] , identifier[isPreserveTrailingWhitespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[addError] operator[SEP] identifier[ds] , literal[String] operator[+] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[recordLength] , identifier[lineCount] , Other[2] , identifier[isStoreRawDataToDataError] operator[SEP] operator[SEP] operator[?] identifier[line] operator[:] Other[null] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[recordLength] operator[SEP] { Keyword[if] operator[SEP] identifier[isHandlingShortLines] operator[SEP] operator[SEP] operator[SEP] { identifier[addError] operator[SEP] identifier[ds] , literal[String] , identifier[lineCount] , Other[1] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[addColumn] operator[SEP] identifier[FixedWidthParserUtils] operator[SEP] identifier[splitFixedText] operator[SEP] identifier[cmds] , identifier[line] operator[+] identifier[ParserUtils] operator[SEP] identifier[padding] operator[SEP] identifier[recordLength] operator[-] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] , literal[String] operator[SEP] , identifier[isPreserveLeadingWhitespace] operator[SEP] operator[SEP] , identifier[isPreserveTrailingWhitespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[addError] operator[SEP] identifier[ds] , literal[String] operator[+] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[recordLength] , identifier[lineCount] , Other[2] , identifier[isStoreRawDataToDataError] operator[SEP] operator[SEP] operator[?] identifier[line] operator[:] Other[null] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } } Keyword[else] { identifier[row] operator[SEP] identifier[addColumn] operator[SEP] identifier[FixedWidthParserUtils] operator[SEP] identifier[splitFixedText] operator[SEP] identifier[cmds] , identifier[line] , identifier[isPreserveLeadingWhitespace] operator[SEP] operator[SEP] , identifier[isPreserveTrailingWhitespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isFlagEmptyRows] operator[SEP] operator[SEP] operator[SEP] { identifier[row] operator[SEP] identifier[setEmpty] operator[SEP] identifier[ParserUtils] operator[SEP] identifier[isListElementsEmpty] operator[SEP] identifier[row] operator[SEP] identifier[getCols] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isStoreRawDataToDataSet] operator[SEP] operator[SEP] operator[SEP] { identifier[row] operator[SEP] identifier[setRawData] operator[SEP] identifier[line] operator[SEP] operator[SEP] } Keyword[return] identifier[row] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[FPException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static int cusolverSpScsrlsvluHost( cusolverSpHandle handle, int n, int nnzA, cusparseMatDescr descrA, Pointer csrValA, Pointer csrRowPtrA, Pointer csrColIndA, Pointer b, float tol, int reorder, Pointer x, int[] singularity) { return checkResult(cusolverSpScsrlsvluHostNative(handle, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, b, tol, reorder, x, singularity)); }
class class_name[name] begin[{] method[cusolverSpScsrlsvluHost, return_type[type[int]], modifier[public static], parameter[handle, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, b, tol, reorder, x, singularity]] begin[{] return[call[.checkResult, parameter[call[.cusolverSpScsrlsvluHostNative, parameter[member[.handle], member[.n], member[.nnzA], member[.descrA], member[.csrValA], member[.csrRowPtrA], member[.csrColIndA], member[.b], member[.tol], member[.reorder], member[.x], member[.singularity]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[cusolverSpScsrlsvluHost] operator[SEP] identifier[cusolverSpHandle] identifier[handle] , Keyword[int] identifier[n] , Keyword[int] identifier[nnzA] , identifier[cusparseMatDescr] identifier[descrA] , identifier[Pointer] identifier[csrValA] , identifier[Pointer] identifier[csrRowPtrA] , identifier[Pointer] identifier[csrColIndA] , identifier[Pointer] identifier[b] , Keyword[float] identifier[tol] , Keyword[int] identifier[reorder] , identifier[Pointer] identifier[x] , Keyword[int] operator[SEP] operator[SEP] identifier[singularity] operator[SEP] { Keyword[return] identifier[checkResult] operator[SEP] identifier[cusolverSpScsrlsvluHostNative] operator[SEP] identifier[handle] , identifier[n] , identifier[nnzA] , identifier[descrA] , identifier[csrValA] , identifier[csrRowPtrA] , identifier[csrColIndA] , identifier[b] , identifier[tol] , identifier[reorder] , identifier[x] , identifier[singularity] operator[SEP] operator[SEP] operator[SEP] }
protected void deactivate(ComponentContext context) { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "deactivate"); lock.writeLock().lock(); try { if (isInitialized) { if (classloader != null) { if (isDerbyEmbedded.get()) shutdownDerbyEmbedded(); classloader = null; } for (Iterator<Class<? extends CommonDataSource>> it = introspectedClasses.iterator(); it.hasNext(); it.remove()) Introspector.flushFromCaches(it.next()); isInitialized = false; } } finally { lock.writeLock().unlock(); } if (trace && tc.isEntryEnabled()) Tr.exit(this, tc, "deactivate"); }
class class_name[name] begin[{] method[deactivate, return_type[void], modifier[protected], parameter[context]] begin[{] local_variable[type[boolean], trace] if[binary_operation[member[.trace], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[THIS[], member[.tc], literal["deactivate"]]] else begin[{] None end[}] call[lock.writeLock, parameter[]] TryStatement(block=[IfStatement(condition=MemberReference(member=isInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=classloader, 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=[IfStatement(condition=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=isDerbyEmbedded, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=shutdownDerbyEmbedded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=classloader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None)], member=flushFromCaches, postfix_operators=[], prefix_operators=[], qualifier=Introspector, selectors=[], type_arguments=None), label=None), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=introspectedClasses, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=CommonDataSource, sub_type=None))], dimensions=[], name=Class, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=[MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) if[binary_operation[member[.trace], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[THIS[], member[.tc], literal["deactivate"]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[deactivate] operator[SEP] identifier[ComponentContext] identifier[context] operator[SEP] { Keyword[final] Keyword[boolean] identifier[trace] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[isInitialized] operator[SEP] { Keyword[if] operator[SEP] identifier[classloader] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isDerbyEmbedded] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[shutdownDerbyEmbedded] operator[SEP] operator[SEP] operator[SEP] identifier[classloader] operator[=] Other[null] operator[SEP] } Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[CommonDataSource] operator[>] operator[>] identifier[it] operator[=] identifier[introspectedClasses] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[Introspector] operator[SEP] identifier[flushFromCaches] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isInitialized] operator[=] literal[boolean] operator[SEP] } } Keyword[finally] { identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private void propagateFacetNames() { // collect all names and configurations Collection<String> facetNames = new ArrayList<String>(); Collection<I_CmsSearchConfigurationFacet> facetConfigs = new ArrayList<I_CmsSearchConfigurationFacet>(); facetNames.addAll(m_fieldFacets.keySet()); facetConfigs.addAll(m_fieldFacets.values()); facetNames.addAll(m_rangeFacets.keySet()); facetConfigs.addAll(m_rangeFacets.values()); if (null != m_queryFacet) { facetNames.add(m_queryFacet.getName()); facetConfigs.add(m_queryFacet); } // propagate all names for (I_CmsSearchConfigurationFacet facetConfig : facetConfigs) { facetConfig.propagateAllFacetNames(facetNames); } }
class class_name[name] begin[{] method[propagateFacetNames, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Collection], facetNames] local_variable[type[Collection], facetConfigs] call[facetNames.addAll, parameter[call[m_fieldFacets.keySet, parameter[]]]] call[facetConfigs.addAll, parameter[call[m_fieldFacets.values, parameter[]]]] call[facetNames.addAll, parameter[call[m_rangeFacets.keySet, parameter[]]]] call[facetConfigs.addAll, parameter[call[m_rangeFacets.values, parameter[]]]] if[binary_operation[literal[null], !=, member[.m_queryFacet]]] begin[{] call[facetNames.add, parameter[call[m_queryFacet.getName, parameter[]]]] call[facetConfigs.add, parameter[member[.m_queryFacet]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=facetNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=propagateAllFacetNames, postfix_operators=[], prefix_operators=[], qualifier=facetConfig, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=facetConfigs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=facetConfig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsSearchConfigurationFacet, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[propagateFacetNames] operator[SEP] operator[SEP] { identifier[Collection] operator[<] identifier[String] operator[>] identifier[facetNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[I_CmsSearchConfigurationFacet] operator[>] identifier[facetConfigs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[I_CmsSearchConfigurationFacet] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[facetNames] operator[SEP] identifier[addAll] operator[SEP] identifier[m_fieldFacets] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[facetConfigs] operator[SEP] identifier[addAll] operator[SEP] identifier[m_fieldFacets] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[facetNames] operator[SEP] identifier[addAll] operator[SEP] identifier[m_rangeFacets] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[facetConfigs] operator[SEP] identifier[addAll] operator[SEP] identifier[m_rangeFacets] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[m_queryFacet] operator[SEP] { identifier[facetNames] operator[SEP] identifier[add] operator[SEP] identifier[m_queryFacet] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[facetConfigs] operator[SEP] identifier[add] operator[SEP] identifier[m_queryFacet] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[I_CmsSearchConfigurationFacet] identifier[facetConfig] operator[:] identifier[facetConfigs] operator[SEP] { identifier[facetConfig] operator[SEP] identifier[propagateAllFacetNames] operator[SEP] identifier[facetNames] operator[SEP] operator[SEP] } }
public static BitSet bitwiseNegate(BitSet self) { BitSet result = (BitSet) self.clone(); result.flip(0, result.size() - 1); return result; }
class class_name[name] begin[{] method[bitwiseNegate, return_type[type[BitSet]], modifier[public static], parameter[self]] begin[{] local_variable[type[BitSet], result] call[result.flip, parameter[literal[0], binary_operation[call[result.size, parameter[]], -, literal[1]]]] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BitSet] identifier[bitwiseNegate] operator[SEP] identifier[BitSet] identifier[self] operator[SEP] { identifier[BitSet] identifier[result] operator[=] operator[SEP] identifier[BitSet] operator[SEP] identifier[self] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[flip] operator[SEP] Other[0] , identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public NodeSequence childNodes( Path parentPath, float score ) { String workspaceName = getWorkspaceName(parentPath); // Get the node filter to use ... NodeFilter nodeFilter = nodeFilterForWorkspace(workspaceName); if (nodeFilter != null) { // always append a shared nodes filter to the end of the workspace filter // JCR #14.16 -If a query matches a descendant node of a shared set, it appears in query results only once. NodeFilter compositeFilter = new CompositeNodeFilter(nodeFilter, sharedNodesFilter()); // Find the node by path ... NodeCache cache = repo.getWorkspaceCache(workspaceName); CachedNode parentNode = getNodeAtPath(parentPath, cache); if (parentNode != null) { // Only add those children that are queryable ... ChildReferences childRefs = parentNode.getChildReferences(cache); List<CachedNode> results = new ArrayList<CachedNode>((int)childRefs.size()); for (ChildReference childRef : childRefs) { CachedNode child = cache.getNode(childRef); if (compositeFilter.includeNode(child, cache)) { results.add(child); } } return NodeSequence.withNodes(results, score, workspaceName); } } return NodeSequence.emptySequence(1); }
class class_name[name] begin[{] method[childNodes, return_type[type[NodeSequence]], modifier[public], parameter[parentPath, score]] begin[{] local_variable[type[String], workspaceName] local_variable[type[NodeFilter], nodeFilter] if[binary_operation[member[.nodeFilter], !=, literal[null]]] begin[{] local_variable[type[NodeFilter], compositeFilter] local_variable[type[NodeCache], cache] local_variable[type[CachedNode], parentNode] if[binary_operation[member[.parentNode], !=, literal[null]]] begin[{] local_variable[type[ChildReferences], childRefs] local_variable[type[List], results] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=childRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CachedNode, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=includeNode, postfix_operators=[], prefix_operators=[], qualifier=compositeFilter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=childRefs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childRef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ChildReference, sub_type=None))), label=None) return[call[NodeSequence.withNodes, parameter[member[.results], member[.score], member[.workspaceName]]]] else begin[{] None end[}] else begin[{] None end[}] return[call[NodeSequence.emptySequence, parameter[literal[1]]]] end[}] END[}]
Keyword[public] identifier[NodeSequence] identifier[childNodes] operator[SEP] identifier[Path] identifier[parentPath] , Keyword[float] identifier[score] operator[SEP] { identifier[String] identifier[workspaceName] operator[=] identifier[getWorkspaceName] operator[SEP] identifier[parentPath] operator[SEP] operator[SEP] identifier[NodeFilter] identifier[nodeFilter] operator[=] identifier[nodeFilterForWorkspace] operator[SEP] identifier[workspaceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeFilter] operator[!=] Other[null] operator[SEP] { identifier[NodeFilter] identifier[compositeFilter] operator[=] Keyword[new] identifier[CompositeNodeFilter] operator[SEP] identifier[nodeFilter] , identifier[sharedNodesFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[NodeCache] identifier[cache] operator[=] identifier[repo] operator[SEP] identifier[getWorkspaceCache] operator[SEP] identifier[workspaceName] operator[SEP] operator[SEP] identifier[CachedNode] identifier[parentNode] operator[=] identifier[getNodeAtPath] operator[SEP] identifier[parentPath] , identifier[cache] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parentNode] operator[!=] Other[null] operator[SEP] { identifier[ChildReferences] identifier[childRefs] operator[=] identifier[parentNode] operator[SEP] identifier[getChildReferences] operator[SEP] identifier[cache] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CachedNode] operator[>] identifier[results] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CachedNode] operator[>] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[childRefs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ChildReference] identifier[childRef] operator[:] identifier[childRefs] operator[SEP] { identifier[CachedNode] identifier[child] operator[=] identifier[cache] operator[SEP] identifier[getNode] operator[SEP] identifier[childRef] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[compositeFilter] operator[SEP] identifier[includeNode] operator[SEP] identifier[child] , identifier[cache] operator[SEP] operator[SEP] { identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[child] operator[SEP] operator[SEP] } } Keyword[return] identifier[NodeSequence] operator[SEP] identifier[withNodes] operator[SEP] identifier[results] , identifier[score] , identifier[workspaceName] operator[SEP] operator[SEP] } } Keyword[return] identifier[NodeSequence] operator[SEP] identifier[emptySequence] operator[SEP] Other[1] operator[SEP] operator[SEP] }
private Map<String, String> parseArgsIntoMap(String[] args) { Map<String, String> parms = new HashMap<String, String>(); for (int i = 0; i < args.length; i++) { String key = args[i]; if (!isKeyword(key)) { throw new ValidatorProcessUsageException("'" + key + "' is not a keyword."); } if (!ALL_PARAMETERS.contains(key)) { throw new ValidatorProcessUsageException("'" + key + "' is not a recognized keyword."); } if (i >= args.length - 1) { parms.put(key, null); } else { String value = args[i + 1]; if (isKeyword(value)) { parms.put(key, null); } else { parms.put(key, value); i++; } } } return parms; }
class class_name[name] begin[{] method[parseArgsIntoMap, return_type[type[Map]], modifier[private], parameter[args]] begin[{] local_variable[type[Map], parms] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isKeyword, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a keyword."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValidatorProcessUsageException, sub_type=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=ALL_PARAMETERS, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a recognized keyword."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValidatorProcessUsageException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=>=), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=parms, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=put, postfix_operators=[], prefix_operators=[], qualifier=parms, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=put, postfix_operators=[], prefix_operators=[], qualifier=parms, 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=args, 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[.parms]] end[}] END[}]
Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parseArgsIntoMap] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parms] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[args] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[key] operator[=] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isKeyword] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ValidatorProcessUsageException] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[ALL_PARAMETERS] operator[SEP] identifier[contains] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ValidatorProcessUsageException] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[>=] identifier[args] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] { identifier[parms] operator[SEP] identifier[put] operator[SEP] identifier[key] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[value] operator[=] identifier[args] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isKeyword] operator[SEP] identifier[value] operator[SEP] operator[SEP] { identifier[parms] operator[SEP] identifier[put] operator[SEP] identifier[key] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[parms] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] } } } Keyword[return] identifier[parms] operator[SEP] }
public static ApplicationClassLoader getJarApplicationClassLoader(String jarFilePath) { ApplicationClassLoader jarApplicationClassLoader = jarApplicationClassLoaderCache.get(jarFilePath); if (jarApplicationClassLoader != null) { return jarApplicationClassLoader; } synchronized (jarApplicationClassLoaderCache) { jarApplicationClassLoader = jarApplicationClassLoaderCache.get(jarFilePath); if (jarApplicationClassLoader != null) { return jarApplicationClassLoader; } jarApplicationClassLoader = new ApplicationClassLoader(nodeApplicationClassLoader, false); jarApplicationClassLoader.addJarFiles(jarFilePath); jarApplicationClassLoaderCache.put(jarFilePath, jarApplicationClassLoader); return jarApplicationClassLoader; } }
class class_name[name] begin[{] method[getJarApplicationClassLoader, return_type[type[ApplicationClassLoader]], modifier[public static], parameter[jarFilePath]] begin[{] local_variable[type[ApplicationClassLoader], jarApplicationClassLoader] if[binary_operation[member[.jarApplicationClassLoader], !=, literal[null]]] begin[{] return[member[.jarApplicationClassLoader]] else begin[{] None end[}] SYNCHRONIZED[member[.jarApplicationClassLoaderCache]] BEGIN[{] assign[member[.jarApplicationClassLoader], call[jarApplicationClassLoaderCache.get, parameter[member[.jarFilePath]]]] if[binary_operation[member[.jarApplicationClassLoader], !=, literal[null]]] begin[{] return[member[.jarApplicationClassLoader]] else begin[{] None end[}] assign[member[.jarApplicationClassLoader], ClassCreator(arguments=[MemberReference(member=nodeApplicationClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ApplicationClassLoader, sub_type=None))] call[jarApplicationClassLoader.addJarFiles, parameter[member[.jarFilePath]]] call[jarApplicationClassLoaderCache.put, parameter[member[.jarFilePath], member[.jarApplicationClassLoader]]] return[member[.jarApplicationClassLoader]] END[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[ApplicationClassLoader] identifier[getJarApplicationClassLoader] operator[SEP] identifier[String] identifier[jarFilePath] operator[SEP] { identifier[ApplicationClassLoader] identifier[jarApplicationClassLoader] operator[=] identifier[jarApplicationClassLoaderCache] operator[SEP] identifier[get] operator[SEP] identifier[jarFilePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jarApplicationClassLoader] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[jarApplicationClassLoader] operator[SEP] } Keyword[synchronized] operator[SEP] identifier[jarApplicationClassLoaderCache] operator[SEP] { identifier[jarApplicationClassLoader] operator[=] identifier[jarApplicationClassLoaderCache] operator[SEP] identifier[get] operator[SEP] identifier[jarFilePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jarApplicationClassLoader] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[jarApplicationClassLoader] operator[SEP] } identifier[jarApplicationClassLoader] operator[=] Keyword[new] identifier[ApplicationClassLoader] operator[SEP] identifier[nodeApplicationClassLoader] , literal[boolean] operator[SEP] operator[SEP] identifier[jarApplicationClassLoader] operator[SEP] identifier[addJarFiles] operator[SEP] identifier[jarFilePath] operator[SEP] operator[SEP] identifier[jarApplicationClassLoaderCache] operator[SEP] identifier[put] operator[SEP] identifier[jarFilePath] , identifier[jarApplicationClassLoader] operator[SEP] operator[SEP] Keyword[return] identifier[jarApplicationClassLoader] operator[SEP] } }
public static synchronized void addParmEditDirective( String targetId, String name, String value, IPerson person) throws PortalException { Document plf = (Document) person.getAttribute(Constants.PLF); Element parmSet = getParmEditSet(plf, person, true); NodeList edits = parmSet.getChildNodes(); Element existingEdit = null; for (int i = 0; i < edits.getLength(); i++) { Element edit = (Element) edits.item(i); if (edit.getAttribute(Constants.ATT_TARGET).equals(targetId) && edit.getAttribute(Constants.ATT_NAME).equals(name)) { existingEdit = edit; break; } } if (existingEdit == null) // existing one not found, create a new one { addParmEditDirective(targetId, name, value, person, plf, parmSet); return; } existingEdit.setAttribute(Constants.ATT_USER_VALUE, value); }
class class_name[name] begin[{] method[addParmEditDirective, return_type[void], modifier[synchronized public static], parameter[targetId, name, value, person]] begin[{] local_variable[type[Document], plf] local_variable[type[Element], parmSet] local_variable[type[NodeList], edits] local_variable[type[Element], existingEdit] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=edits, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=edit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ATT_TARGET, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=edit, selectors=[MethodInvocation(arguments=[MemberReference(member=targetId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=ATT_NAME, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=edit, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=existingEdit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=edit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=edits, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.existingEdit], ==, literal[null]]] begin[{] call[.addParmEditDirective, parameter[member[.targetId], member[.name], member[.value], member[.person], member[.plf], member[.parmSet]]] return[None] else begin[{] None end[}] call[existingEdit.setAttribute, parameter[member[Constants.ATT_USER_VALUE], member[.value]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] Keyword[void] identifier[addParmEditDirective] operator[SEP] identifier[String] identifier[targetId] , identifier[String] identifier[name] , identifier[String] identifier[value] , identifier[IPerson] identifier[person] operator[SEP] Keyword[throws] identifier[PortalException] { identifier[Document] identifier[plf] operator[=] operator[SEP] identifier[Document] operator[SEP] identifier[person] operator[SEP] identifier[getAttribute] operator[SEP] identifier[Constants] operator[SEP] identifier[PLF] operator[SEP] operator[SEP] identifier[Element] identifier[parmSet] operator[=] identifier[getParmEditSet] operator[SEP] identifier[plf] , identifier[person] , literal[boolean] operator[SEP] operator[SEP] identifier[NodeList] identifier[edits] operator[=] identifier[parmSet] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[existingEdit] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[edits] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Element] identifier[edit] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[edits] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[edit] operator[SEP] identifier[getAttribute] operator[SEP] identifier[Constants] operator[SEP] identifier[ATT_TARGET] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[targetId] operator[SEP] operator[&&] identifier[edit] operator[SEP] identifier[getAttribute] operator[SEP] identifier[Constants] operator[SEP] identifier[ATT_NAME] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[existingEdit] operator[=] identifier[edit] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[existingEdit] operator[==] Other[null] operator[SEP] { identifier[addParmEditDirective] operator[SEP] identifier[targetId] , identifier[name] , identifier[value] , identifier[person] , identifier[plf] , identifier[parmSet] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[existingEdit] operator[SEP] identifier[setAttribute] operator[SEP] identifier[Constants] operator[SEP] identifier[ATT_USER_VALUE] , identifier[value] operator[SEP] operator[SEP] }
protected byte[] decompress(final byte[] in) { if (in == null) { return null; } ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayInputStream bis = new ByteArrayInputStream(in); GZIPInputStream gis = null; try { gis = new GZIPInputStream(bis); byte[] buf = new byte[8192]; int r = -1; while ((r = gis.read(buf)) > 0) { bos.write(buf, 0, r); } return bos.toByteArray(); } catch (IOException e) { throw new RuntimeException("IO exception decompressing data", e); } finally { close(gis); close(bis); close(bos); } }
class class_name[name] begin[{] method[decompress, return_type[type[byte]], modifier[protected], parameter[in]] begin[{] if[binary_operation[member[.in], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[ByteArrayOutputStream], bos] local_variable[type[ByteArrayInputStream], bis] local_variable[type[GZIPInputStream], gis] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=gis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=bis, 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=GZIPInputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8192)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buf)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=gis, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IO exception decompressing data"), 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=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[byte] operator[SEP] operator[SEP] identifier[decompress] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[in] operator[SEP] { Keyword[if] operator[SEP] identifier[in] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[ByteArrayOutputStream] identifier[bos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[ByteArrayInputStream] identifier[bis] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[in] operator[SEP] operator[SEP] identifier[GZIPInputStream] identifier[gis] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[gis] operator[=] Keyword[new] identifier[GZIPInputStream] operator[SEP] identifier[bis] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[8192] operator[SEP] operator[SEP] Keyword[int] identifier[r] operator[=] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[gis] operator[SEP] identifier[read] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[bos] operator[SEP] identifier[write] operator[SEP] identifier[buf] , Other[0] , identifier[r] operator[SEP] operator[SEP] } Keyword[return] identifier[bos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[close] operator[SEP] identifier[gis] operator[SEP] operator[SEP] identifier[close] operator[SEP] identifier[bis] operator[SEP] operator[SEP] identifier[close] operator[SEP] identifier[bos] operator[SEP] operator[SEP] } }
@Nullable @CardBrand public static String asCardBrand(@Nullable String possibleCardType) { if (possibleCardType == null || TextUtils.isEmpty(possibleCardType.trim())) { return null; } if (Card.AMERICAN_EXPRESS.equalsIgnoreCase(possibleCardType)) { return Card.AMERICAN_EXPRESS; } else if (Card.MASTERCARD.equalsIgnoreCase(possibleCardType)) { return Card.MASTERCARD; } else if (Card.DINERS_CLUB.equalsIgnoreCase(possibleCardType)) { return Card.DINERS_CLUB; } else if (Card.DISCOVER.equalsIgnoreCase(possibleCardType)) { return Card.DISCOVER; } else if (Card.JCB.equalsIgnoreCase(possibleCardType)) { return Card.JCB; } else if (Card.VISA.equalsIgnoreCase(possibleCardType)) { return Card.VISA; } else if (Card.UNIONPAY.equalsIgnoreCase(possibleCardType)) { return Card.UNIONPAY; } else { return Card.UNKNOWN; } }
class class_name[name] begin[{] method[asCardBrand, return_type[type[String]], modifier[public static], parameter[possibleCardType]] begin[{] if[binary_operation[binary_operation[member[.possibleCardType], ==, literal[null]], ||, call[TextUtils.isEmpty, parameter[call[possibleCardType.trim, parameter[]]]]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[Card.AMERICAN_EXPRESS.equalsIgnoreCase, parameter[member[.possibleCardType]]]] begin[{] return[member[Card.AMERICAN_EXPRESS]] else begin[{] if[call[Card.MASTERCARD.equalsIgnoreCase, parameter[member[.possibleCardType]]]] begin[{] return[member[Card.MASTERCARD]] else begin[{] if[call[Card.DINERS_CLUB.equalsIgnoreCase, parameter[member[.possibleCardType]]]] begin[{] return[member[Card.DINERS_CLUB]] else begin[{] if[call[Card.DISCOVER.equalsIgnoreCase, parameter[member[.possibleCardType]]]] begin[{] return[member[Card.DISCOVER]] else begin[{] if[call[Card.JCB.equalsIgnoreCase, parameter[member[.possibleCardType]]]] begin[{] return[member[Card.JCB]] else begin[{] if[call[Card.VISA.equalsIgnoreCase, parameter[member[.possibleCardType]]]] begin[{] return[member[Card.VISA]] else begin[{] if[call[Card.UNIONPAY.equalsIgnoreCase, parameter[member[.possibleCardType]]]] begin[{] return[member[Card.UNIONPAY]] else begin[{] return[member[Card.UNKNOWN]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
annotation[@] identifier[Nullable] annotation[@] identifier[CardBrand] Keyword[public] Keyword[static] identifier[String] identifier[asCardBrand] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[possibleCardType] operator[SEP] { Keyword[if] operator[SEP] identifier[possibleCardType] operator[==] Other[null] operator[||] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[possibleCardType] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[Card] operator[SEP] identifier[AMERICAN_EXPRESS] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[possibleCardType] operator[SEP] operator[SEP] { Keyword[return] identifier[Card] operator[SEP] identifier[AMERICAN_EXPRESS] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Card] operator[SEP] identifier[MASTERCARD] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[possibleCardType] operator[SEP] operator[SEP] { Keyword[return] identifier[Card] operator[SEP] identifier[MASTERCARD] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Card] operator[SEP] identifier[DINERS_CLUB] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[possibleCardType] operator[SEP] operator[SEP] { Keyword[return] identifier[Card] operator[SEP] identifier[DINERS_CLUB] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Card] operator[SEP] identifier[DISCOVER] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[possibleCardType] operator[SEP] operator[SEP] { Keyword[return] identifier[Card] operator[SEP] identifier[DISCOVER] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Card] operator[SEP] identifier[JCB] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[possibleCardType] operator[SEP] operator[SEP] { Keyword[return] identifier[Card] operator[SEP] identifier[JCB] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Card] operator[SEP] identifier[VISA] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[possibleCardType] operator[SEP] operator[SEP] { Keyword[return] identifier[Card] operator[SEP] identifier[VISA] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Card] operator[SEP] identifier[UNIONPAY] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[possibleCardType] operator[SEP] operator[SEP] { Keyword[return] identifier[Card] operator[SEP] identifier[UNIONPAY] operator[SEP] } Keyword[else] { Keyword[return] identifier[Card] operator[SEP] identifier[UNKNOWN] operator[SEP] } }
public static rewriteglobal_rewritepolicy_binding[] get_filtered(nitro_service service, String filter) throws Exception{ rewriteglobal_rewritepolicy_binding obj = new rewriteglobal_rewritepolicy_binding(); options option = new options(); option.set_filter(filter); rewriteglobal_rewritepolicy_binding[] response = (rewriteglobal_rewritepolicy_binding[]) obj.getfiltered(service, option); return response; }
class class_name[name] begin[{] method[get_filtered, return_type[type[rewriteglobal_rewritepolicy_binding]], modifier[public static], parameter[service, filter]] begin[{] local_variable[type[rewriteglobal_rewritepolicy_binding], obj] local_variable[type[options], option] call[option.set_filter, parameter[member[.filter]]] local_variable[type[rewriteglobal_rewritepolicy_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[rewriteglobal_rewritepolicy_binding] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] { identifier[rewriteglobal_rewritepolicy_binding] identifier[obj] operator[=] Keyword[new] identifier[rewriteglobal_rewritepolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[rewriteglobal_rewritepolicy_binding] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[rewriteglobal_rewritepolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public static <T> Matcher<T> anyOf(Iterable<? extends Matcher<? super T>> conditions) { return new AnyOf<T>(conditions); }
class class_name[name] begin[{] method[anyOf, return_type[type[Matcher]], modifier[public static], parameter[conditions]] begin[{] return[ClassCreator(arguments=[MemberReference(member=conditions, 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=AnyOf, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Matcher] operator[<] identifier[T] operator[>] identifier[anyOf] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[Matcher] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[conditions] operator[SEP] { Keyword[return] Keyword[new] identifier[AnyOf] operator[<] identifier[T] operator[>] operator[SEP] identifier[conditions] operator[SEP] operator[SEP] }
public static boolean list2Xls(ExcelConfig config, List<?> list, OutputStream outputStream) throws Exception { try { String[] header = config.getHeaders(); String[] names = config.getNames(); String[] values; WritableWorkbook wb = Workbook.createWorkbook(outputStream); String sheetName = (config.getSheet() != null && !config.getSheet().equals("")) ? config.getSheet() : ("sheet" + config.getSheetNum()); WritableSheet sheet = wb.createSheet(sheetName, 0); int row = 0; int column = 0; int rowadd = 0; //写入标题 if (config.getHeader()) { for (column = 0; column < header.length; column++) { sheet.addCell(new Label(column, row + rowadd, header[column])); if (config.getColumn(column).getWidth() != null) { sheet.setColumnView(column, config.getColumn(column).getWidth() / 7); } } rowadd++; } //写入内容//行 for (row = 0; row < list.size(); row++) { Object rowData = list.get(row); values = getObjValues(rowData, names); //列 for (column = 0; column < values.length; column++) { sheet.addCell(new Label(column, row + rowadd, values[column])); } } wb.write(); wb.close(); } catch (Exception e1) { return false; } return true; }
class class_name[name] begin[{] method[list2Xls, return_type[type[boolean]], modifier[public static], parameter[config, list, outputStream]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHeaders, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), name=header)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNames, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), name=names)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=values)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=outputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createWorkbook, postfix_operators=[], prefix_operators=[], qualifier=Workbook, selectors=[], type_arguments=None), name=wb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WritableWorkbook, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSheet, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getSheet, postfix_operators=[], prefix_operators=['!'], qualifier=config, 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), operator=&&), if_false=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sheet"), operandr=MethodInvocation(arguments=[], member=getSheetNum, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), operator=+), if_true=MethodInvocation(arguments=[], member=getSheet, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None)), name=sheetName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sheetName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=createSheet, postfix_operators=[], prefix_operators=[], qualifier=wb, selectors=[], type_arguments=None), name=sheet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WritableSheet, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=column)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=rowadd)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=getHeader, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rowadd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=column, 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=Label, sub_type=None))], member=addCell, postfix_operators=[], prefix_operators=[], qualifier=sheet, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[MethodInvocation(arguments=[], member=getWidth, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[MethodInvocation(arguments=[], member=getWidth, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7), operator=/)], member=setColumnView, postfix_operators=[], prefix_operators=[], qualifier=sheet, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=column, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MemberReference(member=rowadd, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), name=rowData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=rowData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObjValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rowadd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=column, 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=Label, sub_type=None))], member=addCell, postfix_operators=[], prefix_operators=[], qualifier=sheet, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=column, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), operator=<), init=[Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=write, postfix_operators=[], prefix_operators=[], qualifier=wb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=wb, 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=e1, types=['Exception']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[list2Xls] operator[SEP] identifier[ExcelConfig] identifier[config] , identifier[List] operator[<] operator[?] operator[>] identifier[list] , identifier[OutputStream] identifier[outputStream] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[try] { identifier[String] operator[SEP] operator[SEP] identifier[header] operator[=] identifier[config] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[names] operator[=] identifier[config] operator[SEP] identifier[getNames] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[WritableWorkbook] identifier[wb] operator[=] identifier[Workbook] operator[SEP] identifier[createWorkbook] operator[SEP] identifier[outputStream] operator[SEP] operator[SEP] identifier[String] identifier[sheetName] operator[=] operator[SEP] identifier[config] operator[SEP] identifier[getSheet] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[config] operator[SEP] identifier[getSheet] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[?] identifier[config] operator[SEP] identifier[getSheet] operator[SEP] operator[SEP] operator[:] operator[SEP] literal[String] operator[+] identifier[config] operator[SEP] identifier[getSheetNum] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[WritableSheet] identifier[sheet] operator[=] identifier[wb] operator[SEP] identifier[createSheet] operator[SEP] identifier[sheetName] , Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[row] operator[=] Other[0] operator[SEP] Keyword[int] identifier[column] operator[=] Other[0] operator[SEP] Keyword[int] identifier[rowadd] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[getHeader] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[column] operator[=] Other[0] operator[SEP] identifier[column] operator[<] identifier[header] operator[SEP] identifier[length] operator[SEP] identifier[column] operator[++] operator[SEP] { identifier[sheet] operator[SEP] identifier[addCell] operator[SEP] Keyword[new] identifier[Label] operator[SEP] identifier[column] , identifier[row] operator[+] identifier[rowadd] , identifier[header] operator[SEP] identifier[column] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[getColumn] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[sheet] operator[SEP] identifier[setColumnView] operator[SEP] identifier[column] , identifier[config] operator[SEP] identifier[getColumn] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[/] Other[7] operator[SEP] operator[SEP] } } identifier[rowadd] operator[++] operator[SEP] } Keyword[for] operator[SEP] identifier[row] operator[=] Other[0] operator[SEP] identifier[row] operator[<] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[++] operator[SEP] { identifier[Object] identifier[rowData] operator[=] identifier[list] operator[SEP] identifier[get] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[getObjValues] operator[SEP] identifier[rowData] , identifier[names] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[column] operator[=] Other[0] operator[SEP] identifier[column] operator[<] identifier[values] operator[SEP] identifier[length] operator[SEP] identifier[column] operator[++] operator[SEP] { identifier[sheet] operator[SEP] identifier[addCell] operator[SEP] Keyword[new] identifier[Label] operator[SEP] identifier[column] , identifier[row] operator[+] identifier[rowadd] , identifier[values] operator[SEP] identifier[column] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[wb] operator[SEP] identifier[write] operator[SEP] operator[SEP] operator[SEP] identifier[wb] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e1] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
static void store64(byte[] sink, int offset, long value) { // We don't want to assert in production code. assert offset >= 0 && offset + 8 <= sink.length; // Delegates to the fast (unsafe)version or the fallback. byteArray.putLongLittleEndian(sink, offset, value); }
class class_name[name] begin[{] method[store64, return_type[void], modifier[static], parameter[sink, offset, value]] begin[{] AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=sink, selectors=[]), operator=<=), operator=&&), label=None, value=None) call[byteArray.putLongLittleEndian, parameter[member[.sink], member[.offset], member[.value]]] end[}] END[}]
Keyword[static] Keyword[void] identifier[store64] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[sink] , Keyword[int] identifier[offset] , Keyword[long] identifier[value] operator[SEP] { Keyword[assert] identifier[offset] operator[>=] Other[0] operator[&&] identifier[offset] operator[+] Other[8] operator[<=] identifier[sink] operator[SEP] identifier[length] operator[SEP] identifier[byteArray] operator[SEP] identifier[putLongLittleEndian] operator[SEP] identifier[sink] , identifier[offset] , identifier[value] operator[SEP] operator[SEP] }
public FragmentResponseMessage processFragmentTask(SiteProcedureConnection siteConnection) { // Ensure default procs loaded here // Also used for LoadMultipartitionTable String procNameToLoad = m_fragmentMsg.getProcNameToLoad(); if (procNameToLoad != null) { // this will ensure proc is loaded ProcedureRunner runner = siteConnection.getProcedureRunner(procNameToLoad); assert(runner != null); } // IZZY: actually need the "executor" HSId these days? final FragmentResponseMessage currentFragResponse = new FragmentResponseMessage(m_fragmentMsg, m_initiator.getHSId()); currentFragResponse.setStatus(FragmentResponseMessage.SUCCESS, null); if (m_inputDeps != null) { siteConnection.stashWorkUnitDependencies(m_inputDeps); } if (m_fragmentMsg.isEmptyForRestart()) { int outputDepId = m_fragmentMsg.getOutputDepId(0); currentFragResponse.addDependency(new DependencyPair.BufferDependencyPair(outputDepId, m_rawDummyResponse, 0, m_rawDummyResponse.length)); return currentFragResponse; } ProcedureRunner currRunner = siteConnection.getProcedureRunner(m_fragmentMsg.getProcedureName()); long[] executionTimes = null; int succeededFragmentsCount = 0; if (currRunner != null) { currRunner.getExecutionEngine().setPerFragmentTimingEnabled(m_fragmentMsg.isPerFragmentStatsRecording()); if (m_fragmentMsg.isPerFragmentStatsRecording()) { // At this point, we will execute the fragments one by one. executionTimes = new long[1]; } } int drBufferChanged = 0; boolean exceptionThrown = false; boolean exceptionCaught = false; for (int frag = 0; frag < m_fragmentMsg.getFragmentCount(); frag++) { byte[] planHash = m_fragmentMsg.getPlanHash(frag); final int outputDepId = m_fragmentMsg.getOutputDepId(frag); ParameterSet params = m_fragmentMsg.getParameterSetForFragment(frag); final int inputDepId = m_fragmentMsg.getOnlyInputDepId(frag); long fragmentId = 0; byte[] fragmentPlan = null; /* * Currently the error path when executing plan fragments * does not adequately distinguish between fatal errors and * abort type errors that should result in a roll back. * Assume that it is ninja: succeeds or doesn't return. * No roll back support. * * AW in 2012, the preceding comment might be wrong, * I am pretty sure what we don't support is partial rollback. * The entire procedure will roll back successfully on failure */ VoltTable dependency = null; try { FastDeserializer fragResult; fragmentPlan = m_fragmentMsg.getFragmentPlan(frag); String stmtText = null; // if custom fragment, load the plan and get local fragment id if (fragmentPlan != null) { // statement text for unplanned fragments are pulled from the message, // to ensure that we get the correct constants from the most recent // invocation. stmtText = m_fragmentMsg.getStmtText(frag); fragmentId = ActivePlanRepository.loadOrAddRefPlanFragment(planHash, fragmentPlan, null); } // otherwise ask the plan source for a local fragment id else { fragmentId = ActivePlanRepository.getFragmentIdForPlanHash(planHash); stmtText = ActivePlanRepository.getStmtTextForPlanHash(planHash); } // set up the batch context for the fragment set siteConnection.setBatch(m_fragmentMsg.getCurrentBatchIndex()); fragResult = siteConnection.executePlanFragments( 1, new long[] { fragmentId }, new long [] { inputDepId }, new ParameterSet[] { params }, null, stmtText == null ? null : new String[] { stmtText }, // for long-running queries new boolean[] { false }, // FragmentTasks don't generate statement hashes, null, m_txnState.txnId, m_txnState.m_spHandle, m_txnState.uniqueId, m_txnState.isReadOnly(), VoltTrace.log(VoltTrace.Category.EE) != null); if (!exceptionThrown) { // Ignore results for all work done after an exception is thrown. We need to still do // the work because Shared Replicated Table changes require participation by all sites. // get a copy of the result buffers from the cache buffer so we can post the // fragment response to the network final int tableSize; final byte fullBacking[]; try { // read the size of the DR buffer used drBufferChanged = fragResult.readInt(); // read the complete size of the buffer used fragResult.readInt(); // read number of dependencies (1) fragResult.readInt(); // read the dependencyId() -1; fragResult.readInt(); tableSize = fragResult.readInt(); fullBacking = new byte[tableSize]; // get a copy of the buffer fragResult.readFully(fullBacking); } catch (final IOException ex) { hostLog.error("Failed to deserialze result table" + ex); throw new EEException(ExecutionEngine.ERRORCODE_WRONG_SERIALIZED_BYTES); } if (hostLog.isTraceEnabled()) { hostLog.l7dlog(Level.TRACE, LogKeys.org_voltdb_ExecutionSite_SendingDependency.name(), new Object[] { outputDepId }, null); } currentFragResponse.addDependency(new DependencyPair.BufferDependencyPair(outputDepId, fullBacking, 0, tableSize)); } } catch (final EEException | SQLException | ReplicatedTableException | InterruptException e) { if (!exceptionThrown) { hostLog.l7dlog( Level.TRACE, LogKeys.host_ExecutionSite_ExceptionExecutingPF.name(), new Object[] { Encoder.hexEncode(planHash) }, e); currentFragResponse.setStatus(FragmentResponseMessage.UNEXPECTED_ERROR, e); if (currentFragResponse.getTableCount() == 0) { // Make sure the response has at least 1 result with a valid DependencyId currentFragResponse.addDependency(new DependencyPair.BufferDependencyPair(outputDepId, m_rawDummyResult, 0, m_rawDummyResult.length)); } exceptionThrown = true; } } finally { // ensure adhoc plans are unloaded if (fragmentPlan != null) { ActivePlanRepository.decrefPlanFragmentById(fragmentId); } // If the executed fragment comes from a stored procedure, we need to update the per-fragment stats for it. // Notice that this code path is used to handle multi-partition stored procedures. // The single-partition stored procedure handler is in the ProcedureRunner. if (currRunner != null && !exceptionCaught) { succeededFragmentsCount = currRunner.getExecutionEngine().extractPerFragmentStats(1, executionTimes); long stmtDuration = 0; int stmtResultSize = 0; int stmtParameterSetSize = 0; if (m_fragmentMsg.isPerFragmentStatsRecording()) { stmtDuration = executionTimes == null ? 0 : executionTimes[0]; stmtResultSize = dependency == null ? 0 : dependency.getSerializedSize(); stmtParameterSetSize = params == null ? 0 : params.getSerializedSize(); } currRunner.getStatsCollector().endFragment(m_fragmentMsg.getStmtName(frag), m_fragmentMsg.isCoordinatorTask(), succeededFragmentsCount == 0, m_fragmentMsg.isPerFragmentStatsRecording(), stmtDuration, stmtResultSize, stmtParameterSetSize); if (exceptionThrown) { // skip the stats work for all fragments after the fragment that threw an exception exceptionCaught = true; } } } } // for multi fragments task, using the aggregated dr Buffer size currentFragResponse.setDrBufferSize(drBufferChanged); return currentFragResponse; }
class class_name[name] begin[{] method[processFragmentTask, return_type[type[FragmentResponseMessage]], modifier[public], parameter[siteConnection]] begin[{] local_variable[type[String], procNameToLoad] if[binary_operation[member[.procNameToLoad], !=, literal[null]]] begin[{] local_variable[type[ProcedureRunner], runner] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=runner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) else begin[{] None end[}] local_variable[type[FragmentResponseMessage], currentFragResponse] call[currentFragResponse.setStatus, parameter[member[FragmentResponseMessage.SUCCESS], literal[null]]] if[binary_operation[member[.m_inputDeps], !=, literal[null]]] begin[{] call[siteConnection.stashWorkUnitDependencies, parameter[member[.m_inputDeps]]] else begin[{] None end[}] if[call[m_fragmentMsg.isEmptyForRestart, parameter[]]] begin[{] local_variable[type[int], outputDepId] call[currentFragResponse.addDependency, parameter[ClassCreator(arguments=[MemberReference(member=outputDepId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_rawDummyResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=m_rawDummyResponse, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyPair, sub_type=ReferenceType(arguments=None, dimensions=None, name=BufferDependencyPair, sub_type=None)))]] return[member[.currentFragResponse]] else begin[{] None end[}] local_variable[type[ProcedureRunner], currRunner] local_variable[type[long], executionTimes] local_variable[type[int], succeededFragmentsCount] if[binary_operation[member[.currRunner], !=, literal[null]]] begin[{] call[currRunner.getExecutionEngine, parameter[]] if[call[m_fragmentMsg.isPerFragmentStatsRecording, parameter[]]] begin[{] assign[member[.executionTimes], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long))] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], drBufferChanged] local_variable[type[boolean], exceptionThrown] local_variable[type[boolean], exceptionCaught] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPlanHash, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), name=planHash)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOutputDepId, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), name=outputDepId)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameterSetForFragment, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), name=params)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParameterSet, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOnlyInputDepId, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), name=inputDepId)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=fragmentId)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=fragmentPlan)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=dependency)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VoltTable, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=fragResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FastDeserializer, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fragmentPlan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFragmentPlan, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=stmtText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fragmentPlan, 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=Assignment(expressionl=MemberReference(member=fragmentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=planHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFragmentIdForPlanHash, postfix_operators=[], prefix_operators=[], qualifier=ActivePlanRepository, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stmtText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=planHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStmtTextForPlanHash, postfix_operators=[], prefix_operators=[], qualifier=ActivePlanRepository, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stmtText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStmtText, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fragmentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=planHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fragmentPlan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=loadOrAddRefPlanFragment, postfix_operators=[], prefix_operators=[], qualifier=ActivePlanRepository, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCurrentBatchIndex, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None)], member=setBatch, postfix_operators=[], prefix_operators=[], qualifier=siteConnection, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fragResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=fragmentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=inputDepId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParameterSet, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=stmtText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=stmtText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=boolean)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=txnId, postfix_operators=[], prefix_operators=[], qualifier=m_txnState, selectors=[]), MemberReference(member=m_spHandle, postfix_operators=[], prefix_operators=[], qualifier=m_txnState, selectors=[]), MemberReference(member=uniqueId, postfix_operators=[], prefix_operators=[], qualifier=m_txnState, selectors=[]), MethodInvocation(arguments=[], member=isReadOnly, postfix_operators=[], prefix_operators=[], qualifier=m_txnState, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=EE, postfix_operators=[], prefix_operators=[], qualifier=VoltTrace.Category, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=VoltTrace, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)], member=executePlanFragments, postfix_operators=[], prefix_operators=[], qualifier=siteConnection, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=exceptionThrown, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=tableSize)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=None, name=fullBacking)], modifiers={'final'}, type=BasicType(dimensions=[], name=byte)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=drBufferChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=fragResult, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=fragResult, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=fragResult, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=fragResult, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tableSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=fragResult, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fullBacking, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[MemberReference(member=tableSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fullBacking, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFully, postfix_operators=[], prefix_operators=[], qualifier=fragResult, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to deserialze result table"), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=hostLog, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ERRORCODE_WRONG_SERIALIZED_BYTES, postfix_operators=[], prefix_operators=[], qualifier=ExecutionEngine, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EEException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None), IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=hostLog, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TRACE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=LogKeys.org_voltdb_ExecutionSite_SendingDependency, selectors=[], type_arguments=None), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=outputDepId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=l7dlog, postfix_operators=[], prefix_operators=[], qualifier=hostLog, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=outputDepId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fullBacking, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=tableSize, 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=DependencyPair, sub_type=ReferenceType(arguments=None, dimensions=None, name=BufferDependencyPair, sub_type=None)))], member=addDependency, postfix_operators=[], prefix_operators=[], qualifier=currentFragResponse, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=exceptionThrown, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TRACE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=LogKeys.host_ExecutionSite_ExceptionExecutingPF, selectors=[], type_arguments=None), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=planHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hexEncode, postfix_operators=[], prefix_operators=[], qualifier=Encoder, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=l7dlog, postfix_operators=[], prefix_operators=[], qualifier=hostLog, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=UNEXPECTED_ERROR, postfix_operators=[], prefix_operators=[], qualifier=FragmentResponseMessage, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=currentFragResponse, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTableCount, postfix_operators=[], prefix_operators=[], qualifier=currentFragResponse, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=outputDepId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_rawDummyResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=m_rawDummyResult, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyPair, sub_type=ReferenceType(arguments=None, dimensions=None, name=BufferDependencyPair, sub_type=None)))], member=addDependency, postfix_operators=[], prefix_operators=[], qualifier=currentFragResponse, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptionThrown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['EEException', 'SQLException', 'ReplicatedTableException', 'InterruptException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fragmentPlan, 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=fragmentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decrefPlanFragmentById, postfix_operators=[], prefix_operators=[], qualifier=ActivePlanRepository, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=currRunner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MemberReference(member=exceptionCaught, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=succeededFragmentsCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getExecutionEngine, postfix_operators=[], prefix_operators=[], qualifier=currRunner, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=executionTimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractPerFragmentStats, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=stmtDuration)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=stmtResultSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=stmtParameterSetSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=isPerFragmentStatsRecording, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stmtDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=executionTimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=executionTimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stmtResultSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=dependency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getSerializedSize, postfix_operators=[], prefix_operators=[], qualifier=dependency, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stmtParameterSetSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getSerializedSize, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getStatsCollector, postfix_operators=[], prefix_operators=[], qualifier=currRunner, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStmtName, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isCoordinatorTask, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=succeededFragmentsCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), MethodInvocation(arguments=[], member=isPerFragmentStatsRecording, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), MemberReference(member=stmtDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stmtResultSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stmtParameterSetSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endFragment, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=exceptionThrown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptionCaught, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]))], label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=frag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getFragmentCount, postfix_operators=[], prefix_operators=[], qualifier=m_fragmentMsg, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=frag)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=frag, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[currentFragResponse.setDrBufferSize, parameter[member[.drBufferChanged]]] return[member[.currentFragResponse]] end[}] END[}]
Keyword[public] identifier[FragmentResponseMessage] identifier[processFragmentTask] operator[SEP] identifier[SiteProcedureConnection] identifier[siteConnection] operator[SEP] { identifier[String] identifier[procNameToLoad] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getProcNameToLoad] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[procNameToLoad] operator[!=] Other[null] operator[SEP] { identifier[ProcedureRunner] identifier[runner] operator[=] identifier[siteConnection] operator[SEP] identifier[getProcedureRunner] operator[SEP] identifier[procNameToLoad] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[runner] operator[!=] Other[null] operator[SEP] operator[SEP] } Keyword[final] identifier[FragmentResponseMessage] identifier[currentFragResponse] operator[=] Keyword[new] identifier[FragmentResponseMessage] operator[SEP] identifier[m_fragmentMsg] , identifier[m_initiator] operator[SEP] identifier[getHSId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[currentFragResponse] operator[SEP] identifier[setStatus] operator[SEP] identifier[FragmentResponseMessage] operator[SEP] identifier[SUCCESS] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_inputDeps] operator[!=] Other[null] operator[SEP] { identifier[siteConnection] operator[SEP] identifier[stashWorkUnitDependencies] operator[SEP] identifier[m_inputDeps] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m_fragmentMsg] operator[SEP] identifier[isEmptyForRestart] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[outputDepId] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getOutputDepId] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[currentFragResponse] operator[SEP] identifier[addDependency] operator[SEP] Keyword[new] identifier[DependencyPair] operator[SEP] identifier[BufferDependencyPair] operator[SEP] identifier[outputDepId] , identifier[m_rawDummyResponse] , Other[0] , identifier[m_rawDummyResponse] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[currentFragResponse] operator[SEP] } identifier[ProcedureRunner] identifier[currRunner] operator[=] identifier[siteConnection] operator[SEP] identifier[getProcedureRunner] operator[SEP] identifier[m_fragmentMsg] operator[SEP] identifier[getProcedureName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[executionTimes] operator[=] Other[null] operator[SEP] Keyword[int] identifier[succeededFragmentsCount] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[currRunner] operator[!=] Other[null] operator[SEP] { identifier[currRunner] operator[SEP] identifier[getExecutionEngine] operator[SEP] operator[SEP] operator[SEP] identifier[setPerFragmentTimingEnabled] operator[SEP] identifier[m_fragmentMsg] operator[SEP] identifier[isPerFragmentStatsRecording] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_fragmentMsg] operator[SEP] identifier[isPerFragmentStatsRecording] operator[SEP] operator[SEP] operator[SEP] { identifier[executionTimes] operator[=] Keyword[new] Keyword[long] operator[SEP] Other[1] operator[SEP] operator[SEP] } } Keyword[int] identifier[drBufferChanged] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[exceptionThrown] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[exceptionCaught] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[frag] operator[=] Other[0] operator[SEP] identifier[frag] operator[<] identifier[m_fragmentMsg] operator[SEP] identifier[getFragmentCount] operator[SEP] operator[SEP] operator[SEP] identifier[frag] operator[++] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[planHash] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getPlanHash] operator[SEP] identifier[frag] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[outputDepId] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getOutputDepId] operator[SEP] identifier[frag] operator[SEP] operator[SEP] identifier[ParameterSet] identifier[params] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getParameterSetForFragment] operator[SEP] identifier[frag] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[inputDepId] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getOnlyInputDepId] operator[SEP] identifier[frag] operator[SEP] operator[SEP] Keyword[long] identifier[fragmentId] operator[=] Other[0] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[fragmentPlan] operator[=] Other[null] operator[SEP] identifier[VoltTable] identifier[dependency] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[FastDeserializer] identifier[fragResult] operator[SEP] identifier[fragmentPlan] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getFragmentPlan] operator[SEP] identifier[frag] operator[SEP] operator[SEP] identifier[String] identifier[stmtText] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[fragmentPlan] operator[!=] Other[null] operator[SEP] { identifier[stmtText] operator[=] identifier[m_fragmentMsg] operator[SEP] identifier[getStmtText] operator[SEP] identifier[frag] operator[SEP] operator[SEP] identifier[fragmentId] operator[=] identifier[ActivePlanRepository] operator[SEP] identifier[loadOrAddRefPlanFragment] operator[SEP] identifier[planHash] , identifier[fragmentPlan] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[fragmentId] operator[=] identifier[ActivePlanRepository] operator[SEP] identifier[getFragmentIdForPlanHash] operator[SEP] identifier[planHash] operator[SEP] operator[SEP] identifier[stmtText] operator[=] identifier[ActivePlanRepository] operator[SEP] identifier[getStmtTextForPlanHash] operator[SEP] identifier[planHash] operator[SEP] operator[SEP] } identifier[siteConnection] operator[SEP] identifier[setBatch] operator[SEP] identifier[m_fragmentMsg] operator[SEP] identifier[getCurrentBatchIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fragResult] operator[=] identifier[siteConnection] operator[SEP] identifier[executePlanFragments] operator[SEP] Other[1] , Keyword[new] Keyword[long] operator[SEP] operator[SEP] { identifier[fragmentId] } , Keyword[new] Keyword[long] operator[SEP] operator[SEP] { identifier[inputDepId] } , Keyword[new] identifier[ParameterSet] operator[SEP] operator[SEP] { identifier[params] } , Other[null] , identifier[stmtText] operator[==] Other[null] operator[?] Other[null] operator[:] Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[stmtText] } , Keyword[new] Keyword[boolean] operator[SEP] operator[SEP] { literal[boolean] } , Other[null] , identifier[m_txnState] operator[SEP] identifier[txnId] , identifier[m_txnState] operator[SEP] identifier[m_spHandle] , identifier[m_txnState] operator[SEP] identifier[uniqueId] , identifier[m_txnState] operator[SEP] identifier[isReadOnly] operator[SEP] operator[SEP] , identifier[VoltTrace] operator[SEP] identifier[log] operator[SEP] identifier[VoltTrace] operator[SEP] identifier[Category] operator[SEP] identifier[EE] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[exceptionThrown] operator[SEP] { Keyword[final] Keyword[int] identifier[tableSize] operator[SEP] Keyword[final] Keyword[byte] identifier[fullBacking] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[drBufferChanged] operator[=] identifier[fragResult] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[fragResult] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[fragResult] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[fragResult] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[tableSize] operator[=] identifier[fragResult] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[fullBacking] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[tableSize] operator[SEP] operator[SEP] identifier[fragResult] operator[SEP] identifier[readFully] operator[SEP] identifier[fullBacking] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[ex] operator[SEP] { identifier[hostLog] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[ex] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[EEException] operator[SEP] identifier[ExecutionEngine] operator[SEP] identifier[ERRORCODE_WRONG_SERIALIZED_BYTES] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[hostLog] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[hostLog] operator[SEP] identifier[l7dlog] operator[SEP] identifier[Level] operator[SEP] identifier[TRACE] , identifier[LogKeys] operator[SEP] identifier[org_voltdb_ExecutionSite_SendingDependency] operator[SEP] identifier[name] operator[SEP] operator[SEP] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[outputDepId] } , Other[null] operator[SEP] operator[SEP] } identifier[currentFragResponse] operator[SEP] identifier[addDependency] operator[SEP] Keyword[new] identifier[DependencyPair] operator[SEP] identifier[BufferDependencyPair] operator[SEP] identifier[outputDepId] , identifier[fullBacking] , Other[0] , identifier[tableSize] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[EEException] operator[|] identifier[SQLException] operator[|] identifier[ReplicatedTableException] operator[|] identifier[InterruptException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[exceptionThrown] operator[SEP] { identifier[hostLog] operator[SEP] identifier[l7dlog] operator[SEP] identifier[Level] operator[SEP] identifier[TRACE] , identifier[LogKeys] operator[SEP] identifier[host_ExecutionSite_ExceptionExecutingPF] operator[SEP] identifier[name] operator[SEP] operator[SEP] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[Encoder] operator[SEP] identifier[hexEncode] operator[SEP] identifier[planHash] operator[SEP] } , identifier[e] operator[SEP] operator[SEP] identifier[currentFragResponse] operator[SEP] identifier[setStatus] operator[SEP] identifier[FragmentResponseMessage] operator[SEP] identifier[UNEXPECTED_ERROR] , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentFragResponse] operator[SEP] identifier[getTableCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[currentFragResponse] operator[SEP] identifier[addDependency] operator[SEP] Keyword[new] identifier[DependencyPair] operator[SEP] identifier[BufferDependencyPair] operator[SEP] identifier[outputDepId] , identifier[m_rawDummyResult] , Other[0] , identifier[m_rawDummyResult] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } identifier[exceptionThrown] operator[=] literal[boolean] operator[SEP] } } Keyword[finally] { Keyword[if] operator[SEP] identifier[fragmentPlan] operator[!=] Other[null] operator[SEP] { identifier[ActivePlanRepository] operator[SEP] identifier[decrefPlanFragmentById] operator[SEP] identifier[fragmentId] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currRunner] operator[!=] Other[null] operator[&&] operator[!] identifier[exceptionCaught] operator[SEP] { identifier[succeededFragmentsCount] operator[=] identifier[currRunner] operator[SEP] identifier[getExecutionEngine] operator[SEP] operator[SEP] operator[SEP] identifier[extractPerFragmentStats] operator[SEP] Other[1] , identifier[executionTimes] operator[SEP] operator[SEP] Keyword[long] identifier[stmtDuration] operator[=] Other[0] operator[SEP] Keyword[int] identifier[stmtResultSize] operator[=] Other[0] operator[SEP] Keyword[int] identifier[stmtParameterSetSize] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[m_fragmentMsg] operator[SEP] identifier[isPerFragmentStatsRecording] operator[SEP] operator[SEP] operator[SEP] { identifier[stmtDuration] operator[=] identifier[executionTimes] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[executionTimes] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[stmtResultSize] operator[=] identifier[dependency] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[dependency] operator[SEP] identifier[getSerializedSize] operator[SEP] operator[SEP] operator[SEP] identifier[stmtParameterSetSize] operator[=] identifier[params] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[params] operator[SEP] identifier[getSerializedSize] operator[SEP] operator[SEP] operator[SEP] } identifier[currRunner] operator[SEP] identifier[getStatsCollector] operator[SEP] operator[SEP] operator[SEP] identifier[endFragment] operator[SEP] identifier[m_fragmentMsg] operator[SEP] identifier[getStmtName] operator[SEP] identifier[frag] operator[SEP] , identifier[m_fragmentMsg] operator[SEP] identifier[isCoordinatorTask] operator[SEP] operator[SEP] , identifier[succeededFragmentsCount] operator[==] Other[0] , identifier[m_fragmentMsg] operator[SEP] identifier[isPerFragmentStatsRecording] operator[SEP] operator[SEP] , identifier[stmtDuration] , identifier[stmtResultSize] , identifier[stmtParameterSetSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exceptionThrown] operator[SEP] { identifier[exceptionCaught] operator[=] literal[boolean] operator[SEP] } } } } identifier[currentFragResponse] operator[SEP] identifier[setDrBufferSize] operator[SEP] identifier[drBufferChanged] operator[SEP] operator[SEP] Keyword[return] identifier[currentFragResponse] operator[SEP] }
private char getRelationFromSenseGlossMatchers(List<ISense> sourceSenses, List<ISense> targetSenses) throws MatcherLibraryException { char relation = IMappingElement.IDK; if (0 < senseGlossMatchers.size()) { for (ISense sourceSense : sourceSenses) { //noinspection LoopStatementThatDoesntLoop for (ISense targetSense : targetSenses) { int k = 0; while ((relation == IMappingElement.IDK) && (k < senseGlossMatchers.size())) { relation = senseGlossMatchers.get(k).match(sourceSense, targetSense); k++; } return relation; } } } return relation; }
class class_name[name] begin[{] method[getRelationFromSenseGlossMatchers, return_type[type[char]], modifier[private], parameter[sourceSenses, targetSenses]] begin[{] local_variable[type[char], relation] if[binary_operation[literal[0], <, call[senseGlossMatchers.size, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=relation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=senseGlossMatchers, selectors=[MethodInvocation(arguments=[MemberReference(member=sourceSense, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetSense, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=relation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IDK, postfix_operators=[], prefix_operators=[], qualifier=IMappingElement, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=senseGlossMatchers, selectors=[], type_arguments=None), operator=<), operator=&&), label=None), ReturnStatement(expression=MemberReference(member=relation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=targetSenses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=targetSense)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ISense, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sourceSenses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sourceSense)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ISense, sub_type=None))), label=None) else begin[{] None end[}] return[member[.relation]] end[}] END[}]
Keyword[private] Keyword[char] identifier[getRelationFromSenseGlossMatchers] operator[SEP] identifier[List] operator[<] identifier[ISense] operator[>] identifier[sourceSenses] , identifier[List] operator[<] identifier[ISense] operator[>] identifier[targetSenses] operator[SEP] Keyword[throws] identifier[MatcherLibraryException] { Keyword[char] identifier[relation] operator[=] identifier[IMappingElement] operator[SEP] identifier[IDK] operator[SEP] Keyword[if] operator[SEP] Other[0] operator[<] identifier[senseGlossMatchers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[ISense] identifier[sourceSense] operator[:] identifier[sourceSenses] operator[SEP] { Keyword[for] operator[SEP] identifier[ISense] identifier[targetSense] operator[:] identifier[targetSenses] operator[SEP] { Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[relation] operator[==] identifier[IMappingElement] operator[SEP] identifier[IDK] operator[SEP] operator[&&] operator[SEP] identifier[k] operator[<] identifier[senseGlossMatchers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[relation] operator[=] identifier[senseGlossMatchers] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[match] operator[SEP] identifier[sourceSense] , identifier[targetSense] operator[SEP] operator[SEP] identifier[k] operator[++] operator[SEP] } Keyword[return] identifier[relation] operator[SEP] } } } Keyword[return] identifier[relation] operator[SEP] }
public void debug(String format, Object... args) { if (logger.isLoggable(FINE)) { String message; try { message = format(format, args); } catch (IllegalFormatException e) { logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e); message = rawMessageFor(format, args); } logger.fine(message); } }
class class_name[name] begin[{] method[debug, return_type[void], modifier[public], parameter[format, args]] begin[{] if[call[logger.isLoggable, parameter[member[.FINE]]]] begin[{] local_variable[type[String], message] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DEBUG"), MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=illegalFormatMessageFor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rawMessageFor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalFormatException']))], finally_block=None, label=None, resources=None) call[logger.fine, parameter[member[.message]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[debug] operator[SEP] identifier[String] identifier[format] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[String] identifier[message] operator[SEP] Keyword[try] { identifier[message] operator[=] identifier[format] operator[SEP] identifier[format] , identifier[args] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalFormatException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[SEVERE] , identifier[illegalFormatMessageFor] operator[SEP] literal[String] , identifier[format] , identifier[args] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[message] operator[=] identifier[rawMessageFor] operator[SEP] identifier[format] , identifier[args] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[fine] operator[SEP] identifier[message] operator[SEP] operator[SEP] } }
public void callRpcWrapped(S request, RpcResponseHandler<? extends T> responseHandler) throws IOException { for (int i = 0; i < _maximumRetries; ++i) { try { callRpcChecked(request, responseHandler); return; } catch (RpcException e) { handleRpcException(e, i); } } }
class class_name[name] begin[{] method[callRpcWrapped, return_type[void], modifier[public], parameter[request, responseHandler]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=callRpcChecked, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleRpcException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RpcException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_maximumRetries, 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) end[}] END[}]
Keyword[public] Keyword[void] identifier[callRpcWrapped] operator[SEP] identifier[S] identifier[request] , identifier[RpcResponseHandler] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[responseHandler] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_maximumRetries] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[try] { identifier[callRpcChecked] operator[SEP] identifier[request] , identifier[responseHandler] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[catch] operator[SEP] identifier[RpcException] identifier[e] operator[SEP] { identifier[handleRpcException] operator[SEP] identifier[e] , identifier[i] operator[SEP] operator[SEP] } } }
public void waitForOperation(String operationName, int maxSeconds) throws InterruptedException { long endTimeMillis = TimeUnit.SECONDS.toMillis(maxSeconds) + System.currentTimeMillis(); GetOperationRequest request = GetOperationRequest.newBuilder().setName(operationName).build(); do { Thread.sleep(500); Operation response = client.getOperation(request); if (response.getDone()) { switch (response.getResultCase()) { case RESPONSE: return; case ERROR: throw new RuntimeException("Cluster could not be resized: " + response.getError()); case RESULT_NOT_SET: throw new IllegalStateException( "System returned invalid response for Operation check: " + response); } } } while (System.currentTimeMillis() < endTimeMillis); throw new IllegalStateException( String.format("Waited %d seconds and cluster was not resized yet.", maxSeconds)); }
class class_name[name] begin[{] method[waitForOperation, return_type[void], modifier[public], parameter[operationName, maxSeconds]] begin[{] local_variable[type[long], endTimeMillis] local_variable[type[GetOperationRequest], request] do[binary_operation[call[System.currentTimeMillis, parameter[]], <, member[.endTimeMillis]]] begin[{] call[Thread.sleep, parameter[literal[500]]] local_variable[type[Operation], response] if[call[response.getDone, parameter[]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['RESPONSE'], statements=[ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=['ERROR'], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cluster could not be resized: "), operandr=MethodInvocation(arguments=[], member=getError, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)]), SwitchStatementCase(case=['RESULT_NOT_SET'], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="System returned invalid response for Operation check: "), operandr=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getResultCase, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Waited %d seconds and cluster was not resized yet."), MemberReference(member=maxSeconds, 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=IllegalStateException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[waitForOperation] operator[SEP] identifier[String] identifier[operationName] , Keyword[int] identifier[maxSeconds] operator[SEP] Keyword[throws] identifier[InterruptedException] { Keyword[long] identifier[endTimeMillis] operator[=] identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] identifier[toMillis] operator[SEP] identifier[maxSeconds] operator[SEP] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[GetOperationRequest] identifier[request] operator[=] identifier[GetOperationRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[operationName] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[do] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[500] operator[SEP] operator[SEP] identifier[Operation] identifier[response] operator[=] identifier[client] operator[SEP] identifier[getOperation] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[getDone] operator[SEP] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[response] operator[SEP] identifier[getResultCase] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[RESPONSE] operator[:] Keyword[return] operator[SEP] Keyword[case] identifier[ERROR] operator[:] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[response] operator[SEP] identifier[getError] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[RESULT_NOT_SET] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[response] operator[SEP] operator[SEP] } } } Keyword[while] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[<] identifier[endTimeMillis] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[maxSeconds] operator[SEP] operator[SEP] operator[SEP] }
@Override public void exportSchema(final String persistenceUnit, List<TableInfo> schemas) { super.exportSchema(persistenceUnit, schemas); }
class class_name[name] begin[{] method[exportSchema, return_type[void], modifier[public], parameter[persistenceUnit, schemas]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=persistenceUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schemas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exportSchema, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[exportSchema] operator[SEP] Keyword[final] identifier[String] identifier[persistenceUnit] , identifier[List] operator[<] identifier[TableInfo] operator[>] identifier[schemas] operator[SEP] { Keyword[super] operator[SEP] identifier[exportSchema] operator[SEP] identifier[persistenceUnit] , identifier[schemas] operator[SEP] operator[SEP] }
public Vector3f getAxesAnglesRad() { final double roll; final double pitch; double yaw; final double test = w * x - y * z; if (Math.abs(test) < 0.4999) { roll = TrigMath.atan2(2 * (w * z + x * y), 1 - 2 * (x * x + z * z)); pitch = TrigMath.asin(2 * test); yaw = TrigMath.atan2(2 * (w * y + z * x), 1 - 2 * (x * x + y * y)); } else { final int sign = (test < 0) ? -1 : 1; roll = 0; pitch = sign * Math.PI / 2; yaw = -sign * 2 * TrigMath.atan2(z, w); } return new Vector3f(pitch, yaw, roll); }
class class_name[name] begin[{] method[getAxesAnglesRad, return_type[type[Vector3f]], modifier[public], parameter[]] begin[{] local_variable[type[double], roll] local_variable[type[double], pitch] local_variable[type[double], yaw] local_variable[type[double], test] if[binary_operation[call[Math.abs, parameter[member[.test]]], <, literal[0.4999]]] begin[{] assign[member[.roll], call[TrigMath.atan2, parameter[binary_operation[literal[2], *, binary_operation[binary_operation[member[.w], *, member[.z]], +, binary_operation[member[.x], *, member[.y]]]], binary_operation[literal[1], -, binary_operation[literal[2], *, binary_operation[binary_operation[member[.x], *, member[.x]], +, binary_operation[member[.z], *, member[.z]]]]]]]] assign[member[.pitch], call[TrigMath.asin, parameter[binary_operation[literal[2], *, member[.test]]]]] assign[member[.yaw], call[TrigMath.atan2, parameter[binary_operation[literal[2], *, binary_operation[binary_operation[member[.w], *, member[.y]], +, binary_operation[member[.z], *, member[.x]]]], binary_operation[literal[1], -, binary_operation[literal[2], *, binary_operation[binary_operation[member[.x], *, member[.x]], +, binary_operation[member[.y], *, member[.y]]]]]]]] else begin[{] local_variable[type[int], sign] assign[member[.roll], literal[0]] assign[member[.pitch], binary_operation[binary_operation[member[.sign], *, member[Math.PI]], /, literal[2]]] assign[member[.yaw], binary_operation[binary_operation[member[.sign], *, literal[2]], *, call[TrigMath.atan2, parameter[member[.z], member[.w]]]]] end[}] return[ClassCreator(arguments=[MemberReference(member=pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=yaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=roll, 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=Vector3f, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Vector3f] identifier[getAxesAnglesRad] operator[SEP] operator[SEP] { Keyword[final] Keyword[double] identifier[roll] operator[SEP] Keyword[final] Keyword[double] identifier[pitch] operator[SEP] Keyword[double] identifier[yaw] operator[SEP] Keyword[final] Keyword[double] identifier[test] operator[=] identifier[w] operator[*] identifier[x] operator[-] identifier[y] operator[*] identifier[z] operator[SEP] Keyword[if] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[test] operator[SEP] operator[<] literal[Float] operator[SEP] { identifier[roll] operator[=] identifier[TrigMath] operator[SEP] identifier[atan2] operator[SEP] Other[2] operator[*] operator[SEP] identifier[w] operator[*] identifier[z] operator[+] identifier[x] operator[*] identifier[y] operator[SEP] , Other[1] operator[-] Other[2] operator[*] operator[SEP] identifier[x] operator[*] identifier[x] operator[+] identifier[z] operator[*] identifier[z] operator[SEP] operator[SEP] operator[SEP] identifier[pitch] operator[=] identifier[TrigMath] operator[SEP] identifier[asin] operator[SEP] Other[2] operator[*] identifier[test] operator[SEP] operator[SEP] identifier[yaw] operator[=] identifier[TrigMath] operator[SEP] identifier[atan2] operator[SEP] Other[2] operator[*] operator[SEP] identifier[w] operator[*] identifier[y] operator[+] identifier[z] operator[*] identifier[x] operator[SEP] , Other[1] operator[-] Other[2] operator[*] operator[SEP] identifier[x] operator[*] identifier[x] operator[+] identifier[y] operator[*] identifier[y] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] Keyword[int] identifier[sign] operator[=] operator[SEP] identifier[test] operator[<] Other[0] operator[SEP] operator[?] operator[-] Other[1] operator[:] Other[1] operator[SEP] identifier[roll] operator[=] Other[0] operator[SEP] identifier[pitch] operator[=] identifier[sign] operator[*] identifier[Math] operator[SEP] identifier[PI] operator[/] Other[2] operator[SEP] identifier[yaw] operator[=] operator[-] identifier[sign] operator[*] Other[2] operator[*] identifier[TrigMath] operator[SEP] identifier[atan2] operator[SEP] identifier[z] , identifier[w] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Vector3f] operator[SEP] identifier[pitch] , identifier[yaw] , identifier[roll] operator[SEP] operator[SEP] }
public String label(String label) { if (isNotInitialized()) { return getMessage(NOT_INITIALIZED); } try { return CmsJspTagLabel.wpLabelTagAction(label, getRequest()); } catch (Throwable t) { handleException(t); } CmsMessageContainer msgContainer = Messages.get().container(Messages.GUI_ERR_WORKPL_LABEL_READ_1, label); return getMessage(msgContainer); }
class class_name[name] begin[{] method[label, return_type[type[String]], modifier[public], parameter[label]] begin[{] if[call[.isNotInitialized, parameter[]]] begin[{] return[call[.getMessage, parameter[member[.NOT_INITIALIZED]]]] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=wpLabelTagAction, postfix_operators=[], prefix_operators=[], qualifier=CmsJspTagLabel, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) local_variable[type[CmsMessageContainer], msgContainer] return[call[.getMessage, parameter[member[.msgContainer]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[label] operator[SEP] identifier[String] identifier[label] operator[SEP] { Keyword[if] operator[SEP] identifier[isNotInitialized] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[getMessage] operator[SEP] identifier[NOT_INITIALIZED] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] identifier[CmsJspTagLabel] operator[SEP] identifier[wpLabelTagAction] operator[SEP] identifier[label] , identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[handleException] operator[SEP] identifier[t] operator[SEP] operator[SEP] } identifier[CmsMessageContainer] identifier[msgContainer] operator[=] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_ERR_WORKPL_LABEL_READ_1] , identifier[label] operator[SEP] operator[SEP] Keyword[return] identifier[getMessage] operator[SEP] identifier[msgContainer] operator[SEP] operator[SEP] }
public void setRegistryValueInGuest(VirtualMachine vm, GuestAuthentication auth, GuestRegValueSpec value) throws GuestComponentsOutOfDate, GuestOperationsFault, GuestOperationsUnavailable, GuestPermissionDenied, GuestRegistryKeyInvalid, InvalidGuestLogin, InvalidPowerState, InvalidState, OperationDisabledByGuest, OperationNotSupportedByGuest, RuntimeFault, TaskInProgress, RemoteException { getVimService().setRegistryValueInGuest(getMOR(), vm.getMOR(), auth, value); }
class class_name[name] begin[{] method[setRegistryValueInGuest, return_type[void], modifier[public], parameter[vm, auth, value]] begin[{] call[.getVimService, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setRegistryValueInGuest] operator[SEP] identifier[VirtualMachine] identifier[vm] , identifier[GuestAuthentication] identifier[auth] , identifier[GuestRegValueSpec] identifier[value] operator[SEP] Keyword[throws] identifier[GuestComponentsOutOfDate] , identifier[GuestOperationsFault] , identifier[GuestOperationsUnavailable] , identifier[GuestPermissionDenied] , identifier[GuestRegistryKeyInvalid] , identifier[InvalidGuestLogin] , identifier[InvalidPowerState] , identifier[InvalidState] , identifier[OperationDisabledByGuest] , identifier[OperationNotSupportedByGuest] , identifier[RuntimeFault] , identifier[TaskInProgress] , identifier[RemoteException] { identifier[getVimService] operator[SEP] operator[SEP] operator[SEP] identifier[setRegistryValueInGuest] operator[SEP] identifier[getMOR] operator[SEP] operator[SEP] , identifier[vm] operator[SEP] identifier[getMOR] operator[SEP] operator[SEP] , identifier[auth] , identifier[value] operator[SEP] operator[SEP] }
public static Number toNumber(Object value, Number defaultValue) { return convert(Number.class, value, defaultValue); }
class class_name[name] begin[{] method[toNumber, return_type[type[Number]], modifier[public static], parameter[value, defaultValue]] begin[{] return[call[.convert, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Number, sub_type=None)), member[.value], member[.defaultValue]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Number] identifier[toNumber] operator[SEP] identifier[Object] identifier[value] , identifier[Number] identifier[defaultValue] operator[SEP] { Keyword[return] identifier[convert] operator[SEP] identifier[Number] operator[SEP] Keyword[class] , identifier[value] , identifier[defaultValue] operator[SEP] operator[SEP] }
@Override public ModifyClusterSnapshotScheduleResult modifyClusterSnapshotSchedule(ModifyClusterSnapshotScheduleRequest request) { request = beforeClientExecution(request); return executeModifyClusterSnapshotSchedule(request); }
class class_name[name] begin[{] method[modifyClusterSnapshotSchedule, return_type[type[ModifyClusterSnapshotScheduleResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeModifyClusterSnapshotSchedule, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ModifyClusterSnapshotScheduleResult] identifier[modifyClusterSnapshotSchedule] operator[SEP] identifier[ModifyClusterSnapshotScheduleRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeModifyClusterSnapshotSchedule] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public GitlabProjectMember updateProjectMember(Integer projectId, Integer userId, GitlabAccessLevel accessLevel) throws IOException { return updateProjectMember(projectId, userId, accessLevel, null); }
class class_name[name] begin[{] method[updateProjectMember, return_type[type[GitlabProjectMember]], modifier[public], parameter[projectId, userId, accessLevel]] begin[{] return[call[.updateProjectMember, parameter[member[.projectId], member[.userId], member[.accessLevel], literal[null]]]] end[}] END[}]
Keyword[public] identifier[GitlabProjectMember] identifier[updateProjectMember] operator[SEP] identifier[Integer] identifier[projectId] , identifier[Integer] identifier[userId] , identifier[GitlabAccessLevel] identifier[accessLevel] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[updateProjectMember] operator[SEP] identifier[projectId] , identifier[userId] , identifier[accessLevel] , Other[null] operator[SEP] operator[SEP] }
public FessMessages addErrorsPropertyTypeInteger(String property, String arg0) { assertPropertyNotNull(property); add(property, new UserMessage(ERRORS_property_type_integer, arg0)); return this; }
class class_name[name] begin[{] method[addErrorsPropertyTypeInteger, return_type[type[FessMessages]], modifier[public], parameter[property, arg0]] begin[{] call[.assertPropertyNotNull, parameter[member[.property]]] call[.add, parameter[member[.property], ClassCreator(arguments=[MemberReference(member=ERRORS_property_type_integer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arg0, 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[addErrorsPropertyTypeInteger] operator[SEP] identifier[String] identifier[property] , identifier[String] identifier[arg0] 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_property_type_integer] , identifier[arg0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public List<UUID> spawn(int nbAgents, Class<? extends Agent> agent, Object... params) { return this.spawnService.spawn(nbAgents, null, this.janusContext, null, agent, params); }
class class_name[name] begin[{] method[spawn, return_type[type[List]], modifier[public], parameter[nbAgents, agent, params]] begin[{] return[THIS[member[None.spawnService]call[None.spawn, parameter[member[.nbAgents], literal[null], THIS[member[None.janusContext]], literal[null], member[.agent], member[.params]]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[UUID] operator[>] identifier[spawn] operator[SEP] Keyword[int] identifier[nbAgents] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Agent] operator[>] identifier[agent] , identifier[Object] operator[...] identifier[params] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[spawnService] operator[SEP] identifier[spawn] operator[SEP] identifier[nbAgents] , Other[null] , Keyword[this] operator[SEP] identifier[janusContext] , Other[null] , identifier[agent] , identifier[params] operator[SEP] operator[SEP] }
public List getSortedEntries() { Map grouped = new HashMap(); for (int i = 0; i < indexentry.size(); i++) { Entry e = (Entry) indexentry.get(i); String key = e.getKey(); Entry master = (Entry) grouped.get(key); if (master != null) { master.addPageNumberAndTag(e.getPageNumber(), e.getTag()); } else { e.addPageNumberAndTag(e.getPageNumber(), e.getTag()); grouped.put(key, e); } } // copy to a list and sort it List sorted = new ArrayList(grouped.values()); Collections.sort(sorted, comparator); return sorted; }
class class_name[name] begin[{] method[getSortedEntries, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[Map], grouped] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=indexentry, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=grouped, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), name=master)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=master, 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=[MethodInvocation(arguments=[], member=getPageNumber, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=addPageNumberAndTag, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=grouped, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPageNumber, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=addPageNumberAndTag, postfix_operators=[], prefix_operators=[], qualifier=master, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=indexentry, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[List], sorted] call[Collections.sort, parameter[member[.sorted], member[.comparator]]] return[member[.sorted]] end[}] END[}]
Keyword[public] identifier[List] identifier[getSortedEntries] operator[SEP] operator[SEP] { identifier[Map] identifier[grouped] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[indexentry] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Entry] identifier[e] operator[=] operator[SEP] identifier[Entry] operator[SEP] identifier[indexentry] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[key] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Entry] identifier[master] operator[=] operator[SEP] identifier[Entry] operator[SEP] identifier[grouped] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[master] operator[!=] Other[null] operator[SEP] { identifier[master] operator[SEP] identifier[addPageNumberAndTag] operator[SEP] identifier[e] operator[SEP] identifier[getPageNumber] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getTag] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[e] operator[SEP] identifier[addPageNumberAndTag] operator[SEP] identifier[e] operator[SEP] identifier[getPageNumber] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getTag] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[grouped] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[e] operator[SEP] operator[SEP] } } identifier[List] identifier[sorted] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] identifier[grouped] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[sorted] , identifier[comparator] operator[SEP] operator[SEP] Keyword[return] identifier[sorted] operator[SEP] }
public Observable<ServiceResponse<List<PrebuiltEntityExtractor>>> addPrebuiltWithServiceResponseAsync(UUID appId, String versionId, List<String> prebuiltExtractorNames) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (prebuiltExtractorNames == null) { throw new IllegalArgumentException("Parameter prebuiltExtractorNames is required and cannot be null."); } Validator.validate(prebuiltExtractorNames); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.addPrebuilt(appId, versionId, prebuiltExtractorNames, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<PrebuiltEntityExtractor>>>>() { @Override public Observable<ServiceResponse<List<PrebuiltEntityExtractor>>> call(Response<ResponseBody> response) { try { ServiceResponse<List<PrebuiltEntityExtractor>> clientResponse = addPrebuiltDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[addPrebuiltWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, prebuiltExtractorNames]] begin[{] if[binary_operation[THIS[member[None.client]call[None.endpoint, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.endpoint() 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[.appId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter appId 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[.versionId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter versionId 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[.prebuiltExtractorNames], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter prebuiltExtractorNames 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[.prebuiltExtractorNames]]] local_variable[type[String], parameterizedHost] return[call[service.addPrebuilt, parameter[member[.appId], member[.versionId], member[.prebuiltExtractorNames], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], member[.parameterizedHost], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[PrebuiltEntityExtractor] operator[>] operator[>] operator[>] identifier[addPrebuiltWithServiceResponseAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[List] operator[<] identifier[String] operator[>] identifier[prebuiltExtractorNames] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[endpoint] 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[appId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[versionId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[prebuiltExtractorNames] 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[prebuiltExtractorNames] operator[SEP] operator[SEP] identifier[String] identifier[parameterizedHost] operator[=] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[addPrebuilt] operator[SEP] identifier[appId] , identifier[versionId] , identifier[prebuiltExtractorNames] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , identifier[parameterizedHost] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[PrebuiltEntityExtractor] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[PrebuiltEntityExtractor] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[PrebuiltEntityExtractor] operator[>] operator[>] identifier[clientResponse] operator[=] identifier[addPrebuiltDelegate] 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 void delete() throws IOException { try { load(false); ensureLock(); m_cms.deleteResource(m_cms.getSitePath(m_resource), CmsResource.DELETE_PRESERVE_SIBLINGS); if (!m_resource.getState().isNew()) { try { m_cms.unlockResource(m_cms.getSitePath(m_resource)); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } } } catch (CmsException e) { throw CmsJlanDiskInterface.convertCmsException(e); } }
class class_name[name] begin[{] method[delete, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=load, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=ensureLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=m_resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), MemberReference(member=DELETE_PRESERVE_SIBLINGS, postfix_operators=[], prefix_operators=[], qualifier=CmsResource, selectors=[])], member=deleteResource, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=['!'], qualifier=m_resource, selectors=[MethodInvocation(arguments=[], member=isNew, 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=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=m_resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None)], member=unlockResource, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertCmsException, postfix_operators=[], prefix_operators=[], qualifier=CmsJlanDiskInterface, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[delete] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[load] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[ensureLock] operator[SEP] operator[SEP] operator[SEP] identifier[m_cms] operator[SEP] identifier[deleteResource] operator[SEP] identifier[m_cms] operator[SEP] identifier[getSitePath] operator[SEP] identifier[m_resource] operator[SEP] , identifier[CmsResource] operator[SEP] identifier[DELETE_PRESERVE_SIBLINGS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[m_resource] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] identifier[isNew] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[m_cms] operator[SEP] identifier[unlockResource] operator[SEP] identifier[m_cms] operator[SEP] identifier[getSitePath] operator[SEP] identifier[m_resource] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { Keyword[throw] identifier[CmsJlanDiskInterface] operator[SEP] identifier[convertCmsException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static <T> List<T> distinct(final T[] a, final int fromIndex, final int toIndex) { checkFromToIndex(fromIndex, toIndex, len(a)); if (N.isNullOrEmpty(a)) { return new ArrayList<>(); } final List<T> result = new ArrayList<>(); final Set<Object> set = new HashSet<>(); for (int i = fromIndex; i < toIndex; i++) { if (set.add(hashKey(a[i]))) { result.add(a[i]); } } return result; }
class class_name[name] begin[{] method[distinct, return_type[type[List]], modifier[public static], parameter[a, fromIndex, toIndex]] begin[{] call[.checkFromToIndex, parameter[member[.fromIndex], member[.toIndex], call[.len, parameter[member[.a]]]]] if[call[N.isNullOrEmpty, parameter[member[.a]]]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] local_variable[type[List], result] local_variable[type[Set], set] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=hashKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=toIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=fromIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[distinct] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[a] , Keyword[final] Keyword[int] identifier[fromIndex] , Keyword[final] Keyword[int] identifier[toIndex] operator[SEP] { identifier[checkFromToIndex] operator[SEP] identifier[fromIndex] , identifier[toIndex] , identifier[len] operator[SEP] identifier[a] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[N] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[a] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[List] operator[<] identifier[T] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Object] operator[>] identifier[set] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[fromIndex] operator[SEP] identifier[i] operator[<] identifier[toIndex] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[set] operator[SEP] identifier[add] operator[SEP] identifier[hashKey] operator[SEP] identifier[a] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[a] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public void clean(final FileSystemDatasetVersion versionToDelete, final Set<Path> possiblyEmptyDirectories) throws IOException { log.info("Deleting dataset version " + versionToDelete); Set<Path> pathsToDelete = versionToDelete.getPaths(); log.info("Deleting paths: " + Arrays.toString(pathsToDelete.toArray())); boolean deletedAllPaths = true; for (Path path : pathsToDelete) { if (!this.fs.exists(path)) { log.info(String.format("Path %s in dataset version %s does not exist", path, versionToDelete)); continue; } boolean successfullyDeleted = deleteAsOwner ? trash.moveToTrashAsOwner(path) : trash.moveToTrash(path); if (successfullyDeleted) { possiblyEmptyDirectories.add(path.getParent()); } else { log.error("Failed to delete path " + path + " in dataset version " + versionToDelete); deletedAllPaths = false; } } if (!deletedAllPaths) { log.error("Failed to delete some paths in dataset version " + versionToDelete); } }
class class_name[name] begin[{] method[clean, return_type[void], modifier[public], parameter[versionToDelete, possiblyEmptyDirectories]] begin[{] call[log.info, parameter[binary_operation[literal["Deleting dataset version "], +, member[.versionToDelete]]]] local_variable[type[Set], pathsToDelete] call[log.info, parameter[binary_operation[literal["Deleting paths: "], +, call[Arrays.toString, parameter[call[pathsToDelete.toArray, parameter[]]]]]]] local_variable[type[boolean], deletedAllPaths] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MemberReference(member=fs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Path %s in dataset version %s does not exist"), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=versionToDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MemberReference(member=deleteAsOwner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=moveToTrash, postfix_operators=[], prefix_operators=[], qualifier=trash, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=moveToTrashAsOwner, postfix_operators=[], prefix_operators=[], qualifier=trash, selectors=[], type_arguments=None)), name=successfullyDeleted)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=successfullyDeleted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to delete path "), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in dataset version "), operator=+), operandr=MemberReference(member=versionToDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=deletedAllPaths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=possiblyEmptyDirectories, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=pathsToDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))), label=None) if[member[.deletedAllPaths]] begin[{] call[log.error, parameter[binary_operation[literal["Failed to delete some paths in dataset version "], +, member[.versionToDelete]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[clean] operator[SEP] Keyword[final] identifier[FileSystemDatasetVersion] identifier[versionToDelete] , Keyword[final] identifier[Set] operator[<] identifier[Path] operator[>] identifier[possiblyEmptyDirectories] operator[SEP] Keyword[throws] identifier[IOException] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[versionToDelete] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Path] operator[>] identifier[pathsToDelete] operator[=] identifier[versionToDelete] operator[SEP] identifier[getPaths] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[pathsToDelete] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[deletedAllPaths] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Path] identifier[path] operator[:] identifier[pathsToDelete] operator[SEP] { Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[fs] operator[SEP] identifier[exists] operator[SEP] identifier[path] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[path] , identifier[versionToDelete] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[boolean] identifier[successfullyDeleted] operator[=] identifier[deleteAsOwner] operator[?] identifier[trash] operator[SEP] identifier[moveToTrashAsOwner] operator[SEP] identifier[path] operator[SEP] operator[:] identifier[trash] operator[SEP] identifier[moveToTrash] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[successfullyDeleted] operator[SEP] { identifier[possiblyEmptyDirectories] operator[SEP] identifier[add] operator[SEP] identifier[path] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[path] operator[+] literal[String] operator[+] identifier[versionToDelete] operator[SEP] operator[SEP] identifier[deletedAllPaths] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[deletedAllPaths] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[versionToDelete] operator[SEP] operator[SEP] } }
public static Page parsePageFromSource(final SecurityContext securityContext, final String source, final String name) throws FrameworkException { return parsePageFromSource(securityContext, source, name, false); }
class class_name[name] begin[{] method[parsePageFromSource, return_type[type[Page]], modifier[public static], parameter[securityContext, source, name]] begin[{] return[call[.parsePageFromSource, parameter[member[.securityContext], member[.source], member[.name], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Page] identifier[parsePageFromSource] operator[SEP] Keyword[final] identifier[SecurityContext] identifier[securityContext] , Keyword[final] identifier[String] identifier[source] , Keyword[final] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[FrameworkException] { Keyword[return] identifier[parsePageFromSource] operator[SEP] identifier[securityContext] , identifier[source] , identifier[name] , literal[boolean] operator[SEP] operator[SEP] }
@Override public String getString( final String key, final String defaultValue ) { String candidate; candidate = getFormattedPropValue( key ); if ( candidate == null ) { return defaultValue; } return candidate; }
class class_name[name] begin[{] method[getString, return_type[type[String]], modifier[public], parameter[key, defaultValue]] begin[{] local_variable[type[String], candidate] assign[member[.candidate], call[.getFormattedPropValue, parameter[member[.key]]]] if[binary_operation[member[.candidate], ==, literal[null]]] begin[{] return[member[.defaultValue]] else begin[{] None end[}] return[member[.candidate]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getString] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[String] identifier[defaultValue] operator[SEP] { identifier[String] identifier[candidate] operator[SEP] identifier[candidate] operator[=] identifier[getFormattedPropValue] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[candidate] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[defaultValue] operator[SEP] } Keyword[return] identifier[candidate] operator[SEP] }
public Observable<ProtectionContainerResourceInner> registerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, ProtectionContainerResourceInner parameters) { return registerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).map(new Func1<ServiceResponse<ProtectionContainerResourceInner>, ProtectionContainerResourceInner>() { @Override public ProtectionContainerResourceInner call(ServiceResponse<ProtectionContainerResourceInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[registerAsync, return_type[type[Observable]], modifier[public], parameter[vaultName, resourceGroupName, fabricName, containerName, parameters]] begin[{] return[call[.registerWithServiceResponseAsync, parameter[member[.vaultName], member[.resourceGroupName], member[.fabricName], member[.containerName], member[.parameters]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ProtectionContainerResourceInner] operator[>] identifier[registerAsync] operator[SEP] identifier[String] identifier[vaultName] , identifier[String] identifier[resourceGroupName] , identifier[String] identifier[fabricName] , identifier[String] identifier[containerName] , identifier[ProtectionContainerResourceInner] identifier[parameters] operator[SEP] { Keyword[return] identifier[registerWithServiceResponseAsync] operator[SEP] identifier[vaultName] , identifier[resourceGroupName] , identifier[fabricName] , identifier[containerName] , identifier[parameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[ProtectionContainerResourceInner] operator[>] , identifier[ProtectionContainerResourceInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[ProtectionContainerResourceInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[ProtectionContainerResourceInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public final void push(int value) { int ff = m_firstFree; if ((ff + 1) >= m_mapSize) { if (null == m_map) { m_map = new int[m_blocksize]; m_mapSize = m_blocksize; } else { m_mapSize += m_blocksize; int newMap[] = new int[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, ff + 1); m_map = newMap; } } m_map[ff] = value; ff++; m_firstFree = ff; }
class class_name[name] begin[{] method[push, return_type[void], modifier[final public], parameter[value]] begin[{] local_variable[type[int], ff] if[binary_operation[binary_operation[member[.ff], +, literal[1]], >=, member[.m_mapSize]]] begin[{] if[binary_operation[literal[null], ==, member[.m_map]]] begin[{] assign[member[.m_map], ArrayCreator(dimensions=[MemberReference(member=m_blocksize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] assign[member[.m_mapSize], member[.m_blocksize]] else begin[{] assign[member[.m_mapSize], member[.m_blocksize]] local_variable[type[int], newMap] call[System.arraycopy, parameter[member[.m_map], literal[0], member[.newMap], literal[0], binary_operation[member[.ff], +, literal[1]]]] assign[member[.m_map], member[.newMap]] end[}] else begin[{] None end[}] assign[member[.m_map], member[.value]] member[.ff] assign[member[.m_firstFree], member[.ff]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[push] operator[SEP] Keyword[int] identifier[value] operator[SEP] { Keyword[int] identifier[ff] operator[=] identifier[m_firstFree] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[ff] operator[+] Other[1] operator[SEP] operator[>=] identifier[m_mapSize] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[m_map] operator[SEP] { identifier[m_map] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[m_blocksize] operator[SEP] operator[SEP] identifier[m_mapSize] operator[=] identifier[m_blocksize] operator[SEP] } Keyword[else] { identifier[m_mapSize] operator[+=] identifier[m_blocksize] operator[SEP] Keyword[int] identifier[newMap] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[m_mapSize] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[m_map] , Other[0] , identifier[newMap] , Other[0] , identifier[ff] operator[+] Other[1] operator[SEP] operator[SEP] identifier[m_map] operator[=] identifier[newMap] operator[SEP] } } identifier[m_map] operator[SEP] identifier[ff] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[ff] operator[++] operator[SEP] identifier[m_firstFree] operator[=] identifier[ff] operator[SEP] }
public static Value makeJcrValue(Node node, int type, Object object, MappingRules mapping) throws PropertyValueFormatException, RepositoryException { Session session = node.getSession(); ValueFactory factory = session.getValueFactory(); Value value = null; if (object != null) { switch (type) { case PropertyType.BINARY: if (mapping.propertyFormat.binary != MappingRules.PropertyFormat.Binary.skip) { InputStream input = null; if (object instanceof InputStream) { input = (InputStream) object; } else if (object instanceof String) { if (mapping.propertyFormat.binary == MappingRules.PropertyFormat.Binary.base64) { byte[] decoded = Base64.decodeBase64((String) object); input = new ByteArrayInputStream(decoded); } } if (input != null) { Binary binary = factory.createBinary(input); value = factory.createValue(binary); } } break; case PropertyType.BOOLEAN: value = factory.createValue(object instanceof Boolean ? (Boolean) object : Boolean.parseBoolean(object.toString())); break; case PropertyType.DATE: Date date = object instanceof Date ? (Date) object : null; if (date == null) { String string = object.toString(); date = mapping.dateParser.parse(string); } if (date != null) { GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date); value = factory.createValue(cal); } else { throw new PropertyValueFormatException("invalid date/time value: " + object); } break; case PropertyType.DECIMAL: value = factory.createValue(object instanceof BigDecimal ? (BigDecimal) object : new BigDecimal(object.toString())); break; case PropertyType.DOUBLE: value = factory.createValue(object instanceof Double ? (Double) object : Double.parseDouble(object.toString())); break; case PropertyType.LONG: value = factory.createValue(object instanceof Long ? (Long) object : Long.parseLong(object.toString())); break; case PropertyType.REFERENCE: case PropertyType.WEAKREFERENCE: final Node refNode = session.getNodeByIdentifier(object.toString()); final String identifier = refNode.getIdentifier(); value = factory.createValue(identifier, type); break; case PropertyType.NAME: case PropertyType.PATH: case PropertyType.STRING: case PropertyType.URI: value = factory.createValue(object.toString(), type); break; case PropertyType.UNDEFINED: break; } } return value; }
class class_name[name] begin[{] method[makeJcrValue, return_type[type[Value]], modifier[public static], parameter[node, type, object, mapping]] begin[{] local_variable[type[Session], session] local_variable[type[ValueFactory], factory] local_variable[type[Value], value] if[binary_operation[member[.object], !=, literal[null]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BINARY, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=binary, postfix_operators=[], prefix_operators=[], qualifier=mapping.propertyFormat, selectors=[]), operandr=MemberReference(member=skip, postfix_operators=[], prefix_operators=[], qualifier=MappingRules.PropertyFormat.Binary, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=input)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=binary, postfix_operators=[], prefix_operators=[], qualifier=mapping.propertyFormat, selectors=[]), operandr=MemberReference(member=base64, postfix_operators=[], prefix_operators=[], qualifier=MappingRules.PropertyFormat.Binary, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=decodeBase64, postfix_operators=[], prefix_operators=[], qualifier=Base64, selectors=[], type_arguments=None), name=decoded)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=decoded, 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))), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=input, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createBinary, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=binary)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Binary, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=binary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None)]))])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), operator=instanceof), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=parseBoolean, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)))], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None), operator=instanceof), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None))), name=date)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=date, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), name=string)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=mapping.dateParser, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid date/time value: "), operandr=MemberReference(member=object, 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=PropertyValueFormatException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GregorianCalendar, sub_type=None)), name=cal)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GregorianCalendar, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=DECIMAL, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None), operator=instanceof), if_false=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None)), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None)))], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None), operator=instanceof), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=parseDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)))], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=LONG, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None), operator=instanceof), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)))], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[]), MemberReference(member=WEAKREFERENCE, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=getNodeByIdentifier, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=refNode)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=refNode, selectors=[], type_arguments=None), name=identifier)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=identifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[]), MemberReference(member=PATH, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[]), MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[]), MemberReference(member=URI, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createValue, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=UNDEFINED, postfix_operators=[], prefix_operators=[], qualifier=PropertyType, selectors=[])], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] return[member[.value]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Value] identifier[makeJcrValue] operator[SEP] identifier[Node] identifier[node] , Keyword[int] identifier[type] , identifier[Object] identifier[object] , identifier[MappingRules] identifier[mapping] operator[SEP] Keyword[throws] identifier[PropertyValueFormatException] , identifier[RepositoryException] { identifier[Session] identifier[session] operator[=] identifier[node] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[ValueFactory] identifier[factory] operator[=] identifier[session] operator[SEP] identifier[getValueFactory] operator[SEP] operator[SEP] operator[SEP] identifier[Value] identifier[value] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[object] operator[!=] Other[null] operator[SEP] { Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[PropertyType] operator[SEP] identifier[BINARY] operator[:] Keyword[if] operator[SEP] identifier[mapping] operator[SEP] identifier[propertyFormat] operator[SEP] identifier[binary] operator[!=] identifier[MappingRules] operator[SEP] identifier[PropertyFormat] operator[SEP] identifier[Binary] operator[SEP] identifier[skip] operator[SEP] { identifier[InputStream] identifier[input] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[InputStream] operator[SEP] { identifier[input] operator[=] operator[SEP] identifier[InputStream] operator[SEP] identifier[object] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[String] operator[SEP] { Keyword[if] operator[SEP] identifier[mapping] operator[SEP] identifier[propertyFormat] operator[SEP] identifier[binary] operator[==] identifier[MappingRules] operator[SEP] identifier[PropertyFormat] operator[SEP] identifier[Binary] operator[SEP] identifier[base64] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[decoded] operator[=] identifier[Base64] operator[SEP] identifier[decodeBase64] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[input] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[decoded] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[input] operator[!=] Other[null] operator[SEP] { identifier[Binary] identifier[binary] operator[=] identifier[factory] operator[SEP] identifier[createBinary] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[binary] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[BOOLEAN] operator[:] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[object] Keyword[instanceof] identifier[Boolean] operator[?] operator[SEP] identifier[Boolean] operator[SEP] identifier[object] operator[:] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[DATE] operator[:] identifier[Date] identifier[date] operator[=] identifier[object] Keyword[instanceof] identifier[Date] operator[?] operator[SEP] identifier[Date] operator[SEP] identifier[object] operator[:] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[date] operator[==] Other[null] operator[SEP] { identifier[String] identifier[string] operator[=] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[date] operator[=] identifier[mapping] operator[SEP] identifier[dateParser] operator[SEP] identifier[parse] operator[SEP] identifier[string] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[date] operator[!=] Other[null] operator[SEP] { identifier[GregorianCalendar] identifier[cal] operator[=] Keyword[new] identifier[GregorianCalendar] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[cal] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[PropertyValueFormatException] operator[SEP] literal[String] operator[+] identifier[object] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[DECIMAL] operator[:] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[object] Keyword[instanceof] identifier[BigDecimal] operator[?] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[object] operator[:] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[DOUBLE] operator[:] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[object] Keyword[instanceof] identifier[Double] operator[?] operator[SEP] identifier[Double] operator[SEP] identifier[object] operator[:] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[LONG] operator[:] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[object] Keyword[instanceof] identifier[Long] operator[?] operator[SEP] identifier[Long] operator[SEP] identifier[object] operator[:] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[REFERENCE] operator[:] Keyword[case] identifier[PropertyType] operator[SEP] identifier[WEAKREFERENCE] operator[:] Keyword[final] identifier[Node] identifier[refNode] operator[=] identifier[session] operator[SEP] identifier[getNodeByIdentifier] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[identifier] operator[=] identifier[refNode] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[identifier] , identifier[type] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[NAME] operator[:] Keyword[case] identifier[PropertyType] operator[SEP] identifier[PATH] operator[:] Keyword[case] identifier[PropertyType] operator[SEP] identifier[STRING] operator[:] Keyword[case] identifier[PropertyType] operator[SEP] identifier[URI] operator[:] identifier[value] operator[=] identifier[factory] operator[SEP] identifier[createValue] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[type] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PropertyType] operator[SEP] identifier[UNDEFINED] operator[:] Keyword[break] operator[SEP] } } Keyword[return] identifier[value] operator[SEP] }
@SuppressWarnings({ "resource" }) public static void showClasspath() { final String cp = getCurrentClasspath(); if (!Strings.isNullOrEmpty(cp)) { final PrintStream ps = getConsoleLogger(); for (final String entry : cp.split(Pattern.quote(File.pathSeparator))) { ps.println(entry); } ps.flush(); } getExiter().exit(); }
class class_name[name] begin[{] method[showClasspath, return_type[void], modifier[public static], parameter[]] begin[{] local_variable[type[String], cp] if[call[Strings.isNullOrEmpty, parameter[member[.cp]]]] begin[{] local_variable[type[PrintStream], ps] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pathSeparator, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[])], member=quote, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None)], member=split, postfix_operators=[], prefix_operators=[], qualifier=cp, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[ps.flush, parameter[]] else begin[{] None end[}] call[.getExiter, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] } operator[SEP] Keyword[public] Keyword[static] Keyword[void] identifier[showClasspath] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[cp] operator[=] identifier[getCurrentClasspath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[cp] operator[SEP] operator[SEP] { Keyword[final] identifier[PrintStream] identifier[ps] operator[=] identifier[getConsoleLogger] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[entry] operator[:] identifier[cp] operator[SEP] identifier[split] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[File] operator[SEP] identifier[pathSeparator] operator[SEP] operator[SEP] operator[SEP] { identifier[ps] operator[SEP] identifier[println] operator[SEP] identifier[entry] operator[SEP] operator[SEP] } identifier[ps] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } identifier[getExiter] operator[SEP] operator[SEP] operator[SEP] identifier[exit] operator[SEP] operator[SEP] operator[SEP] }
public static Set<ResourceType> complementOf(final Set<ResourceType> resourceTypes) { final Set<ResourceType> set = allOf(); set.removeAll(resourceTypes); return set; }
class class_name[name] begin[{] method[complementOf, return_type[type[Set]], modifier[public static], parameter[resourceTypes]] begin[{] local_variable[type[Set], set] call[set.removeAll, parameter[member[.resourceTypes]]] return[member[.set]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[ResourceType] operator[>] identifier[complementOf] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[ResourceType] operator[>] identifier[resourceTypes] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[ResourceType] operator[>] identifier[set] operator[=] identifier[allOf] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[removeAll] operator[SEP] identifier[resourceTypes] operator[SEP] operator[SEP] Keyword[return] identifier[set] operator[SEP] }
public static long getDurationFromPeriod(Every every) { if (!Strings.isNullOrEmpty(every.value())) { return toDuration(PERIOD_FORMATTER.parsePeriod(every.value())); } return -1; }
class class_name[name] begin[{] method[getDurationFromPeriod, return_type[type[long]], modifier[public static], parameter[every]] begin[{] if[call[Strings.isNullOrEmpty, parameter[call[every.value, parameter[]]]]] begin[{] return[call[.toDuration, parameter[call[PERIOD_FORMATTER.parsePeriod, parameter[call[every.value, parameter[]]]]]]] else begin[{] None end[}] return[literal[1]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[getDurationFromPeriod] operator[SEP] identifier[Every] identifier[every] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[every] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[toDuration] operator[SEP] identifier[PERIOD_FORMATTER] operator[SEP] identifier[parsePeriod] operator[SEP] identifier[every] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
public static double getRobustTreeEditDistance(String dom1, String dom2) { LblTree domTree1 = null, domTree2 = null; try { domTree1 = getDomTree(dom1); domTree2 = getDomTree(dom2); } catch (IOException e) { e.printStackTrace(); } double DD = 0.0; RTED_InfoTree_Opt rted; double ted; rted = new RTED_InfoTree_Opt(1, 1, 1); // compute tree edit distance rted.init(domTree1, domTree2); int maxSize = Math.max(domTree1.getNodeCount(), domTree2.getNodeCount()); rted.computeOptimalStrategy(); ted = rted.nonNormalizedTreeDist(); ted /= (double) maxSize; DD = ted; return DD; }
class class_name[name] begin[{] method[getRobustTreeEditDistance, return_type[type[double]], modifier[public static], parameter[dom1, dom2]] begin[{] local_variable[type[LblTree], domTree1] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=domTree1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dom1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDomTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=domTree2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dom2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDomTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], 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=['IOException']))], finally_block=None, label=None, resources=None) local_variable[type[double], DD] local_variable[type[RTED_InfoTree_Opt], rted] local_variable[type[double], ted] assign[member[.rted], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RTED_InfoTree_Opt, sub_type=None))] call[rted.init, parameter[member[.domTree1], member[.domTree2]]] local_variable[type[int], maxSize] call[rted.computeOptimalStrategy, parameter[]] assign[member[.ted], call[rted.nonNormalizedTreeDist, parameter[]]] assign[member[.ted], Cast(expression=MemberReference(member=maxSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double))] assign[member[.DD], member[.ted]] return[member[.DD]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[getRobustTreeEditDistance] operator[SEP] identifier[String] identifier[dom1] , identifier[String] identifier[dom2] operator[SEP] { identifier[LblTree] identifier[domTree1] operator[=] Other[null] , identifier[domTree2] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[domTree1] operator[=] identifier[getDomTree] operator[SEP] identifier[dom1] operator[SEP] operator[SEP] identifier[domTree2] operator[=] identifier[getDomTree] operator[SEP] identifier[dom2] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[double] identifier[DD] operator[=] literal[Float] operator[SEP] identifier[RTED_InfoTree_Opt] identifier[rted] operator[SEP] Keyword[double] identifier[ted] operator[SEP] identifier[rted] operator[=] Keyword[new] identifier[RTED_InfoTree_Opt] operator[SEP] Other[1] , Other[1] , Other[1] operator[SEP] operator[SEP] identifier[rted] operator[SEP] identifier[init] operator[SEP] identifier[domTree1] , identifier[domTree2] operator[SEP] operator[SEP] Keyword[int] identifier[maxSize] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[domTree1] operator[SEP] identifier[getNodeCount] operator[SEP] operator[SEP] , identifier[domTree2] operator[SEP] identifier[getNodeCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rted] operator[SEP] identifier[computeOptimalStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[ted] operator[=] identifier[rted] operator[SEP] identifier[nonNormalizedTreeDist] operator[SEP] operator[SEP] operator[SEP] identifier[ted] operator[/=] operator[SEP] Keyword[double] operator[SEP] identifier[maxSize] operator[SEP] identifier[DD] operator[=] identifier[ted] operator[SEP] Keyword[return] identifier[DD] operator[SEP] }
public ShippingAddress getShippingAddress(final String accountCode, final long shippingAddressId) { return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE + "/" + shippingAddressId, ShippingAddress.class); }
class class_name[name] begin[{] method[getShippingAddress, return_type[type[ShippingAddress]], modifier[public], parameter[accountCode, shippingAddressId]] begin[{] return[call[.doGET, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[Accounts.ACCOUNTS_RESOURCE], +, literal["/"]], +, member[.accountCode]], +, member[ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE]], +, literal["/"]], +, member[.shippingAddressId]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShippingAddress, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[ShippingAddress] identifier[getShippingAddress] operator[SEP] Keyword[final] identifier[String] identifier[accountCode] , Keyword[final] Keyword[long] identifier[shippingAddressId] operator[SEP] { Keyword[return] identifier[doGET] operator[SEP] identifier[Accounts] operator[SEP] identifier[ACCOUNTS_RESOURCE] operator[+] literal[String] operator[+] identifier[accountCode] operator[+] identifier[ShippingAddresses] operator[SEP] identifier[SHIPPING_ADDRESSES_RESOURCE] operator[+] literal[String] operator[+] identifier[shippingAddressId] , identifier[ShippingAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static <T> T[] subArray(final T[] array, final int start, final int end) { if (isEmpty(array) || start < 0 || start > end || end >= array.length) { return array; } @SuppressWarnings("unchecked") Class<T> componentClass = (Class<T>) ClassUtils.getComponentClass(array); int newArraySize = end - start + 1; T[] newArray = buildArray(componentClass, newArraySize, null); System.arraycopy(array, start, newArray, 0, newArraySize); return newArray; }
class class_name[name] begin[{] method[subArray, return_type[type[T]], modifier[public static], parameter[array, start, end]] begin[{] if[binary_operation[binary_operation[binary_operation[call[.isEmpty, parameter[member[.array]]], ||, binary_operation[member[.start], <, literal[0]]], ||, binary_operation[member[.start], >, member[.end]]], ||, binary_operation[member[.end], >=, member[array.length]]]] begin[{] return[member[.array]] else begin[{] None end[}] local_variable[type[Class], componentClass] local_variable[type[int], newArraySize] local_variable[type[T], newArray] call[System.arraycopy, parameter[member[.array], member[.start], member[.newArray], literal[0], member[.newArraySize]]] return[member[.newArray]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[subArray] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[array] , Keyword[final] Keyword[int] identifier[start] , Keyword[final] Keyword[int] identifier[end] operator[SEP] { Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[array] operator[SEP] operator[||] identifier[start] operator[<] Other[0] operator[||] identifier[start] operator[>] identifier[end] operator[||] identifier[end] operator[>=] identifier[array] operator[SEP] identifier[length] operator[SEP] { Keyword[return] identifier[array] operator[SEP] } annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[componentClass] operator[=] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] operator[SEP] identifier[ClassUtils] operator[SEP] identifier[getComponentClass] operator[SEP] identifier[array] operator[SEP] operator[SEP] Keyword[int] identifier[newArraySize] operator[=] identifier[end] operator[-] identifier[start] operator[+] Other[1] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[newArray] operator[=] identifier[buildArray] operator[SEP] identifier[componentClass] , identifier[newArraySize] , Other[null] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[array] , identifier[start] , identifier[newArray] , Other[0] , identifier[newArraySize] operator[SEP] operator[SEP] Keyword[return] identifier[newArray] operator[SEP] }
private ScanResult openClasspathElementsThenScan() throws InterruptedException, ExecutionException { // Get order of elements in traditional classpath final List<ClasspathEntryWorkUnit> rawClasspathEntryWorkUnits = new ArrayList<>(); for (final Entry<String, ClassLoader> rawClasspathEntry : classpathFinder.getClasspathOrder().getOrder()) { rawClasspathEntryWorkUnits .add(new ClasspathEntryWorkUnit(rawClasspathEntry, /* parentClasspathElement = */ null, /* orderWithinParentClasspathElement = */ rawClasspathEntryWorkUnits.size())); } // In parallel, create a ClasspathElement singleton for each classpath element, then call open() // on each ClasspathElement object, which in the case of jarfiles will cause LogicalZipFile instances // to be created for each (possibly nested) jarfile, then will read the manifest file and zip entries. final Set<ClasspathElement> openedClasspathEltsSet = Collections .newSetFromMap(new ConcurrentHashMap<ClasspathElement, Boolean>()); final Queue<Entry<Integer, ClasspathElement>> toplevelClasspathEltOrder = new ConcurrentLinkedQueue<>(); processWorkUnits(rawClasspathEntryWorkUnits, topLevelLog == null ? null : topLevelLog.log("Opening classpath elements"), newClasspathEntryWorkUnitProcessor(openedClasspathEltsSet, toplevelClasspathEltOrder)); // Determine total ordering of classpath elements, inserting jars referenced in manifest Class-Path // entries in-place into the ordering, if they haven't been listed earlier in the classpath already. final List<ClasspathElement> classpathEltOrder = findClasspathOrder(openedClasspathEltsSet, toplevelClasspathEltOrder); // Find classpath elements that are path prefixes of other classpath elements, and for // ClasspathElementZip, get module-related manifest entry values preprocessClasspathElementsByType(classpathEltOrder, topLevelLog == null ? null : topLevelLog.log("Finding nested classpath elements")); // Order modules before classpath elements from traditional classpath final LogNode classpathOrderLog = topLevelLog == null ? null : topLevelLog.log("Final classpath element order:"); final int numElts = moduleClasspathEltOrder.size() + classpathEltOrder.size(); final List<ClasspathElement> finalClasspathEltOrder = new ArrayList<>(numElts); final List<String> finalClasspathEltOrderStrs = new ArrayList<>(numElts); for (final ClasspathElementModule classpathElt : moduleClasspathEltOrder) { finalClasspathEltOrder.add(classpathElt); finalClasspathEltOrderStrs.add(classpathElt.toString()); if (classpathOrderLog != null) { final ModuleRef moduleRef = classpathElt.getModuleRef(); classpathOrderLog.log(moduleRef.toString()); } } for (final ClasspathElement classpathElt : classpathEltOrder) { finalClasspathEltOrder.add(classpathElt); finalClasspathEltOrderStrs.add(classpathElt.toString()); if (classpathOrderLog != null) { classpathOrderLog.log(classpathElt.toString()); } } // In parallel, scan paths within each classpath element, comparing them against whitelist/blacklist processWorkUnits(finalClasspathEltOrder, topLevelLog == null ? null : topLevelLog.log("Scanning classpath elements"), new WorkUnitProcessor<ClasspathElement>() { @Override public void processWorkUnit(final ClasspathElement classpathElement, final WorkQueue<ClasspathElement> workQueueIgnored, final LogNode pathScanLog) throws InterruptedException { // Scan the paths within the classpath element classpathElement.scanPaths(pathScanLog); } }); // Filter out classpath elements that do not contain required whitelisted paths. List<ClasspathElement> finalClasspathEltOrderFiltered = finalClasspathEltOrder; if (!scanSpec.classpathElementResourcePathWhiteBlackList.whitelistIsEmpty()) { finalClasspathEltOrderFiltered = new ArrayList<>(finalClasspathEltOrder.size()); for (final ClasspathElement classpathElement : finalClasspathEltOrder) { if (classpathElement.containsSpecificallyWhitelistedClasspathElementResourcePath) { finalClasspathEltOrderFiltered.add(classpathElement); } } } if (scanSpec.performScan) { // Scan classpath / modules, producing a ScanResult. return performScan(finalClasspathEltOrderFiltered, finalClasspathEltOrderStrs, classLoaderOrderRespectingParentDelegation); } else { // Only getting classpath -- return a placeholder ScanResult to hold classpath elements if (topLevelLog != null) { topLevelLog.log("Only returning classpath elements (not performing a scan)"); } return new ScanResult(scanSpec, finalClasspathEltOrderFiltered, finalClasspathEltOrderStrs, classLoaderOrderRespectingParentDelegation, /* classNameToClassInfo = */ null, /* packageNameToPackageInfo = */ null, /* moduleNameToModuleInfo = */ null, /* fileToLastModified = */ null, nestedJarHandler, topLevelLog); } }
class class_name[name] begin[{] method[openClasspathElementsThenScan, return_type[type[ScanResult]], modifier[private], parameter[]] begin[{] local_variable[type[List], rawClasspathEntryWorkUnits] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=rawClasspathEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rawClasspathEntryWorkUnits, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClasspathEntryWorkUnit, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rawClasspathEntryWorkUnits, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClasspathOrder, postfix_operators=[], prefix_operators=[], qualifier=classpathFinder, selectors=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rawClasspathEntry)], modifiers={'final'}, 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=ClassLoader, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) local_variable[type[Set], openedClasspathEltsSet] local_variable[type[Queue], toplevelClasspathEltOrder] call[.processWorkUnits, parameter[member[.rawClasspathEntryWorkUnits], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=topLevelLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Opening classpath elements")], member=log, postfix_operators=[], prefix_operators=[], qualifier=topLevelLog, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), call[.newClasspathEntryWorkUnitProcessor, parameter[member[.openedClasspathEltsSet], member[.toplevelClasspathEltOrder]]]]] local_variable[type[List], classpathEltOrder] call[.preprocessClasspathElementsByType, parameter[member[.classpathEltOrder], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=topLevelLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Finding nested classpath elements")], member=log, postfix_operators=[], prefix_operators=[], qualifier=topLevelLog, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]] local_variable[type[LogNode], classpathOrderLog] local_variable[type[int], numElts] local_variable[type[List], finalClasspathEltOrder] local_variable[type[List], finalClasspathEltOrderStrs] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=classpathElt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=finalClasspathEltOrder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=classpathElt, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=finalClasspathEltOrderStrs, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=classpathOrderLog, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getModuleRef, postfix_operators=[], prefix_operators=[], qualifier=classpathElt, selectors=[], type_arguments=None), name=moduleRef)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ModuleRef, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=moduleRef, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=classpathOrderLog, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=moduleClasspathEltOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classpathElt)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ClasspathElementModule, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=classpathElt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=finalClasspathEltOrder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=classpathElt, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=finalClasspathEltOrderStrs, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=classpathOrderLog, 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=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=classpathElt, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=classpathOrderLog, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=classpathEltOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classpathElt)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ClasspathElement, sub_type=None))), label=None) call[.processWorkUnits, parameter[member[.finalClasspathEltOrder], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=topLevelLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Scanning classpath elements")], member=log, postfix_operators=[], prefix_operators=[], qualifier=topLevelLog, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pathScanLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scanPaths, postfix_operators=[], prefix_operators=[], qualifier=classpathElement, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=processWorkUnit, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=classpathElement, type=ReferenceType(arguments=None, dimensions=[], name=ClasspathElement, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=workQueueIgnored, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClasspathElement, sub_type=None))], dimensions=[], name=WorkQueue, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=pathScanLog, type=ReferenceType(arguments=None, dimensions=[], name=LogNode, sub_type=None), varargs=False)], return_type=None, throws=['InterruptedException'], 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=ClasspathElement, sub_type=None))], dimensions=None, name=WorkUnitProcessor, sub_type=None))]] local_variable[type[List], finalClasspathEltOrderFiltered] if[call[scanSpec.classpathElementResourcePathWhiteBlackList.whitelistIsEmpty, parameter[]]] begin[{] assign[member[.finalClasspathEltOrderFiltered], ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=finalClasspathEltOrder, 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))] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=containsSpecificallyWhitelistedClasspathElementResourcePath, postfix_operators=[], prefix_operators=[], qualifier=classpathElement, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=classpathElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=finalClasspathEltOrderFiltered, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=finalClasspathEltOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classpathElement)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ClasspathElement, sub_type=None))), label=None) else begin[{] None end[}] if[member[scanSpec.performScan]] begin[{] return[call[.performScan, parameter[member[.finalClasspathEltOrderFiltered], member[.finalClasspathEltOrderStrs], member[.classLoaderOrderRespectingParentDelegation]]]] else begin[{] if[binary_operation[member[.topLevelLog], !=, literal[null]]] begin[{] call[topLevelLog.log, parameter[literal["Only returning classpath elements (not performing a scan)"]]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=scanSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finalClasspathEltOrderFiltered, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finalClasspathEltOrderStrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classLoaderOrderRespectingParentDelegation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=nestedJarHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topLevelLog, 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=ScanResult, sub_type=None))] end[}] end[}] END[}]
Keyword[private] identifier[ScanResult] identifier[openClasspathElementsThenScan] operator[SEP] operator[SEP] Keyword[throws] identifier[InterruptedException] , identifier[ExecutionException] { Keyword[final] identifier[List] operator[<] identifier[ClasspathEntryWorkUnit] operator[>] identifier[rawClasspathEntryWorkUnits] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Entry] operator[<] identifier[String] , identifier[ClassLoader] operator[>] identifier[rawClasspathEntry] operator[:] identifier[classpathFinder] operator[SEP] identifier[getClasspathOrder] operator[SEP] operator[SEP] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] { identifier[rawClasspathEntryWorkUnits] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ClasspathEntryWorkUnit] operator[SEP] identifier[rawClasspathEntry] , Other[null] , identifier[rawClasspathEntryWorkUnits] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[Set] operator[<] identifier[ClasspathElement] operator[>] identifier[openedClasspathEltsSet] operator[=] identifier[Collections] operator[SEP] identifier[newSetFromMap] operator[SEP] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[ClasspathElement] , identifier[Boolean] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Queue] operator[<] identifier[Entry] operator[<] identifier[Integer] , identifier[ClasspathElement] operator[>] operator[>] identifier[toplevelClasspathEltOrder] operator[=] Keyword[new] identifier[ConcurrentLinkedQueue] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[processWorkUnits] operator[SEP] identifier[rawClasspathEntryWorkUnits] , identifier[topLevelLog] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[topLevelLog] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] , identifier[newClasspathEntryWorkUnitProcessor] operator[SEP] identifier[openedClasspathEltsSet] , identifier[toplevelClasspathEltOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ClasspathElement] operator[>] identifier[classpathEltOrder] operator[=] identifier[findClasspathOrder] operator[SEP] identifier[openedClasspathEltsSet] , identifier[toplevelClasspathEltOrder] operator[SEP] operator[SEP] identifier[preprocessClasspathElementsByType] operator[SEP] identifier[classpathEltOrder] , identifier[topLevelLog] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[topLevelLog] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[LogNode] identifier[classpathOrderLog] operator[=] identifier[topLevelLog] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[topLevelLog] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[numElts] operator[=] identifier[moduleClasspathEltOrder] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] identifier[classpathEltOrder] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ClasspathElement] operator[>] identifier[finalClasspathEltOrder] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[numElts] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[finalClasspathEltOrderStrs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[numElts] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ClasspathElementModule] identifier[classpathElt] operator[:] identifier[moduleClasspathEltOrder] operator[SEP] { identifier[finalClasspathEltOrder] operator[SEP] identifier[add] operator[SEP] identifier[classpathElt] operator[SEP] operator[SEP] identifier[finalClasspathEltOrderStrs] operator[SEP] identifier[add] operator[SEP] identifier[classpathElt] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classpathOrderLog] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[ModuleRef] identifier[moduleRef] operator[=] identifier[classpathElt] operator[SEP] identifier[getModuleRef] operator[SEP] operator[SEP] operator[SEP] identifier[classpathOrderLog] operator[SEP] identifier[log] operator[SEP] identifier[moduleRef] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[final] identifier[ClasspathElement] identifier[classpathElt] operator[:] identifier[classpathEltOrder] operator[SEP] { identifier[finalClasspathEltOrder] operator[SEP] identifier[add] operator[SEP] identifier[classpathElt] operator[SEP] operator[SEP] identifier[finalClasspathEltOrderStrs] operator[SEP] identifier[add] operator[SEP] identifier[classpathElt] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classpathOrderLog] operator[!=] Other[null] operator[SEP] { identifier[classpathOrderLog] operator[SEP] identifier[log] operator[SEP] identifier[classpathElt] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[processWorkUnits] operator[SEP] identifier[finalClasspathEltOrder] , identifier[topLevelLog] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[topLevelLog] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] , Keyword[new] identifier[WorkUnitProcessor] operator[<] identifier[ClasspathElement] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[processWorkUnit] operator[SEP] Keyword[final] identifier[ClasspathElement] identifier[classpathElement] , Keyword[final] identifier[WorkQueue] operator[<] identifier[ClasspathElement] operator[>] identifier[workQueueIgnored] , Keyword[final] identifier[LogNode] identifier[pathScanLog] operator[SEP] Keyword[throws] identifier[InterruptedException] { identifier[classpathElement] operator[SEP] identifier[scanPaths] operator[SEP] identifier[pathScanLog] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ClasspathElement] operator[>] identifier[finalClasspathEltOrderFiltered] operator[=] identifier[finalClasspathEltOrder] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[scanSpec] operator[SEP] identifier[classpathElementResourcePathWhiteBlackList] operator[SEP] identifier[whitelistIsEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[finalClasspathEltOrderFiltered] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[finalClasspathEltOrder] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ClasspathElement] identifier[classpathElement] operator[:] identifier[finalClasspathEltOrder] operator[SEP] { Keyword[if] operator[SEP] identifier[classpathElement] operator[SEP] identifier[containsSpecificallyWhitelistedClasspathElementResourcePath] operator[SEP] { identifier[finalClasspathEltOrderFiltered] operator[SEP] identifier[add] operator[SEP] identifier[classpathElement] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[scanSpec] operator[SEP] identifier[performScan] operator[SEP] { Keyword[return] identifier[performScan] operator[SEP] identifier[finalClasspathEltOrderFiltered] , identifier[finalClasspathEltOrderStrs] , identifier[classLoaderOrderRespectingParentDelegation] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[topLevelLog] operator[!=] Other[null] operator[SEP] { identifier[topLevelLog] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ScanResult] operator[SEP] identifier[scanSpec] , identifier[finalClasspathEltOrderFiltered] , identifier[finalClasspathEltOrderStrs] , identifier[classLoaderOrderRespectingParentDelegation] , Other[null] , Other[null] , Other[null] , Other[null] , identifier[nestedJarHandler] , identifier[topLevelLog] operator[SEP] operator[SEP] } }
public void addValidator(final FieldValidator validator) { WComponent labelField = findComponentForLabel(field); if (labelField instanceof Input) { ((Input) labelField).addValidator(validator); } }
class class_name[name] begin[{] method[addValidator, return_type[void], modifier[public], parameter[validator]] begin[{] local_variable[type[WComponent], labelField] if[binary_operation[member[.labelField], instanceof, type[Input]]] begin[{] Cast(expression=MemberReference(member=labelField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Input, sub_type=None)) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addValidator] operator[SEP] Keyword[final] identifier[FieldValidator] identifier[validator] operator[SEP] { identifier[WComponent] identifier[labelField] operator[=] identifier[findComponentForLabel] operator[SEP] identifier[field] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[labelField] Keyword[instanceof] identifier[Input] operator[SEP] { operator[SEP] operator[SEP] identifier[Input] operator[SEP] identifier[labelField] operator[SEP] operator[SEP] identifier[addValidator] operator[SEP] identifier[validator] operator[SEP] operator[SEP] } }
@Override public <T> T removeProperty(final String key) { if (checkDeletedInTx()) throw new IllegalStateException("The vertex " + getIdentity() + " has been deleted"); final OrientBaseGraph graph = getGraph(); if (graph != null) graph.autoStartTransaction(); final Object oldValue = getRecord().removeField(key); if (graph != null) save(); return (T) oldValue; }
class class_name[name] begin[{] method[removeProperty, return_type[type[T]], modifier[public], parameter[key]] begin[{] if[call[.checkDeletedInTx, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The vertex "), operandr=MethodInvocation(arguments=[], member=getIdentity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has been deleted"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[OrientBaseGraph], graph] if[binary_operation[member[.graph], !=, literal[null]]] begin[{] call[graph.autoStartTransaction, parameter[]] else begin[{] None end[}] local_variable[type[Object], oldValue] if[binary_operation[member[.graph], !=, literal[null]]] begin[{] call[.save, parameter[]] else begin[{] None end[}] return[Cast(expression=MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[removeProperty] operator[SEP] Keyword[final] identifier[String] identifier[key] operator[SEP] { Keyword[if] operator[SEP] identifier[checkDeletedInTx] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[getIdentity] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[OrientBaseGraph] identifier[graph] operator[=] identifier[getGraph] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[graph] operator[!=] Other[null] operator[SEP] identifier[graph] operator[SEP] identifier[autoStartTransaction] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[oldValue] operator[=] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[removeField] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[graph] operator[!=] Other[null] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[oldValue] operator[SEP] }
private void clearDrag() { if (m_listItemWidget != null) { Iterator<Widget> buttonIterator = m_listItemWidget.getButtonPanel().iterator(); while (buttonIterator.hasNext()) { Widget button = buttonIterator.next(); button.getElement().getStyle().clearVisibility(); } } if (m_helper != null) { m_helper.removeFromParent(); m_helper = null; } if (m_provisionalParent != null) { m_provisionalParent.removeFromParent(); m_provisionalParent = null; } setVisible(true); }
class class_name[name] begin[{] method[clearDrag, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.m_listItemWidget], !=, literal[null]]] begin[{] local_variable[type[Iterator], buttonIterator] while[call[buttonIterator.hasNext, parameter[]]] begin[{] local_variable[type[Widget], button] call[button.getElement, parameter[]] end[}] else begin[{] None end[}] if[binary_operation[member[.m_helper], !=, literal[null]]] begin[{] call[m_helper.removeFromParent, parameter[]] assign[member[.m_helper], literal[null]] else begin[{] None end[}] if[binary_operation[member[.m_provisionalParent], !=, literal[null]]] begin[{] call[m_provisionalParent.removeFromParent, parameter[]] assign[member[.m_provisionalParent], literal[null]] else begin[{] None end[}] call[.setVisible, parameter[literal[true]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[clearDrag] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_listItemWidget] operator[!=] Other[null] operator[SEP] { identifier[Iterator] operator[<] identifier[Widget] operator[>] identifier[buttonIterator] operator[=] identifier[m_listItemWidget] operator[SEP] identifier[getButtonPanel] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[buttonIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Widget] identifier[button] operator[=] identifier[buttonIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[button] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[clearVisibility] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[m_helper] operator[!=] Other[null] operator[SEP] { identifier[m_helper] operator[SEP] identifier[removeFromParent] operator[SEP] operator[SEP] operator[SEP] identifier[m_helper] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[m_provisionalParent] operator[!=] Other[null] operator[SEP] { identifier[m_provisionalParent] operator[SEP] identifier[removeFromParent] operator[SEP] operator[SEP] operator[SEP] identifier[m_provisionalParent] operator[=] Other[null] operator[SEP] } identifier[setVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
public CreateDownloadTaskOperation buildCreateDownloadTaskOperation(String source, String fileName) { return new CreateDownloadTaskOperation(getOperationFactory(), source, fileName); }
class class_name[name] begin[{] method[buildCreateDownloadTaskOperation, return_type[type[CreateDownloadTaskOperation]], modifier[public], parameter[source, fileName]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getOperationFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fileName, 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=CreateDownloadTaskOperation, sub_type=None))] end[}] END[}]
Keyword[public] identifier[CreateDownloadTaskOperation] identifier[buildCreateDownloadTaskOperation] operator[SEP] identifier[String] identifier[source] , identifier[String] identifier[fileName] operator[SEP] { Keyword[return] Keyword[new] identifier[CreateDownloadTaskOperation] operator[SEP] identifier[getOperationFactory] operator[SEP] operator[SEP] , identifier[source] , identifier[fileName] operator[SEP] operator[SEP] }
@Override public void on(String name, Tree payload, Groups groups, boolean broadcast) throws Exception { // A.) Async invocation if (asyncLocalInvocation) { executor.execute(() -> { try { listener.on(payload); } catch (Exception cause) { logger.warn("Unable to invoke local listener!", cause); } }); return; } // B.) Faster in-process (direct) invocation listener.on(payload); }
class class_name[name] begin[{] method[on, return_type[void], modifier[public], parameter[name, payload, groups, broadcast]] begin[{] if[member[.asyncLocalInvocation]] begin[{] call[executor.execute, parameter[LambdaExpression(body=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=payload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=on, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to invoke local listener!"), MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cause, types=['Exception']))], finally_block=None, label=None, resources=None)], parameters=[])]] return[None] else begin[{] None end[}] call[listener.on, parameter[member[.payload]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[on] operator[SEP] identifier[String] identifier[name] , identifier[Tree] identifier[payload] , identifier[Groups] identifier[groups] , Keyword[boolean] identifier[broadcast] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[asyncLocalInvocation] operator[SEP] { identifier[executor] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] { Keyword[try] { identifier[listener] operator[SEP] identifier[on] operator[SEP] identifier[payload] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[cause] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[cause] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[listener] operator[SEP] identifier[on] operator[SEP] identifier[payload] operator[SEP] operator[SEP] }
public ByteBuffer[] toByteBuffers() { if (LOG.isDebugEnabled()) LOG.debug("to bb type " + type.name()); final ByteBuffer buffer0 = ByteBuffer.allocate(size1() + 2 * getNumDataBuffers()); Persistables.persistable(streamableNoBuffers()).write(buffer0); for (int i = 0; i < getNumDataBuffers(); i++) buffer0.putShort(getDataBuffer(i) != null ? verifyShort(getDataBuffer(i).remaining()) : 0); buffer0.flip(); final ByteBuffer[] buffers = new ByteBuffer[1 + getNumDataBuffers()]; buffers[0] = buffer0; for (int i = 0; i < getNumDataBuffers(); i++) buffers[1 + i] = getDataBuffer(i); return buffers; }
class class_name[name] begin[{] method[toByteBuffers, return_type[type[ByteBuffer]], modifier[public], parameter[]] begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[binary_operation[literal["to bb type "], +, call[type.name, parameter[]]]]] else begin[{] None end[}] local_variable[type[ByteBuffer], buffer0] call[Persistables.persistable, parameter[call[.streamableNoBuffers, parameter[]]]] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=remaining, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=verifyShort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))], member=putShort, postfix_operators=[], prefix_operators=[], qualifier=buffer0, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumDataBuffers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[buffer0.flip, parameter[]] local_variable[type[ByteBuffer], buffers] assign[member[.buffers], member[.buffer0]] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataBuffer, 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=MethodInvocation(arguments=[], member=getNumDataBuffers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.buffers]] end[}] END[}]
Keyword[public] identifier[ByteBuffer] operator[SEP] operator[SEP] identifier[toByteBuffers] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[buffer0] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[size1] operator[SEP] operator[SEP] operator[+] Other[2] operator[*] identifier[getNumDataBuffers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Persistables] operator[SEP] identifier[persistable] operator[SEP] identifier[streamableNoBuffers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[buffer0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getNumDataBuffers] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[buffer0] operator[SEP] identifier[putShort] operator[SEP] identifier[getDataBuffer] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[null] operator[?] identifier[verifyShort] operator[SEP] identifier[getDataBuffer] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] operator[SEP] identifier[buffer0] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuffer] operator[SEP] operator[SEP] identifier[buffers] operator[=] Keyword[new] identifier[ByteBuffer] operator[SEP] Other[1] operator[+] identifier[getNumDataBuffers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffers] operator[SEP] Other[0] operator[SEP] operator[=] identifier[buffer0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getNumDataBuffers] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[buffers] operator[SEP] Other[1] operator[+] identifier[i] operator[SEP] operator[=] identifier[getDataBuffer] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[return] identifier[buffers] operator[SEP] }
@Route(method = HttpMethod.POST, uri = "/json/car") public Result getACar() { Car car = new Car("renault", "clio 2", 4, "dirty"); return ok(car).json(); }
class class_name[name] begin[{] method[getACar, return_type[type[Result]], modifier[public], parameter[]] begin[{] local_variable[type[Car], car] return[call[.ok, parameter[member[.car]]]] end[}] END[}]
annotation[@] identifier[Route] operator[SEP] identifier[method] operator[=] identifier[HttpMethod] operator[SEP] identifier[POST] , identifier[uri] operator[=] literal[String] operator[SEP] Keyword[public] identifier[Result] identifier[getACar] operator[SEP] operator[SEP] { identifier[Car] identifier[car] operator[=] Keyword[new] identifier[Car] operator[SEP] literal[String] , literal[String] , Other[4] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[ok] operator[SEP] identifier[car] operator[SEP] operator[SEP] identifier[json] operator[SEP] operator[SEP] operator[SEP] }
static public GrayS8 discretizeDirection4(GrayF32 angle , GrayS8 discrete ) { discrete = InputSanityCheck.checkDeclare(angle,discrete,GrayS8.class); final float A = (float)(Math.PI/8.0); final float B = (float)(Math.PI/4.0); final int w = angle.width; final int h = angle.height; for( int y = 0; y < h; y++ ) { int indexSrc = angle.startIndex + y*angle.stride; int indexDst = discrete.startIndex + y*discrete.stride; int end = indexSrc + w; for( ; indexSrc < end; indexSrc++ , indexDst++ ) { float a = angle.data[indexSrc]; int val; if( a >= 0 ) { val = (int)((a+A)/B); } else { val = (int)((a-A)/B); } discrete.data[indexDst] = (byte)(val == -2 ? 2 : val); } } return discrete; }
class class_name[name] begin[{] method[discretizeDirection4, return_type[type[GrayS8]], modifier[public static], parameter[angle, discrete]] begin[{] assign[member[.discrete], call[InputSanityCheck.checkDeclare, parameter[member[.angle], member[.discrete], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GrayS8, sub_type=None))]]] local_variable[type[float], A] local_variable[type[float], B] local_variable[type[int], w] local_variable[type[int], h] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=angle, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=angle, selectors=[]), operator=*), operator=+), name=indexSrc)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=discrete, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=discrete, selectors=[]), operator=*), operator=+), name=indexDst)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=indexSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=angle, selectors=[ArraySelector(index=MemberReference(member=indexSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=a)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=val)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=A, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=B, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), type=BasicType(dimensions=[], name=int))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=A, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=B, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), type=BasicType(dimensions=[], name=int))), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=discrete, selectors=[ArraySelector(index=MemberReference(member=indexDst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2), operator===), if_false=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=indexSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[MemberReference(member=indexSrc, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexDst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=h, 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=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.discrete]] end[}] END[}]
Keyword[static] Keyword[public] identifier[GrayS8] identifier[discretizeDirection4] operator[SEP] identifier[GrayF32] identifier[angle] , identifier[GrayS8] identifier[discrete] operator[SEP] { identifier[discrete] operator[=] identifier[InputSanityCheck] operator[SEP] identifier[checkDeclare] operator[SEP] identifier[angle] , identifier[discrete] , identifier[GrayS8] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[A] operator[=] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[PI] operator[/] literal[Float] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[B] operator[=] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[PI] operator[/] literal[Float] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[w] operator[=] identifier[angle] operator[SEP] identifier[width] operator[SEP] Keyword[final] Keyword[int] identifier[h] operator[=] identifier[angle] operator[SEP] identifier[height] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[h] operator[SEP] identifier[y] operator[++] operator[SEP] { Keyword[int] identifier[indexSrc] operator[=] identifier[angle] operator[SEP] identifier[startIndex] operator[+] identifier[y] operator[*] identifier[angle] operator[SEP] identifier[stride] operator[SEP] Keyword[int] identifier[indexDst] operator[=] identifier[discrete] operator[SEP] identifier[startIndex] operator[+] identifier[y] operator[*] identifier[discrete] operator[SEP] identifier[stride] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[indexSrc] operator[+] identifier[w] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[indexSrc] operator[<] identifier[end] operator[SEP] identifier[indexSrc] operator[++] , identifier[indexDst] operator[++] operator[SEP] { Keyword[float] identifier[a] operator[=] identifier[angle] operator[SEP] identifier[data] operator[SEP] identifier[indexSrc] operator[SEP] operator[SEP] Keyword[int] identifier[val] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[>=] Other[0] operator[SEP] { identifier[val] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[a] operator[+] identifier[A] operator[SEP] operator[/] identifier[B] operator[SEP] operator[SEP] } Keyword[else] { identifier[val] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[a] operator[-] identifier[A] operator[SEP] operator[/] identifier[B] operator[SEP] operator[SEP] } identifier[discrete] operator[SEP] identifier[data] operator[SEP] identifier[indexDst] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[val] operator[==] operator[-] Other[2] operator[?] Other[2] operator[:] identifier[val] operator[SEP] operator[SEP] } } Keyword[return] identifier[discrete] operator[SEP] }
public static vlan_channel_binding[] get(nitro_service service, Long id) throws Exception{ vlan_channel_binding obj = new vlan_channel_binding(); obj.set_id(id); vlan_channel_binding response[] = (vlan_channel_binding[]) obj.get_resources(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[vlan_channel_binding]], modifier[public static], parameter[service, id]] begin[{] local_variable[type[vlan_channel_binding], obj] call[obj.set_id, parameter[member[.id]]] local_variable[type[vlan_channel_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[vlan_channel_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[Long] identifier[id] operator[SEP] Keyword[throws] identifier[Exception] { identifier[vlan_channel_binding] identifier[obj] operator[=] Keyword[new] identifier[vlan_channel_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_id] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[vlan_channel_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[vlan_channel_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
protected void start() throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start"); // We call start regardless of whether this is synchronous or async if (coreConsumerSession != null) { try { synchronized (closedLock) { if (!closed) { // Do not deliver message immediately on start. coreConsumerSession.start(false); } else { // This condition could be caused by tight looping closing of consumers at // the same time as calling connection.start. This is a less intrusive solution // than adding the locking that would otherwise be required. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Avoided starting a consumer that has been closed."); } } } catch (SIException sice) { // No FFDC code needed // d222942 review. Default message ok. // This exception will be propogated back up to the Session, which will // cache the first exception thrown. Once all the consumers have been // started (or stopped) the first caught exception is then propogated // to the Connection for delivery to the application. // d238447 FFDC Review. Either external or already FFDCd, so don't FFDC here. throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class, "EXCEPTION_RECEIVED_CWSIA0085", new Object[] { sice, "JmsMsgConsumerImpl.start" }, sice, null, // null probeId = no FFDC this, tc); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start"); }
class class_name[name] begin[{] method[start, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["start"]]] else begin[{] None end[}] if[binary_operation[member[.coreConsumerSession], !=, literal[null]]] begin[{] TryStatement(block=[SynchronizedStatement(block=[IfStatement(condition=MemberReference(member=closed, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_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=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Avoided starting a consumer that has been closed.")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=start, postfix_operators=[], prefix_operators=[], qualifier=coreConsumerSession, selectors=[], type_arguments=None), label=None)]))], label=None, lock=MemberReference(member=closedLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=[CatchClause(block=[ThrowStatement(expression=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JMSException, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EXCEPTION_RECEIVED_CWSIA0085"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=sice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JmsMsgConsumerImpl.start")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), MemberReference(member=sice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newThrowable, postfix_operators=[], prefix_operators=[], qualifier=JmsErrorUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JMSException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=sice, types=['SIException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["start"]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[start] operator[SEP] operator[SEP] Keyword[throws] identifier[JMSException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[coreConsumerSession] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[synchronized] operator[SEP] identifier[closedLock] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[closed] operator[SEP] { identifier[coreConsumerSession] operator[SEP] identifier[start] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[SIException] identifier[sice] operator[SEP] { Keyword[throw] operator[SEP] identifier[JMSException] operator[SEP] identifier[JmsErrorUtils] operator[SEP] identifier[newThrowable] operator[SEP] identifier[JMSException] operator[SEP] Keyword[class] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[sice] , literal[String] } , identifier[sice] , Other[null] , Keyword[this] , identifier[tc] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public boolean computeShiftDirect(DMatrixRMaj A , double alpha) { SpecializedOps_DDRM.addIdentity(A,B,-alpha); return computeDirect(B); }
class class_name[name] begin[{] method[computeShiftDirect, return_type[type[boolean]], modifier[public], parameter[A, alpha]] begin[{] call[SpecializedOps_DDRM.addIdentity, parameter[member[.A], member[.B], member[.alpha]]] return[call[.computeDirect, parameter[member[.B]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[computeShiftDirect] operator[SEP] identifier[DMatrixRMaj] identifier[A] , Keyword[double] identifier[alpha] operator[SEP] { identifier[SpecializedOps_DDRM] operator[SEP] identifier[addIdentity] operator[SEP] identifier[A] , identifier[B] , operator[-] identifier[alpha] operator[SEP] operator[SEP] Keyword[return] identifier[computeDirect] operator[SEP] identifier[B] operator[SEP] operator[SEP] }
public static void magnitude(ZMatrixD1 input , DMatrixD1 output ) { if( input.numCols != output.numCols || input.numRows != output.numRows ) { throw new IllegalArgumentException("The matrices are not all the same dimension."); } final int length = input.getDataLength(); for( int i = 0; i < length; i += 2 ) { double real = input.data[i]; double imaginary = input.data[i+1]; output.data[i/2] = Math.sqrt(real*real + imaginary*imaginary); } }
class class_name[name] begin[{] method[magnitude, return_type[void], modifier[public static], parameter[input, output]] begin[{] if[binary_operation[binary_operation[member[input.numCols], !=, member[output.numCols]], ||, binary_operation[member[input.numRows], !=, member[output.numRows]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The matrices are not all the same dimension.")], 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[}] local_variable[type[int], length] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=real)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), name=imaginary)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=imaginary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=imaginary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)], member=sqrt, postfix_operators=[], prefix_operators=[], qualifier=Math, 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=, 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=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[magnitude] operator[SEP] identifier[ZMatrixD1] identifier[input] , identifier[DMatrixD1] identifier[output] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[numCols] operator[!=] identifier[output] operator[SEP] identifier[numCols] operator[||] identifier[input] operator[SEP] identifier[numRows] operator[!=] identifier[output] operator[SEP] identifier[numRows] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[length] operator[=] identifier[input] operator[SEP] identifier[getDataLength] operator[SEP] 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[+=] Other[2] operator[SEP] { Keyword[double] identifier[real] operator[=] identifier[input] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[double] identifier[imaginary] operator[=] identifier[input] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[/] Other[2] operator[SEP] operator[=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[real] operator[*] identifier[real] operator[+] identifier[imaginary] operator[*] identifier[imaginary] operator[SEP] operator[SEP] } }
public List<Return> validate(final Object... _objectTuples) throws EFapsException { return executeEvents(EventType.UI_VALIDATE, _objectTuples); }
class class_name[name] begin[{] method[validate, return_type[type[List]], modifier[public], parameter[_objectTuples]] begin[{] return[call[.executeEvents, parameter[member[EventType.UI_VALIDATE], member[._objectTuples]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Return] operator[>] identifier[validate] operator[SEP] Keyword[final] identifier[Object] operator[...] identifier[_objectTuples] operator[SEP] Keyword[throws] identifier[EFapsException] { Keyword[return] identifier[executeEvents] operator[SEP] identifier[EventType] operator[SEP] identifier[UI_VALIDATE] , identifier[_objectTuples] operator[SEP] operator[SEP] }
public SftpFile[] matchFilesWithPattern(SftpFile[] files, String fileNameRegExp) throws SftpStatusException, SshException { // set up variables for regexp matching Pattern mpattern = null; PatternCompiler aPCompiler = new Perl5Compiler(); PatternMatcher aPerl5Matcher = new Perl5Matcher(); // Attempt to compile the pattern. If the pattern is not valid, // throw exception try { mpattern = aPCompiler.compile(fileNameRegExp); } catch (MalformedPatternException e) { throw new SshException("Invalid regular expression:" + e.getMessage(), SshException.BAD_API_USAGE); } Vector<SftpFile> matchedNames = new Vector<SftpFile>(); for (int i = 0; i < files.length; i++) { if ((!files[i].getFilename().equals(".")) && (!files[i].getFilename().equals("..")) && (!files[i].isDirectory())) { if (aPerl5Matcher.matches(files[i].getFilename(), mpattern)) { // call get for each match, passing true, so that it doesnt // repeat the search matchedNames.addElement(files[i]); } } } // return (SftpFile[]) matchedNames.toArray(new SftpFile[0]); SftpFile[] matchedNamesSftpFiles = new SftpFile[matchedNames.size()]; matchedNames.copyInto(matchedNamesSftpFiles); return matchedNamesSftpFiles; }
class class_name[name] begin[{] method[matchFilesWithPattern, return_type[type[SftpFile]], modifier[public], parameter[files, fileNameRegExp]] begin[{] local_variable[type[Pattern], mpattern] local_variable[type[PatternCompiler], aPCompiler] local_variable[type[PatternMatcher], aPerl5Matcher] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mpattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=fileNameRegExp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compile, postfix_operators=[], prefix_operators=[], qualifier=aPCompiler, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid regular expression:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=BAD_API_USAGE, postfix_operators=[], prefix_operators=[], qualifier=SshException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SshException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedPatternException']))], finally_block=None, label=None, resources=None) local_variable[type[Vector], matchedNames] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), operandr=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getFilename, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=mpattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=aPerl5Matcher, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=addElement, postfix_operators=[], prefix_operators=[], qualifier=matchedNames, 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=files, 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) local_variable[type[SftpFile], matchedNamesSftpFiles] call[matchedNames.copyInto, parameter[member[.matchedNamesSftpFiles]]] return[member[.matchedNamesSftpFiles]] end[}] END[}]
Keyword[public] identifier[SftpFile] operator[SEP] operator[SEP] identifier[matchFilesWithPattern] operator[SEP] identifier[SftpFile] operator[SEP] operator[SEP] identifier[files] , identifier[String] identifier[fileNameRegExp] operator[SEP] Keyword[throws] identifier[SftpStatusException] , identifier[SshException] { identifier[Pattern] identifier[mpattern] operator[=] Other[null] operator[SEP] identifier[PatternCompiler] identifier[aPCompiler] operator[=] Keyword[new] identifier[Perl5Compiler] operator[SEP] operator[SEP] operator[SEP] identifier[PatternMatcher] identifier[aPerl5Matcher] operator[=] Keyword[new] identifier[Perl5Matcher] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[mpattern] operator[=] identifier[aPCompiler] operator[SEP] identifier[compile] operator[SEP] identifier[fileNameRegExp] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MalformedPatternException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SshException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[SshException] operator[SEP] identifier[BAD_API_USAGE] operator[SEP] operator[SEP] } identifier[Vector] operator[<] identifier[SftpFile] operator[>] identifier[matchedNames] operator[=] Keyword[new] identifier[Vector] operator[<] identifier[SftpFile] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[files] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] operator[!] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFilename] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFilename] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[aPerl5Matcher] operator[SEP] identifier[matches] operator[SEP] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFilename] operator[SEP] operator[SEP] , identifier[mpattern] operator[SEP] operator[SEP] { identifier[matchedNames] operator[SEP] identifier[addElement] operator[SEP] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } } identifier[SftpFile] operator[SEP] operator[SEP] identifier[matchedNamesSftpFiles] operator[=] Keyword[new] identifier[SftpFile] operator[SEP] identifier[matchedNames] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[matchedNames] operator[SEP] identifier[copyInto] operator[SEP] identifier[matchedNamesSftpFiles] operator[SEP] operator[SEP] Keyword[return] identifier[matchedNamesSftpFiles] operator[SEP] }
public void config(String msg) { if (Level.CONFIG.intValue() < levelValue) { return; } log(Level.CONFIG, msg); }
class class_name[name] begin[{] method[config, return_type[void], modifier[public], parameter[msg]] begin[{] if[binary_operation[call[Level.CONFIG.intValue, parameter[]], <, member[.levelValue]]] begin[{] return[None] else begin[{] None end[}] call[.log, parameter[member[Level.CONFIG], member[.msg]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[config] operator[SEP] identifier[String] identifier[msg] operator[SEP] { Keyword[if] operator[SEP] identifier[Level] operator[SEP] identifier[CONFIG] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[<] identifier[levelValue] operator[SEP] { Keyword[return] operator[SEP] } identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[CONFIG] , identifier[msg] operator[SEP] operator[SEP] }
public StringClauses insertBefore(Enum existingKey, Enum newKey, String newValue) { return insertBefore(existingKey.name(), newKey.name(), newValue); }
class class_name[name] begin[{] method[insertBefore, return_type[type[StringClauses]], modifier[public], parameter[existingKey, newKey, newValue]] begin[{] return[call[.insertBefore, parameter[call[existingKey.name, parameter[]], call[newKey.name, parameter[]], member[.newValue]]]] end[}] END[}]
Keyword[public] identifier[StringClauses] identifier[insertBefore] operator[SEP] identifier[Enum] identifier[existingKey] , identifier[Enum] identifier[newKey] , identifier[String] identifier[newValue] operator[SEP] { Keyword[return] identifier[insertBefore] operator[SEP] identifier[existingKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[newKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[newValue] operator[SEP] operator[SEP] }
@Encoding.Expose public Optional<ImmutableMap<K, V>> getImmutable() { return Optional.ofNullable(map); }
class class_name[name] begin[{] method[getImmutable, return_type[type[Optional]], modifier[public], parameter[]] begin[{] return[call[Optional.ofNullable, parameter[member[.map]]]] end[}] END[}]
annotation[@] identifier[Encoding] operator[SEP] identifier[Expose] Keyword[public] identifier[Optional] operator[<] identifier[ImmutableMap] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[getImmutable] operator[SEP] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[map] operator[SEP] operator[SEP] }
public void addValue(Date date) { String dateString = XmppDateTime.formatXEP0082Date(date); addValue(dateString); }
class class_name[name] begin[{] method[addValue, return_type[void], modifier[public], parameter[date]] begin[{] local_variable[type[String], dateString] call[.addValue, parameter[member[.dateString]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addValue] operator[SEP] identifier[Date] identifier[date] operator[SEP] { identifier[String] identifier[dateString] operator[=] identifier[XmppDateTime] operator[SEP] identifier[formatXEP0082Date] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[addValue] operator[SEP] identifier[dateString] operator[SEP] operator[SEP] }
public FrameType getFactBeforeExceptionCheck(CFG cfg, int pc) throws DataflowAnalysisException { FrameType result = createFact(); makeFactTop(result); for (Location loc : cfg.getLocationsContainingInstructionWithOffset(pc)) { BasicBlock b = loc.getBasicBlock(); BasicBlock b2 = null; if (b.getFirstInstruction() != null && b.getFirstInstruction().getPosition() == pc) { b2 = cfg.getPredecessorWithEdgeType(b, EdgeTypes.FALL_THROUGH_EDGE); } if(b2 != null && b2.isExceptionThrower()) { for (Iterator<Edge> i = cfg.incomingEdgeIterator(b2); i.hasNext();) { Edge e = i.next(); FrameType fact = getFactOnEdge(e); if (isFactValid(fact)) { mergeInto(fact, result); } } } else { FrameType fact = getFactAtLocation(loc); if (isFactValid(fact)) { mergeInto(fact, result); } } } return result; }
class class_name[name] begin[{] method[getFactBeforeExceptionCheck, return_type[type[FrameType]], modifier[public], parameter[cfg, pc]] begin[{] local_variable[type[FrameType], result] call[.makeFactTop, parameter[member[.result]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBasicBlock, postfix_operators=[], prefix_operators=[], qualifier=loc, selectors=[], type_arguments=None), name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BasicBlock, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=b2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BasicBlock, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFirstInstruction, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFirstInstruction, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[MethodInvocation(arguments=[], member=getPosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=pc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FALL_THROUGH_EDGE, postfix_operators=[], prefix_operators=[], qualifier=EdgeTypes, selectors=[])], member=getPredecessorWithEdgeType, postfix_operators=[], prefix_operators=[], qualifier=cfg, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isExceptionThrower, postfix_operators=[], prefix_operators=[], qualifier=b2, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=loc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFactAtLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=fact)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FrameType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=fact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isFactValid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mergeInto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Edge, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFactOnEdge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=fact)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FrameType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=fact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isFactValid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mergeInto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[MemberReference(member=b2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=incomingEdgeIterator, postfix_operators=[], prefix_operators=[], qualifier=cfg, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Edge, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=pc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocationsContainingInstructionWithOffset, postfix_operators=[], prefix_operators=[], qualifier=cfg, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=loc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Location, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[FrameType] identifier[getFactBeforeExceptionCheck] operator[SEP] identifier[CFG] identifier[cfg] , Keyword[int] identifier[pc] operator[SEP] Keyword[throws] identifier[DataflowAnalysisException] { identifier[FrameType] identifier[result] operator[=] identifier[createFact] operator[SEP] operator[SEP] operator[SEP] identifier[makeFactTop] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Location] identifier[loc] operator[:] identifier[cfg] operator[SEP] identifier[getLocationsContainingInstructionWithOffset] operator[SEP] identifier[pc] operator[SEP] operator[SEP] { identifier[BasicBlock] identifier[b] operator[=] identifier[loc] operator[SEP] identifier[getBasicBlock] operator[SEP] operator[SEP] operator[SEP] identifier[BasicBlock] identifier[b2] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[getFirstInstruction] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[b] operator[SEP] identifier[getFirstInstruction] operator[SEP] operator[SEP] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[==] identifier[pc] operator[SEP] { identifier[b2] operator[=] identifier[cfg] operator[SEP] identifier[getPredecessorWithEdgeType] operator[SEP] identifier[b] , identifier[EdgeTypes] operator[SEP] identifier[FALL_THROUGH_EDGE] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[b2] operator[!=] Other[null] operator[&&] identifier[b2] operator[SEP] identifier[isExceptionThrower] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Edge] operator[>] identifier[i] operator[=] identifier[cfg] operator[SEP] identifier[incomingEdgeIterator] operator[SEP] identifier[b2] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Edge] identifier[e] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[FrameType] identifier[fact] operator[=] identifier[getFactOnEdge] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isFactValid] operator[SEP] identifier[fact] operator[SEP] operator[SEP] { identifier[mergeInto] operator[SEP] identifier[fact] , identifier[result] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[FrameType] identifier[fact] operator[=] identifier[getFactAtLocation] operator[SEP] identifier[loc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isFactValid] operator[SEP] identifier[fact] operator[SEP] operator[SEP] { identifier[mergeInto] operator[SEP] identifier[fact] , identifier[result] operator[SEP] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] }
static public boolean isDateUnit(String unitString) { SimpleUnit su = factory(unitString); return su != null && isDateUnit(su.getUnit()); }
class class_name[name] begin[{] method[isDateUnit, return_type[type[boolean]], modifier[public static], parameter[unitString]] begin[{] local_variable[type[SimpleUnit], su] return[binary_operation[binary_operation[member[.su], !=, literal[null]], &&, call[.isDateUnit, parameter[call[su.getUnit, parameter[]]]]]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[boolean] identifier[isDateUnit] operator[SEP] identifier[String] identifier[unitString] operator[SEP] { identifier[SimpleUnit] identifier[su] operator[=] identifier[factory] operator[SEP] identifier[unitString] operator[SEP] operator[SEP] Keyword[return] identifier[su] operator[!=] Other[null] operator[&&] identifier[isDateUnit] operator[SEP] identifier[su] operator[SEP] identifier[getUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Deprecated public final Session getSession() { while (true) { String cachedToken = null; Session oldSession = null; synchronized (this.lock) { if (userSetSession != null) { return userSetSession; } if ((session != null) || !sessionInvalidated) { return session; } cachedToken = accessToken; oldSession = session; } if (cachedToken == null) { return null; } // At this point we do not have a valid session, but mAccessToken is // non-null. // So we can try building a session based on that. List<String> permissions; if (oldSession != null) { permissions = oldSession.getPermissions(); } else if (pendingAuthorizationPermissions != null) { permissions = Arrays.asList(pendingAuthorizationPermissions); } else { permissions = Collections.<String>emptyList(); } Session newSession = new Session.Builder(pendingAuthorizationActivity). setApplicationId(mAppId). setTokenCachingStrategy(getTokenCache()). build(); if (newSession.getState() != SessionState.CREATED_TOKEN_LOADED) { return null; } Session.OpenRequest openRequest = new Session.OpenRequest(pendingAuthorizationActivity).setPermissions(permissions); openSession(newSession, openRequest, !permissions.isEmpty()); Session invalidatedSession = null; Session returnSession = null; synchronized (this.lock) { if (sessionInvalidated || (session == null)) { invalidatedSession = session; returnSession = session = newSession; sessionInvalidated = false; } } if (invalidatedSession != null) { invalidatedSession.close(); } if (returnSession != null) { return returnSession; } // Else token state changed between the synchronized blocks, so // retry.. } }
class class_name[name] begin[{] method[getSession, return_type[type[Session]], modifier[final public], parameter[]] begin[{] while[literal[true]] begin[{] local_variable[type[String], cachedToken] local_variable[type[Session], oldSession] SYNCHRONIZED[THIS[member[None.lock]]] BEGIN[{] if[binary_operation[member[.userSetSession], !=, literal[null]]] begin[{] return[member[.userSetSession]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.session], !=, literal[null]], ||, member[.sessionInvalidated]]] begin[{] return[member[.session]] else begin[{] None end[}] assign[member[.cachedToken], member[.accessToken]] assign[member[.oldSession], member[.session]] END[}] if[binary_operation[member[.cachedToken], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], permissions] if[binary_operation[member[.oldSession], !=, literal[null]]] begin[{] assign[member[.permissions], call[oldSession.getPermissions, parameter[]]] else begin[{] if[binary_operation[member[.pendingAuthorizationPermissions], !=, literal[null]]] begin[{] assign[member[.permissions], call[Arrays.asList, parameter[member[.pendingAuthorizationPermissions]]]] else begin[{] assign[member[.permissions], call[.Collections, parameter[]]] end[}] end[}] local_variable[type[Session], newSession] if[binary_operation[call[newSession.getState, parameter[]], !=, member[SessionState.CREATED_TOKEN_LOADED]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Session], openRequest] call[.openSession, parameter[member[.newSession], member[.openRequest], call[permissions.isEmpty, parameter[]]]] local_variable[type[Session], invalidatedSession] local_variable[type[Session], returnSession] SYNCHRONIZED[THIS[member[None.lock]]] BEGIN[{] if[binary_operation[member[.sessionInvalidated], ||, binary_operation[member[.session], ==, literal[null]]]] begin[{] assign[member[.invalidatedSession], member[.session]] assign[member[.returnSession], assign[member[.session], member[.newSession]]] assign[member[.sessionInvalidated], literal[false]] else begin[{] None end[}] END[}] if[binary_operation[member[.invalidatedSession], !=, literal[null]]] begin[{] call[invalidatedSession.close, parameter[]] else begin[{] None end[}] if[binary_operation[member[.returnSession], !=, literal[null]]] begin[{] return[member[.returnSession]] else begin[{] None end[}] end[}] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[final] identifier[Session] identifier[getSession] operator[SEP] operator[SEP] { Keyword[while] operator[SEP] literal[boolean] operator[SEP] { identifier[String] identifier[cachedToken] operator[=] Other[null] operator[SEP] identifier[Session] identifier[oldSession] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[lock] operator[SEP] { Keyword[if] operator[SEP] identifier[userSetSession] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[userSetSession] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[session] operator[!=] Other[null] operator[SEP] operator[||] operator[!] identifier[sessionInvalidated] operator[SEP] { Keyword[return] identifier[session] operator[SEP] } identifier[cachedToken] operator[=] identifier[accessToken] operator[SEP] identifier[oldSession] operator[=] identifier[session] operator[SEP] } Keyword[if] operator[SEP] identifier[cachedToken] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[permissions] operator[SEP] Keyword[if] operator[SEP] identifier[oldSession] operator[!=] Other[null] operator[SEP] { identifier[permissions] operator[=] identifier[oldSession] operator[SEP] identifier[getPermissions] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[pendingAuthorizationPermissions] operator[!=] Other[null] operator[SEP] { identifier[permissions] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[pendingAuthorizationPermissions] operator[SEP] operator[SEP] } Keyword[else] { identifier[permissions] operator[=] identifier[Collections] operator[SEP] operator[<] identifier[String] operator[>] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } identifier[Session] identifier[newSession] operator[=] Keyword[new] identifier[Session] operator[SEP] identifier[Builder] operator[SEP] identifier[pendingAuthorizationActivity] operator[SEP] operator[SEP] identifier[setApplicationId] operator[SEP] identifier[mAppId] operator[SEP] operator[SEP] identifier[setTokenCachingStrategy] operator[SEP] identifier[getTokenCache] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newSession] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[!=] identifier[SessionState] operator[SEP] identifier[CREATED_TOKEN_LOADED] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Session] operator[SEP] identifier[OpenRequest] identifier[openRequest] operator[=] Keyword[new] identifier[Session] operator[SEP] identifier[OpenRequest] operator[SEP] identifier[pendingAuthorizationActivity] operator[SEP] operator[SEP] identifier[setPermissions] operator[SEP] identifier[permissions] operator[SEP] operator[SEP] identifier[openSession] operator[SEP] identifier[newSession] , identifier[openRequest] , operator[!] identifier[permissions] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Session] identifier[invalidatedSession] operator[=] Other[null] operator[SEP] identifier[Session] identifier[returnSession] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[lock] operator[SEP] { Keyword[if] operator[SEP] identifier[sessionInvalidated] operator[||] operator[SEP] identifier[session] operator[==] Other[null] operator[SEP] operator[SEP] { identifier[invalidatedSession] operator[=] identifier[session] operator[SEP] identifier[returnSession] operator[=] identifier[session] operator[=] identifier[newSession] operator[SEP] identifier[sessionInvalidated] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[invalidatedSession] operator[!=] Other[null] operator[SEP] { identifier[invalidatedSession] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[returnSession] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[returnSession] operator[SEP] } } }
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.RMI__INCRMENT: setINCRMENT(INCRMENT_EDEFAULT); return; } super.eUnset(featureID); }
class class_name[name] begin[{] method[eUnset, return_type[void], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=RMI__INCRMENT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INCRMENT_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setINCRMENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eUnset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eUnset] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[RMI__INCRMENT] operator[:] identifier[setINCRMENT] operator[SEP] identifier[INCRMENT_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eUnset] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
public void read(int length, OutputStream stream) throws IllegalStateException, IOException { stream.write(read(length)); }
class class_name[name] begin[{] method[read, return_type[void], modifier[public], parameter[length, stream]] begin[{] call[stream.write, parameter[call[.read, parameter[member[.length]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[read] operator[SEP] Keyword[int] identifier[length] , identifier[OutputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IllegalStateException] , identifier[IOException] { identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[read] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] }
public void setCommerceAccountOrganizationRelService( com.liferay.commerce.account.service.CommerceAccountOrganizationRelService commerceAccountOrganizationRelService) { this.commerceAccountOrganizationRelService = commerceAccountOrganizationRelService; }
class class_name[name] begin[{] method[setCommerceAccountOrganizationRelService, return_type[void], modifier[public], parameter[commerceAccountOrganizationRelService]] begin[{] assign[THIS[member[None.commerceAccountOrganizationRelService]], member[.commerceAccountOrganizationRelService]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCommerceAccountOrganizationRelService] operator[SEP] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[account] operator[SEP] identifier[service] operator[SEP] identifier[CommerceAccountOrganizationRelService] identifier[commerceAccountOrganizationRelService] operator[SEP] { Keyword[this] operator[SEP] identifier[commerceAccountOrganizationRelService] operator[=] identifier[commerceAccountOrganizationRelService] operator[SEP] }
private void requestPlayerDBServerPort(DeviceAnnouncement announcement) { Socket socket = null; try { InetSocketAddress address = new InetSocketAddress(announcement.getAddress(), DB_SERVER_QUERY_PORT); socket = new Socket(); socket.connect(address, socketTimeout.get()); InputStream is = socket.getInputStream(); OutputStream os = socket.getOutputStream(); socket.setSoTimeout(socketTimeout.get()); os.write(DB_SERVER_QUERY_PACKET); byte[] response = readResponseWithExpectedSize(is, 2, "database server port query packet"); if (response.length == 2) { setPlayerDBServerPort(announcement.getNumber(), (int)Util.bytesToNumber(response, 0, 2)); } } catch (java.net.ConnectException ce) { logger.info("Player " + announcement.getNumber() + " doesn't answer rekordbox port queries, connection refused. Won't attempt to request metadata."); } catch (Exception e) { logger.warn("Problem requesting database server port number", e); } finally { if (socket != null) { try { socket.close(); } catch (IOException e) { logger.warn("Problem closing database server port request socket", e); } } } }
class class_name[name] begin[{] method[requestPlayerDBServerPort, return_type[void], modifier[private], parameter[announcement]] begin[{] local_variable[type[Socket], socket] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAddress, postfix_operators=[], prefix_operators=[], qualifier=announcement, selectors=[], type_arguments=None), MemberReference(member=DB_SERVER_QUERY_PORT, 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=InetSocketAddress, sub_type=None)), name=address)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=socket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Socket, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=socketTimeout, selectors=[], type_arguments=None)], member=connect, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), name=is)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), name=os)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=socketTimeout, selectors=[], type_arguments=None)], member=setSoTimeout, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DB_SERVER_QUERY_PACKET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="database server port query packet")], member=readResponseWithExpectedSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=response)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNumber, postfix_operators=[], prefix_operators=[], qualifier=announcement, selectors=[], type_arguments=None), Cast(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=bytesToNumber, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))], member=setPlayerDBServerPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Player "), operandr=MethodInvocation(arguments=[], member=getNumber, postfix_operators=[], prefix_operators=[], qualifier=announcement, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" doesn't answer rekordbox port queries, connection refused. Won't attempt to request metadata."), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ce, types=['java.net.ConnectException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Problem requesting database server port number"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=socket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Problem closing database server port request socket"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, 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)]))], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[requestPlayerDBServerPort] operator[SEP] identifier[DeviceAnnouncement] identifier[announcement] operator[SEP] { identifier[Socket] identifier[socket] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[InetSocketAddress] identifier[address] operator[=] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[announcement] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] , identifier[DB_SERVER_QUERY_PORT] operator[SEP] operator[SEP] identifier[socket] operator[=] Keyword[new] identifier[Socket] operator[SEP] operator[SEP] operator[SEP] identifier[socket] operator[SEP] identifier[connect] operator[SEP] identifier[address] , identifier[socketTimeout] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[InputStream] identifier[is] operator[=] identifier[socket] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] identifier[OutputStream] identifier[os] operator[=] identifier[socket] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[socket] operator[SEP] identifier[setSoTimeout] operator[SEP] identifier[socketTimeout] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[os] operator[SEP] identifier[write] operator[SEP] identifier[DB_SERVER_QUERY_PACKET] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[response] operator[=] identifier[readResponseWithExpectedSize] operator[SEP] identifier[is] , Other[2] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { identifier[setPlayerDBServerPort] operator[SEP] identifier[announcement] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[Util] operator[SEP] identifier[bytesToNumber] operator[SEP] identifier[response] , Other[0] , Other[2] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[ConnectException] identifier[ce] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[announcement] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[socket] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[socket] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } }
@Override public void update(Sensor source, SensorData sd) { if (socket == null || oos == null) { return; } if (sd instanceof MicrophoneData) { MicrophoneData microphoneData = (MicrophoneData) sd; if (socket != null && socket.isConnected() && oos != null) { try { int totalSize = microphoneData.getData().length; int frameSize = microphoneData.getAudioFormat().getFrameSize(); byte[] data = new byte[totalSize]; System.arraycopy(microphoneData.getData(), 0, data, 0, totalSize); //int i = 0, j = 0, c = 0; for (int i = 0, j = 0, c = 0; i < newRated.length - 1 && j < data.length - 1; i += 2, j += 6/*10*/) { newRated[i] = data[j]; newRated[i + 1] = data[j + 1]; if (c > 2) { //j += 2; j -= 2; c = 0; } else { c++; } } //new AudioFormat(8000, 16, 1, true, false); //System.out.println(microphoneData.getAudioFormat()); for (int i = 1; i < newRated.length; i += 2) { if (random.nextBoolean()) { newRated[i]++; } } //System.out.println(totalSize+":"+newRated.length+":"+microphoneData.getAudioFormat().getSampleRate()); AudioStreamDataPacket asdp = new AudioStreamDataPacket(newRated, newRated.length / frameSize, frameSize); oos.writeObject(asdp); oos.flush(); oos.reset(); } catch (IOException e1) { Logger.getLogger(getClass().getSimpleName()).log(Level.SEVERE, null, e1); socket = null; oos = null; return; } } } }
class class_name[name] begin[{] method[update, return_type[void], modifier[public], parameter[source, sd]] begin[{] if[binary_operation[binary_operation[member[.socket], ==, literal[null]], ||, binary_operation[member[.oos], ==, literal[null]]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[member[.sd], instanceof, type[MicrophoneData]]] begin[{] local_variable[type[MicrophoneData], microphoneData] if[binary_operation[binary_operation[binary_operation[member[.socket], !=, literal[null]], &&, call[socket.isConnected, parameter[]]], &&, binary_operation[member[.oos], !=, literal[null]]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=microphoneData, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), name=totalSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAudioFormat, postfix_operators=[], prefix_operators=[], qualifier=microphoneData, selectors=[MethodInvocation(arguments=[], member=getFrameSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=frameSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=totalSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=data)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=microphoneData, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=totalSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newRated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=newRated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=newRated, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6))]), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=nextBoolean, postfix_operators=[], prefix_operators=[], qualifier=random, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=newRated, 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=newRated, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=newRated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=newRated, selectors=[]), operandr=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), MemberReference(member=frameSize, 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=AudioStreamDataPacket, sub_type=None)), name=asdp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AudioStreamDataPacket, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=asdp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=e1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=socket, 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=oos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[update] operator[SEP] identifier[Sensor] identifier[source] , identifier[SensorData] identifier[sd] operator[SEP] { Keyword[if] operator[SEP] identifier[socket] operator[==] Other[null] operator[||] identifier[oos] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[sd] Keyword[instanceof] identifier[MicrophoneData] operator[SEP] { identifier[MicrophoneData] identifier[microphoneData] operator[=] operator[SEP] identifier[MicrophoneData] operator[SEP] identifier[sd] operator[SEP] Keyword[if] operator[SEP] identifier[socket] operator[!=] Other[null] operator[&&] identifier[socket] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[&&] identifier[oos] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[int] identifier[totalSize] operator[=] identifier[microphoneData] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[frameSize] operator[=] identifier[microphoneData] operator[SEP] identifier[getAudioFormat] operator[SEP] operator[SEP] operator[SEP] identifier[getFrameSize] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[totalSize] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[microphoneData] operator[SEP] identifier[getData] operator[SEP] operator[SEP] , Other[0] , identifier[data] , Other[0] , identifier[totalSize] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[j] operator[=] Other[0] , identifier[c] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[newRated] operator[SEP] identifier[length] operator[-] Other[1] operator[&&] identifier[j] operator[<] identifier[data] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[+=] Other[2] , identifier[j] operator[+=] Other[6] operator[SEP] { identifier[newRated] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[data] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[newRated] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[=] identifier[data] operator[SEP] identifier[j] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>] Other[2] operator[SEP] { identifier[j] operator[-=] Other[2] operator[SEP] identifier[c] operator[=] Other[0] operator[SEP] } Keyword[else] { identifier[c] operator[++] operator[SEP] } } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[newRated] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] { Keyword[if] operator[SEP] identifier[random] operator[SEP] identifier[nextBoolean] operator[SEP] operator[SEP] operator[SEP] { identifier[newRated] operator[SEP] identifier[i] operator[SEP] operator[++] operator[SEP] } } identifier[AudioStreamDataPacket] identifier[asdp] operator[=] Keyword[new] identifier[AudioStreamDataPacket] operator[SEP] identifier[newRated] , identifier[newRated] operator[SEP] identifier[length] operator[/] identifier[frameSize] , identifier[frameSize] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[writeObject] operator[SEP] identifier[asdp] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e1] operator[SEP] { identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , Other[null] , identifier[e1] operator[SEP] operator[SEP] identifier[socket] operator[=] Other[null] operator[SEP] identifier[oos] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } } } }
final boolean addReference(final JNIReference ref) { /* Implementation note: This method is extremely * hot, and so I've unrolled the lock and unlock * methods from above. Take care if you change * them to change the unrolled versions here. * */ // First try to grab the non blocking lock boolean gotNonblockingLock = false; gotNonblockingLock = mSpinLock.compareAndSet(false, true); if (gotNonblockingLock) { final int slot = mNextAvailableReferenceSlot++; if (slot < mMaxValidReference) { mValidReferences[slot] = ref; // unlock the non-blocking lock, and progress to a full lock. final boolean result = mSpinLock.compareAndSet(true, false); assert result : "Should never be unlocked here"; return true; } // try the big lock without blocking if (!mLock.tryLock()) { // we couldn't get the big lock, so release the spin lock // and try getting the bit lock while blocking gotNonblockingLock = false; mSpinLock.compareAndSet(true, false); } } // The above code needs to make sure that we never // have gotNonblockingLock set, unless we have both // the spin lock and the big lock. if (!gotNonblockingLock){ mLock.lock(); while(!mSpinLock.compareAndSet(false, true)) ; // grab the spin lock } try { int slot = mNextAvailableReferenceSlot++; if (slot >= mMaxValidReference) { sweepAndCollect(); slot = mNextAvailableReferenceSlot++; } mValidReferences[slot] = ref; } finally { final boolean result = mSpinLock.compareAndSet(true, false); assert result : "Should never ever be unlocked here"; mLock.unlock(); } return true; }
class class_name[name] begin[{] method[addReference, return_type[type[boolean]], modifier[final], parameter[ref]] begin[{] local_variable[type[boolean], gotNonblockingLock] assign[member[.gotNonblockingLock], call[mSpinLock.compareAndSet, parameter[literal[false], literal[true]]]] if[member[.gotNonblockingLock]] begin[{] local_variable[type[int], slot] if[binary_operation[member[.slot], <, member[.mMaxValidReference]]] begin[{] assign[member[.mValidReferences], member[.ref]] local_variable[type[boolean], result] AssertStatement(condition=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Should never be unlocked here")) return[literal[true]] else begin[{] None end[}] if[call[mLock.tryLock, parameter[]]] begin[{] assign[member[.gotNonblockingLock], literal[false]] call[mSpinLock.compareAndSet, parameter[literal[true], literal[false]]] else begin[{] None end[}] else begin[{] None end[}] if[member[.gotNonblockingLock]] begin[{] call[mLock.lock, parameter[]] while[call[mSpinLock.compareAndSet, parameter[literal[false], literal[true]]]] begin[{] Statement(label=None) end[}] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=mNextAvailableReferenceSlot, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), name=slot)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mMaxValidReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=sweepAndCollect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=mNextAvailableReferenceSlot, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mValidReferences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=compareAndSet, postfix_operators=[], prefix_operators=[], qualifier=mSpinLock, selectors=[], type_arguments=None), name=result)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), AssertStatement(condition=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Should never ever be unlocked here")), StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=mLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[literal[true]] end[}] END[}]
Keyword[final] Keyword[boolean] identifier[addReference] operator[SEP] Keyword[final] identifier[JNIReference] identifier[ref] operator[SEP] { Keyword[boolean] identifier[gotNonblockingLock] operator[=] literal[boolean] operator[SEP] identifier[gotNonblockingLock] operator[=] identifier[mSpinLock] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gotNonblockingLock] operator[SEP] { Keyword[final] Keyword[int] identifier[slot] operator[=] identifier[mNextAvailableReferenceSlot] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[slot] operator[<] identifier[mMaxValidReference] operator[SEP] { identifier[mValidReferences] operator[SEP] identifier[slot] operator[SEP] operator[=] identifier[ref] operator[SEP] Keyword[final] Keyword[boolean] identifier[result] operator[=] identifier[mSpinLock] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[assert] identifier[result] operator[:] literal[String] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[mLock] operator[SEP] identifier[tryLock] operator[SEP] operator[SEP] operator[SEP] { identifier[gotNonblockingLock] operator[=] literal[boolean] operator[SEP] identifier[mSpinLock] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[gotNonblockingLock] operator[SEP] { identifier[mLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[mSpinLock] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { Keyword[int] identifier[slot] operator[=] identifier[mNextAvailableReferenceSlot] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[slot] operator[>=] identifier[mMaxValidReference] operator[SEP] { identifier[sweepAndCollect] operator[SEP] operator[SEP] operator[SEP] identifier[slot] operator[=] identifier[mNextAvailableReferenceSlot] operator[++] operator[SEP] } identifier[mValidReferences] operator[SEP] identifier[slot] operator[SEP] operator[=] identifier[ref] operator[SEP] } Keyword[finally] { Keyword[final] Keyword[boolean] identifier[result] operator[=] identifier[mSpinLock] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[assert] identifier[result] operator[:] literal[String] operator[SEP] identifier[mLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Override public Request<DescribeImageAttributeRequest> getDryRunRequest() { Request<DescribeImageAttributeRequest> request = new DescribeImageAttributeRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
class class_name[name] begin[{] method[getDryRunRequest, return_type[type[Request]], modifier[public], parameter[]] begin[{] local_variable[type[Request], request] call[request.addParameter, parameter[literal["DryRun"], call[Boolean.toString, parameter[literal[true]]]]] return[member[.request]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Request] operator[<] identifier[DescribeImageAttributeRequest] operator[>] identifier[getDryRunRequest] operator[SEP] operator[SEP] { identifier[Request] operator[<] identifier[DescribeImageAttributeRequest] operator[>] identifier[request] operator[=] Keyword[new] identifier[DescribeImageAttributeRequestMarshaller] operator[SEP] operator[SEP] operator[SEP] identifier[marshall] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[addParameter] operator[SEP] literal[String] , identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[request] operator[SEP] }
public static void tileImage (Graphics2D gfx, Mirage image, int x, int y, int width, int height) { int iwidth = image.getWidth(), iheight = image.getHeight(); int xnum = width / iwidth, xplus = width % iwidth; int ynum = height / iheight, yplus = height % iheight; Shape oclip = gfx.getClip(); for (int ii=0; ii < ynum; ii++) { // draw the full copies of the image across int xx = x; for (int jj=0; jj < xnum; jj++) { image.paint(gfx, xx, y); xx += iwidth; } if (xplus > 0) { gfx.clipRect(xx, y, xplus, iheight); image.paint(gfx, xx, y); gfx.setClip(oclip); } y += iheight; } if (yplus > 0) { int xx = x; for (int jj=0; jj < xnum; jj++) { gfx.clipRect(xx, y, iwidth, yplus); image.paint(gfx, xx, y); gfx.setClip(oclip); xx += iwidth; } if (xplus > 0) { gfx.clipRect(xx, y, xplus, yplus); image.paint(gfx, xx, y); gfx.setClip(oclip); } } }
class class_name[name] begin[{] method[tileImage, return_type[void], modifier[public static], parameter[gfx, image, x, y, width, height]] begin[{] local_variable[type[int], iwidth] local_variable[type[int], xnum] local_variable[type[int], ynum] local_variable[type[Shape], oclip] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=xx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gfx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=paint, postfix_operators=[], prefix_operators=[], qualifier=image, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=iwidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=jj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xnum, 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=jj)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=jj, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xplus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xplus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iheight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clipRect, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gfx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=paint, postfix_operators=[], prefix_operators=[], qualifier=image, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oclip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setClip, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=iheight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ynum, 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=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.yplus], >, literal[0]]] begin[{] local_variable[type[int], xx] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iwidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=yplus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clipRect, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gfx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=paint, postfix_operators=[], prefix_operators=[], qualifier=image, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oclip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setClip, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=iwidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=jj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xnum, 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=jj)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=jj, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.xplus], >, literal[0]]] begin[{] call[gfx.clipRect, parameter[member[.xx], member[.y], member[.xplus], member[.yplus]]] call[image.paint, parameter[member[.gfx], member[.xx], member[.y]]] call[gfx.setClip, parameter[member[.oclip]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[tileImage] operator[SEP] identifier[Graphics2D] identifier[gfx] , identifier[Mirage] identifier[image] , Keyword[int] identifier[x] , Keyword[int] identifier[y] , Keyword[int] identifier[width] , Keyword[int] identifier[height] operator[SEP] { Keyword[int] identifier[iwidth] operator[=] identifier[image] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , identifier[iheight] operator[=] identifier[image] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[xnum] operator[=] identifier[width] operator[/] identifier[iwidth] , identifier[xplus] operator[=] identifier[width] operator[%] identifier[iwidth] operator[SEP] Keyword[int] identifier[ynum] operator[=] identifier[height] operator[/] identifier[iheight] , identifier[yplus] operator[=] identifier[height] operator[%] identifier[iheight] operator[SEP] identifier[Shape] identifier[oclip] operator[=] identifier[gfx] operator[SEP] identifier[getClip] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] operator[SEP] identifier[ii] operator[<] identifier[ynum] operator[SEP] identifier[ii] operator[++] operator[SEP] { Keyword[int] identifier[xx] operator[=] identifier[x] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[jj] operator[=] Other[0] operator[SEP] identifier[jj] operator[<] identifier[xnum] operator[SEP] identifier[jj] operator[++] operator[SEP] { identifier[image] operator[SEP] identifier[paint] operator[SEP] identifier[gfx] , identifier[xx] , identifier[y] operator[SEP] operator[SEP] identifier[xx] operator[+=] identifier[iwidth] operator[SEP] } Keyword[if] operator[SEP] identifier[xplus] operator[>] Other[0] operator[SEP] { identifier[gfx] operator[SEP] identifier[clipRect] operator[SEP] identifier[xx] , identifier[y] , identifier[xplus] , identifier[iheight] operator[SEP] operator[SEP] identifier[image] operator[SEP] identifier[paint] operator[SEP] identifier[gfx] , identifier[xx] , identifier[y] operator[SEP] operator[SEP] identifier[gfx] operator[SEP] identifier[setClip] operator[SEP] identifier[oclip] operator[SEP] operator[SEP] } identifier[y] operator[+=] identifier[iheight] operator[SEP] } Keyword[if] operator[SEP] identifier[yplus] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[xx] operator[=] identifier[x] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[jj] operator[=] Other[0] operator[SEP] identifier[jj] operator[<] identifier[xnum] operator[SEP] identifier[jj] operator[++] operator[SEP] { identifier[gfx] operator[SEP] identifier[clipRect] operator[SEP] identifier[xx] , identifier[y] , identifier[iwidth] , identifier[yplus] operator[SEP] operator[SEP] identifier[image] operator[SEP] identifier[paint] operator[SEP] identifier[gfx] , identifier[xx] , identifier[y] operator[SEP] operator[SEP] identifier[gfx] operator[SEP] identifier[setClip] operator[SEP] identifier[oclip] operator[SEP] operator[SEP] identifier[xx] operator[+=] identifier[iwidth] operator[SEP] } Keyword[if] operator[SEP] identifier[xplus] operator[>] Other[0] operator[SEP] { identifier[gfx] operator[SEP] identifier[clipRect] operator[SEP] identifier[xx] , identifier[y] , identifier[xplus] , identifier[yplus] operator[SEP] operator[SEP] identifier[image] operator[SEP] identifier[paint] operator[SEP] identifier[gfx] , identifier[xx] , identifier[y] operator[SEP] operator[SEP] identifier[gfx] operator[SEP] identifier[setClip] operator[SEP] identifier[oclip] operator[SEP] operator[SEP] } } }
public MethodCall with(String name1, Object arg1, String name2, Object arg2) { return with(name1, arg1, name2, arg2, null, null); }
class class_name[name] begin[{] method[with, return_type[type[MethodCall]], modifier[public], parameter[name1, arg1, name2, arg2]] begin[{] return[call[.with, parameter[member[.name1], member[.arg1], member[.name2], member[.arg2], literal[null], literal[null]]]] end[}] END[}]
Keyword[public] identifier[MethodCall] identifier[with] operator[SEP] identifier[String] identifier[name1] , identifier[Object] identifier[arg1] , identifier[String] identifier[name2] , identifier[Object] identifier[arg2] operator[SEP] { Keyword[return] identifier[with] operator[SEP] identifier[name1] , identifier[arg1] , identifier[name2] , identifier[arg2] , Other[null] , Other[null] operator[SEP] operator[SEP] }
public static List<CommerceOrderItem> findByC_I(long commerceOrderId, long CPInstanceId, int start, int end, OrderByComparator<CommerceOrderItem> orderByComparator, boolean retrieveFromCache) { return getPersistence() .findByC_I(commerceOrderId, CPInstanceId, start, end, orderByComparator, retrieveFromCache); }
class class_name[name] begin[{] method[findByC_I, return_type[type[List]], modifier[public static], parameter[commerceOrderId, CPInstanceId, start, end, orderByComparator, retrieveFromCache]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[CommerceOrderItem] operator[>] identifier[findByC_I] operator[SEP] Keyword[long] identifier[commerceOrderId] , Keyword[long] identifier[CPInstanceId] , Keyword[int] identifier[start] , Keyword[int] identifier[end] , identifier[OrderByComparator] operator[<] identifier[CommerceOrderItem] operator[>] identifier[orderByComparator] , Keyword[boolean] identifier[retrieveFromCache] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByC_I] operator[SEP] identifier[commerceOrderId] , identifier[CPInstanceId] , identifier[start] , identifier[end] , identifier[orderByComparator] , identifier[retrieveFromCache] operator[SEP] operator[SEP] }
public String getresp_next(int maxbytes) throws SoccomException { int n; String msg; try { if (_resp_size == -1) { if (maxbytes==0) { msg = readLine(_in, 1024); if (msg.startsWith(_endm)) { _resp_read = -1; msg = ""; } else _resp_read += msg.length(); } else { byte[] buffer = new byte[maxbytes]; int k=0; boolean done = false; while (!done && k<maxbytes) { n = readLine(_in, buffer, k, maxbytes); if (n==5 && _endm.equals(new String(buffer,k,4))) { done = true; } else k += n; } if (done) _resp_read = -1; else _resp_read += k; msg = new String(buffer,0,k); } } else { if (maxbytes==0) { msg = readLine(_in, _resp_size-_resp_read); _resp_read += msg.length(); } else { byte[] buffer = new byte[maxbytes]; if (_resp_size - _resp_read <= maxbytes) { n = _resp_size - _resp_read; } else n = maxbytes; n = _in.read(buffer, 0, n); if (n>=0) _resp_read += n; else if (n==-1) throw new SoccomException(SoccomException.SOCKET_CLOSED); else throw new SoccomException(SoccomException.RECV_ERROR); msg = new String(buffer, 0, n); } } logline("RECV MSG: " + msg); return msg; } catch (InterruptedIOException e) { throw new SoccomException(SoccomException.RECV_ERROR); } catch (IOException e) { throw new SoccomException(SoccomException.RECV_ERROR); } }
class class_name[name] begin[{] method[getresp_next, return_type[type[String]], modifier[public], parameter[maxbytes]] begin[{] local_variable[type[int], n] local_variable[type[String], msg] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_resp_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buffer)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=_resp_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_resp_read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=_resp_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_resp_read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=_in, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=RECV_ERROR, postfix_operators=[], prefix_operators=[], qualifier=SoccomException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SoccomException, sub_type=None)), label=None), label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=SOCKET_CLOSED, postfix_operators=[], prefix_operators=[], qualifier=SoccomException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SoccomException, sub_type=None)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=_resp_read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=_in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=_resp_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_resp_read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_resp_read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buffer)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=done)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=_in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator===), operandr=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=_endm, selectors=[], type_arguments=None), operator=&&), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), condition=BinaryOperation(operandl=MemberReference(member=done, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), label=None), IfStatement(condition=MemberReference(member=done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=_resp_read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=_resp_read, 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=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=_in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024)], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=_endm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=_resp_read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_resp_read, 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=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")), label=None)]))]))])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="RECV MSG: "), operandr=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=logline, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=RECV_ERROR, postfix_operators=[], prefix_operators=[], qualifier=SoccomException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SoccomException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedIOException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=RECV_ERROR, postfix_operators=[], prefix_operators=[], qualifier=SoccomException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SoccomException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[getresp_next] operator[SEP] Keyword[int] identifier[maxbytes] operator[SEP] Keyword[throws] identifier[SoccomException] { Keyword[int] identifier[n] operator[SEP] identifier[String] identifier[msg] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[_resp_size] operator[==] operator[-] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[maxbytes] operator[==] Other[0] operator[SEP] { identifier[msg] operator[=] identifier[readLine] operator[SEP] identifier[_in] , Other[1024] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msg] operator[SEP] identifier[startsWith] operator[SEP] identifier[_endm] operator[SEP] operator[SEP] { identifier[_resp_read] operator[=] operator[-] Other[1] operator[SEP] identifier[msg] operator[=] literal[String] operator[SEP] } Keyword[else] identifier[_resp_read] operator[+=] identifier[msg] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[maxbytes] operator[SEP] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[done] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[done] operator[&&] identifier[k] operator[<] identifier[maxbytes] operator[SEP] { identifier[n] operator[=] identifier[readLine] operator[SEP] identifier[_in] , identifier[buffer] , identifier[k] , identifier[maxbytes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[5] operator[&&] identifier[_endm] operator[SEP] identifier[equals] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[buffer] , identifier[k] , Other[4] operator[SEP] operator[SEP] operator[SEP] { identifier[done] operator[=] literal[boolean] operator[SEP] } Keyword[else] identifier[k] operator[+=] identifier[n] operator[SEP] } Keyword[if] operator[SEP] identifier[done] operator[SEP] identifier[_resp_read] operator[=] operator[-] Other[1] operator[SEP] Keyword[else] identifier[_resp_read] operator[+=] identifier[k] operator[SEP] identifier[msg] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[buffer] , Other[0] , identifier[k] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[maxbytes] operator[==] Other[0] operator[SEP] { identifier[msg] operator[=] identifier[readLine] operator[SEP] identifier[_in] , identifier[_resp_size] operator[-] identifier[_resp_read] operator[SEP] operator[SEP] identifier[_resp_read] operator[+=] identifier[msg] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[maxbytes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_resp_size] operator[-] identifier[_resp_read] operator[<=] identifier[maxbytes] operator[SEP] { identifier[n] operator[=] identifier[_resp_size] operator[-] identifier[_resp_read] operator[SEP] } Keyword[else] identifier[n] operator[=] identifier[maxbytes] operator[SEP] identifier[n] operator[=] identifier[_in] operator[SEP] identifier[read] operator[SEP] identifier[buffer] , Other[0] , identifier[n] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[>=] Other[0] operator[SEP] identifier[_resp_read] operator[+=] identifier[n] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[n] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[SoccomException] operator[SEP] identifier[SoccomException] operator[SEP] identifier[SOCKET_CLOSED] operator[SEP] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[SoccomException] operator[SEP] identifier[SoccomException] operator[SEP] identifier[RECV_ERROR] operator[SEP] operator[SEP] identifier[msg] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[buffer] , Other[0] , identifier[n] operator[SEP] operator[SEP] } } identifier[logline] operator[SEP] literal[String] operator[+] identifier[msg] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedIOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SoccomException] operator[SEP] identifier[SoccomException] operator[SEP] identifier[RECV_ERROR] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SoccomException] operator[SEP] identifier[SoccomException] operator[SEP] identifier[RECV_ERROR] operator[SEP] operator[SEP] } }
@Override public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException { this.weights = new HashMap<>(); INDArray W; if (weights.containsKey(conf.getKERAS_PARAM_NAME_W())) W = weights.get(conf.getKERAS_PARAM_NAME_W()); else throw new InvalidKerasConfigurationException( "Keras SimpleRNN layer does not contain parameter " + conf.getKERAS_PARAM_NAME_W()); this.weights.put(SimpleRnnParamInitializer.WEIGHT_KEY, W); INDArray RW; if (weights.containsKey(conf.getKERAS_PARAM_NAME_RW())) RW = weights.get(conf.getKERAS_PARAM_NAME_RW()); else throw new InvalidKerasConfigurationException( "Keras SimpleRNN layer does not contain parameter " + conf.getKERAS_PARAM_NAME_RW()); this.weights.put(SimpleRnnParamInitializer.RECURRENT_WEIGHT_KEY, RW); INDArray b; if (weights.containsKey(conf.getKERAS_PARAM_NAME_B())) b = weights.get(conf.getKERAS_PARAM_NAME_B()); else throw new InvalidKerasConfigurationException( "Keras SimpleRNN layer does not contain parameter " + conf.getKERAS_PARAM_NAME_B()); this.weights.put(SimpleRnnParamInitializer.BIAS_KEY, b); if (weights.size() > NUM_TRAINABLE_PARAMS) { Set<String> paramNames = weights.keySet(); paramNames.remove(conf.getKERAS_PARAM_NAME_B()); paramNames.remove(conf.getKERAS_PARAM_NAME_W()); paramNames.remove(conf.getKERAS_PARAM_NAME_RW()); String unknownParamNames = paramNames.toString(); log.warn("Attemping to set weights for unknown parameters: " + unknownParamNames.substring(1, unknownParamNames.length() - 1)); } }
class class_name[name] begin[{] method[setWeights, return_type[void], modifier[public], parameter[weights]] begin[{] assign[THIS[member[None.weights]], 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))] local_variable[type[INDArray], W] if[call[weights.containsKey, parameter[call[conf.getKERAS_PARAM_NAME_W, parameter[]]]]] begin[{] assign[member[.W], call[weights.get, parameter[call[conf.getKERAS_PARAM_NAME_W, parameter[]]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Keras SimpleRNN layer does not contain parameter "), operandr=MethodInvocation(arguments=[], member=getKERAS_PARAM_NAME_W, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidKerasConfigurationException, sub_type=None)), label=None) end[}] THIS[member[None.weights]call[None.put, parameter[member[SimpleRnnParamInitializer.WEIGHT_KEY], member[.W]]]] local_variable[type[INDArray], RW] if[call[weights.containsKey, parameter[call[conf.getKERAS_PARAM_NAME_RW, parameter[]]]]] begin[{] assign[member[.RW], call[weights.get, parameter[call[conf.getKERAS_PARAM_NAME_RW, parameter[]]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Keras SimpleRNN layer does not contain parameter "), operandr=MethodInvocation(arguments=[], member=getKERAS_PARAM_NAME_RW, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidKerasConfigurationException, sub_type=None)), label=None) end[}] THIS[member[None.weights]call[None.put, parameter[member[SimpleRnnParamInitializer.RECURRENT_WEIGHT_KEY], member[.RW]]]] local_variable[type[INDArray], b] if[call[weights.containsKey, parameter[call[conf.getKERAS_PARAM_NAME_B, parameter[]]]]] begin[{] assign[member[.b], call[weights.get, parameter[call[conf.getKERAS_PARAM_NAME_B, parameter[]]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Keras SimpleRNN layer does not contain parameter "), operandr=MethodInvocation(arguments=[], member=getKERAS_PARAM_NAME_B, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidKerasConfigurationException, sub_type=None)), label=None) end[}] THIS[member[None.weights]call[None.put, parameter[member[SimpleRnnParamInitializer.BIAS_KEY], member[.b]]]] if[binary_operation[call[weights.size, parameter[]], >, member[.NUM_TRAINABLE_PARAMS]]] begin[{] local_variable[type[Set], paramNames] call[paramNames.remove, parameter[call[conf.getKERAS_PARAM_NAME_B, parameter[]]]] call[paramNames.remove, parameter[call[conf.getKERAS_PARAM_NAME_W, parameter[]]]] call[paramNames.remove, parameter[call[conf.getKERAS_PARAM_NAME_RW, parameter[]]]] local_variable[type[String], unknownParamNames] call[log.warn, parameter[binary_operation[literal["Attemping to set weights for unknown parameters: "], +, call[unknownParamNames.substring, parameter[literal[1], binary_operation[call[unknownParamNames.length, parameter[]], -, literal[1]]]]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setWeights] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[INDArray] operator[>] identifier[weights] operator[SEP] Keyword[throws] identifier[InvalidKerasConfigurationException] { Keyword[this] operator[SEP] identifier[weights] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[INDArray] identifier[W] operator[SEP] Keyword[if] operator[SEP] identifier[weights] operator[SEP] identifier[containsKey] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_W] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[W] operator[=] identifier[weights] operator[SEP] identifier[get] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_W] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[InvalidKerasConfigurationException] operator[SEP] literal[String] operator[+] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_W] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[weights] operator[SEP] identifier[put] operator[SEP] identifier[SimpleRnnParamInitializer] operator[SEP] identifier[WEIGHT_KEY] , identifier[W] operator[SEP] operator[SEP] identifier[INDArray] identifier[RW] operator[SEP] Keyword[if] operator[SEP] identifier[weights] operator[SEP] identifier[containsKey] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_RW] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[RW] operator[=] identifier[weights] operator[SEP] identifier[get] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_RW] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[InvalidKerasConfigurationException] operator[SEP] literal[String] operator[+] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_RW] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[weights] operator[SEP] identifier[put] operator[SEP] identifier[SimpleRnnParamInitializer] operator[SEP] identifier[RECURRENT_WEIGHT_KEY] , identifier[RW] operator[SEP] operator[SEP] identifier[INDArray] identifier[b] operator[SEP] Keyword[if] operator[SEP] identifier[weights] operator[SEP] identifier[containsKey] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_B] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[weights] operator[SEP] identifier[get] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_B] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[InvalidKerasConfigurationException] operator[SEP] literal[String] operator[+] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_B] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[weights] operator[SEP] identifier[put] operator[SEP] identifier[SimpleRnnParamInitializer] operator[SEP] identifier[BIAS_KEY] , identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[weights] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] identifier[NUM_TRAINABLE_PARAMS] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[paramNames] operator[=] identifier[weights] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[paramNames] operator[SEP] identifier[remove] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_B] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramNames] operator[SEP] identifier[remove] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_W] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramNames] operator[SEP] identifier[remove] operator[SEP] identifier[conf] operator[SEP] identifier[getKERAS_PARAM_NAME_RW] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[unknownParamNames] operator[=] identifier[paramNames] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[unknownParamNames] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[unknownParamNames] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } }
public <K2 extends K, E2 extends E> BlockingListMaker<K2, E2> listenForElements(Listener<K2, E2> listener) { @SuppressWarnings("unchecked") BlockingListMaker<K2, E2> stricterThis = (BlockingListMaker<K2, E2>) this; stricterThis.setListener(listener); return stricterThis; }
class class_name[name] begin[{] method[listenForElements, return_type[type[BlockingListMaker]], modifier[public], parameter[listener]] begin[{] local_variable[type[BlockingListMaker], stricterThis] call[stricterThis.setListener, parameter[member[.listener]]] return[member[.stricterThis]] end[}] END[}]
Keyword[public] operator[<] identifier[K2] Keyword[extends] identifier[K] , identifier[E2] Keyword[extends] identifier[E] operator[>] identifier[BlockingListMaker] operator[<] identifier[K2] , identifier[E2] operator[>] identifier[listenForElements] operator[SEP] identifier[Listener] operator[<] identifier[K2] , identifier[E2] operator[>] identifier[listener] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[BlockingListMaker] operator[<] identifier[K2] , identifier[E2] operator[>] identifier[stricterThis] operator[=] operator[SEP] identifier[BlockingListMaker] operator[<] identifier[K2] , identifier[E2] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[stricterThis] operator[SEP] identifier[setListener] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[return] identifier[stricterThis] operator[SEP] }
public void closeAllPlatforms() { log.log(Level.FINEST, "Closing all Vert.x instances"); try { for (Map.Entry<String, Vertx> entry : this.vertxPlatforms.entrySet()) { stopVertx(entry.getValue()); } vertxPlatforms.clear(); vertxHolders.clear(); } catch (Exception e) { log.log(Level.SEVERE, "Error closing Vert.x instance", e.getCause()); } }
class class_name[name] begin[{] method[closeAllPlatforms, return_type[void], modifier[public], parameter[]] begin[{] call[log.log, parameter[member[Level.FINEST], literal["Closing all Vert.x instances"]]] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=stopVertx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=vertxPlatforms, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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=Vertx, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=vertxPlatforms, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=vertxHolders, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error closing Vert.x instance"), MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=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[closeAllPlatforms] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Vertx] operator[>] identifier[entry] operator[:] Keyword[this] operator[SEP] identifier[vertxPlatforms] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[stopVertx] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[vertxPlatforms] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[vertxHolders] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SimpleExpressionsPackage.BOOLEAN_LITERAL__VALUE: setValue((Boolean)newValue); return; } super.eSet(featureID, newValue); }
class class_name[name] begin[{] method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BOOLEAN_LITERAL__VALUE, postfix_operators=[], prefix_operators=[], qualifier=SimpleExpressionsPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[SimpleExpressionsPackage] operator[SEP] identifier[BOOLEAN_LITERAL__VALUE] operator[:] identifier[setValue] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP] }
protected String elementAsString(XMLStreamReader reader, String key, Map<String, String> expressions) throws XMLStreamException { String elementtext = rawElementText(reader); if (key != null && expressions != null && elementtext != null && elementtext.indexOf("${") != -1) expressions.put(key, elementtext); return getSubstitutionValue(elementtext); }
class class_name[name] begin[{] method[elementAsString, return_type[type[String]], modifier[protected], parameter[reader, key, expressions]] begin[{] local_variable[type[String], elementtext] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.key], !=, literal[null]], &&, binary_operation[member[.expressions], !=, literal[null]]], &&, binary_operation[member[.elementtext], !=, literal[null]]], &&, binary_operation[call[elementtext.indexOf, parameter[literal["${"]]], !=, literal[1]]]] begin[{] call[expressions.put, parameter[member[.key], member[.elementtext]]] else begin[{] None end[}] return[call[.getSubstitutionValue, parameter[member[.elementtext]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[elementAsString] operator[SEP] identifier[XMLStreamReader] identifier[reader] , identifier[String] identifier[key] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[expressions] operator[SEP] Keyword[throws] identifier[XMLStreamException] { identifier[String] identifier[elementtext] operator[=] identifier[rawElementText] operator[SEP] identifier[reader] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[!=] Other[null] operator[&&] identifier[expressions] operator[!=] Other[null] operator[&&] identifier[elementtext] operator[!=] Other[null] operator[&&] identifier[elementtext] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] identifier[expressions] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[elementtext] operator[SEP] operator[SEP] Keyword[return] identifier[getSubstitutionValue] operator[SEP] identifier[elementtext] operator[SEP] operator[SEP] }
@Override public boolean isAuthzInfoAvailableForApp(String appName) { return (ManagementSecurityConstants.ADMIN_RESOURCE_NAME.equals(appName) == true ? true : false); }
class class_name[name] begin[{] method[isAuthzInfoAvailableForApp, return_type[type[boolean]], modifier[public], parameter[appName]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=appName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ManagementSecurityConstants.ADMIN_RESOURCE_NAME, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isAuthzInfoAvailableForApp] operator[SEP] identifier[String] identifier[appName] operator[SEP] { Keyword[return] operator[SEP] identifier[ManagementSecurityConstants] operator[SEP] identifier[ADMIN_RESOURCE_NAME] operator[SEP] identifier[equals] operator[SEP] identifier[appName] operator[SEP] operator[==] literal[boolean] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] operator[SEP] }
public OvhTaskFilter domain_account_accountName_filter_name_rule_POST(String domain, String accountName, String name, String header, OvhDomainFilterOperandEnum operand, String value) throws IOException { String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/rule"; StringBuilder sb = path(qPath, domain, accountName, name); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "header", header); addBody(o, "operand", operand); addBody(o, "value", value); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhTaskFilter.class); }
class class_name[name] begin[{] method[domain_account_accountName_filter_name_rule_POST, return_type[type[OvhTaskFilter]], modifier[public], parameter[domain, accountName, name, header, operand, value]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["header"], member[.header]]] call[.addBody, parameter[member[.o], literal["operand"], member[.operand]]] call[.addBody, parameter[member[.o], literal["value"], member[.value]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhTaskFilter, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhTaskFilter] identifier[domain_account_accountName_filter_name_rule_POST] operator[SEP] identifier[String] identifier[domain] , identifier[String] identifier[accountName] , identifier[String] identifier[name] , identifier[String] identifier[header] , identifier[OvhDomainFilterOperandEnum] identifier[operand] , identifier[String] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[domain] , identifier[accountName] , identifier[name] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[header] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[operand] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[value] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhTaskFilter] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
private <T extends AlipayResponse> RequestParametersHolder getRequestHolderWithSign(AlipayRequest<?> request, String accessToken, String appAuthToken) throws AlipayApiException { RequestParametersHolder requestHolder = new RequestParametersHolder(); AlipayHashMap appParams = new AlipayHashMap(request.getTextParams()); // 仅当API包含biz_content参数且值为空时,序列化bizModel填充bizContent try { if (request.getClass().getMethod("getBizContent") != null && StringUtils.isEmpty(appParams.get(AlipayConstants.BIZ_CONTENT_KEY)) && request.getBizModel() != null) { appParams.put(AlipayConstants.BIZ_CONTENT_KEY, new JSONWriter().write(request.getBizModel(), true)); } } catch (NoSuchMethodException e) { // 找不到getBizContent则什么都不做 } catch (SecurityException e) { AlipayLogger.logBizError(e); } // 只有新接口和设置密钥才能支持加密 if (request.isNeedEncrypt()) { if (StringUtils.isEmpty(appParams.get(AlipayConstants.BIZ_CONTENT_KEY))) { throw new AlipayApiException("当前API不支持加密请求"); } // 需要加密必须设置密钥和加密算法 if (!StringUtils.areNotEmpty(this.encryptKey, this.encryptType)) { throw new AlipayApiException("API请求要求加密,则必须设置密钥和密钥类型:encryptKey=" + encryptKey + ",encryptType=" + encryptType); } String encryptContent = AlipayEncrypt.encryptContent( appParams.get(AlipayConstants.BIZ_CONTENT_KEY), this.encryptType, this.encryptKey, this.charset); appParams.put(AlipayConstants.BIZ_CONTENT_KEY, encryptContent); } if (!StringUtils.isEmpty(appAuthToken)) { appParams.put(AlipayConstants.APP_AUTH_TOKEN, appAuthToken); } requestHolder.setApplicationParams(appParams); if (StringUtils.isEmpty(charset)) { charset = AlipayConstants.CHARSET_UTF8; } AlipayHashMap protocalMustParams = new AlipayHashMap(); protocalMustParams.put(AlipayConstants.METHOD, request.getApiMethodName()); protocalMustParams.put(AlipayConstants.VERSION, request.getApiVersion()); protocalMustParams.put(AlipayConstants.APP_ID, this.appId); protocalMustParams.put(AlipayConstants.SIGN_TYPE, this.signType); protocalMustParams.put(AlipayConstants.TERMINAL_TYPE, request.getTerminalType()); protocalMustParams.put(AlipayConstants.TERMINAL_INFO, request.getTerminalInfo()); protocalMustParams.put(AlipayConstants.NOTIFY_URL, request.getNotifyUrl()); protocalMustParams.put(AlipayConstants.RETURN_URL, request.getReturnUrl()); protocalMustParams.put(AlipayConstants.CHARSET, charset); if (request.isNeedEncrypt()) { protocalMustParams.put(AlipayConstants.ENCRYPT_TYPE, this.encryptType); } Long timestamp = System.currentTimeMillis(); DateFormat df = new SimpleDateFormat(AlipayConstants.DATE_TIME_FORMAT); df.setTimeZone(TimeZone.getTimeZone(AlipayConstants.DATE_TIMEZONE)); protocalMustParams.put(AlipayConstants.TIMESTAMP, df.format(new Date(timestamp))); requestHolder.setProtocalMustParams(protocalMustParams); AlipayHashMap protocalOptParams = new AlipayHashMap(); protocalOptParams.put(AlipayConstants.FORMAT, format); protocalOptParams.put(AlipayConstants.ACCESS_TOKEN, accessToken); protocalOptParams.put(AlipayConstants.ALIPAY_SDK, AlipayConstants.SDK_VERSION); protocalOptParams.put(AlipayConstants.PROD_CODE, request.getProdCode()); requestHolder.setProtocalOptParams(protocalOptParams); if (!StringUtils.isEmpty(this.signType)) { String signContent = AlipaySignature.getSignatureContent(requestHolder); protocalMustParams.put(AlipayConstants.SIGN, AlipaySignature.rsaSign(signContent, privateKey, charset, this.signType)); } else { protocalMustParams.put(AlipayConstants.SIGN, ""); } return requestHolder; }
class class_name[name] begin[{] method[getRequestHolderWithSign, return_type[type[RequestParametersHolder]], modifier[private], parameter[request, accessToken, appAuthToken]] begin[{] local_variable[type[RequestParametersHolder], requestHolder] local_variable[type[AlipayHashMap], appParams] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getBizContent")], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=BIZ_CONTENT_KEY, postfix_operators=[], prefix_operators=[], qualifier=AlipayConstants, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=appParams, selectors=[], type_arguments=None)], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBizModel, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=BIZ_CONTENT_KEY, postfix_operators=[], prefix_operators=[], qualifier=AlipayConstants, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBizModel, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=write, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JSONWriter, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=appParams, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logBizError, postfix_operators=[], prefix_operators=[], qualifier=AlipayLogger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SecurityException']))], finally_block=None, label=None, resources=None) if[call[request.isNeedEncrypt, parameter[]]] begin[{] if[call[StringUtils.isEmpty, parameter[call[appParams.get, parameter[member[AlipayConstants.BIZ_CONTENT_KEY]]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="当前API不支持加密请求")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlipayApiException, sub_type=None)), label=None) else begin[{] None end[}] if[call[StringUtils.areNotEmpty, parameter[THIS[member[None.encryptKey]], THIS[member[None.encryptType]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="API请求要求加密,则必须设置密钥和密钥类型:encryptKey="), operandr=MemberReference(member=encryptKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",encryptType="), operator=+), operandr=MemberReference(member=encryptType, 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=AlipayApiException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], encryptContent] call[appParams.put, parameter[member[AlipayConstants.BIZ_CONTENT_KEY], member[.encryptContent]]] else begin[{] None end[}] if[call[StringUtils.isEmpty, parameter[member[.appAuthToken]]]] begin[{] call[appParams.put, parameter[member[AlipayConstants.APP_AUTH_TOKEN], member[.appAuthToken]]] else begin[{] None end[}] call[requestHolder.setApplicationParams, parameter[member[.appParams]]] if[call[StringUtils.isEmpty, parameter[member[.charset]]]] begin[{] assign[member[.charset], member[AlipayConstants.CHARSET_UTF8]] else begin[{] None end[}] local_variable[type[AlipayHashMap], protocalMustParams] call[protocalMustParams.put, parameter[member[AlipayConstants.METHOD], call[request.getApiMethodName, parameter[]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.VERSION], call[request.getApiVersion, parameter[]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.APP_ID], THIS[member[None.appId]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.SIGN_TYPE], THIS[member[None.signType]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.TERMINAL_TYPE], call[request.getTerminalType, parameter[]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.TERMINAL_INFO], call[request.getTerminalInfo, parameter[]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.NOTIFY_URL], call[request.getNotifyUrl, parameter[]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.RETURN_URL], call[request.getReturnUrl, parameter[]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.CHARSET], member[.charset]]] if[call[request.isNeedEncrypt, parameter[]]] begin[{] call[protocalMustParams.put, parameter[member[AlipayConstants.ENCRYPT_TYPE], THIS[member[None.encryptType]]]] else begin[{] None end[}] local_variable[type[Long], timestamp] local_variable[type[DateFormat], df] call[df.setTimeZone, parameter[call[TimeZone.getTimeZone, parameter[member[AlipayConstants.DATE_TIMEZONE]]]]] call[protocalMustParams.put, parameter[member[AlipayConstants.TIMESTAMP], call[df.format, parameter[ClassCreator(arguments=[MemberReference(member=timestamp, 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=Date, sub_type=None))]]]] call[requestHolder.setProtocalMustParams, parameter[member[.protocalMustParams]]] local_variable[type[AlipayHashMap], protocalOptParams] call[protocalOptParams.put, parameter[member[AlipayConstants.FORMAT], member[.format]]] call[protocalOptParams.put, parameter[member[AlipayConstants.ACCESS_TOKEN], member[.accessToken]]] call[protocalOptParams.put, parameter[member[AlipayConstants.ALIPAY_SDK], member[AlipayConstants.SDK_VERSION]]] call[protocalOptParams.put, parameter[member[AlipayConstants.PROD_CODE], call[request.getProdCode, parameter[]]]] call[requestHolder.setProtocalOptParams, parameter[member[.protocalOptParams]]] if[call[StringUtils.isEmpty, parameter[THIS[member[None.signType]]]]] begin[{] local_variable[type[String], signContent] call[protocalMustParams.put, parameter[member[AlipayConstants.SIGN], call[AlipaySignature.rsaSign, parameter[member[.signContent], member[.privateKey], member[.charset], THIS[member[None.signType]]]]]] else begin[{] call[protocalMustParams.put, parameter[member[AlipayConstants.SIGN], literal[""]]] end[}] return[member[.requestHolder]] end[}] END[}]
Keyword[private] operator[<] identifier[T] Keyword[extends] identifier[AlipayResponse] operator[>] identifier[RequestParametersHolder] identifier[getRequestHolderWithSign] operator[SEP] identifier[AlipayRequest] operator[<] operator[?] operator[>] identifier[request] , identifier[String] identifier[accessToken] , identifier[String] identifier[appAuthToken] operator[SEP] Keyword[throws] identifier[AlipayApiException] { identifier[RequestParametersHolder] identifier[requestHolder] operator[=] Keyword[new] identifier[RequestParametersHolder] operator[SEP] operator[SEP] operator[SEP] identifier[AlipayHashMap] identifier[appParams] operator[=] Keyword[new] identifier[AlipayHashMap] operator[SEP] identifier[request] operator[SEP] identifier[getTextParams] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[&&] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[appParams] operator[SEP] identifier[get] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[BIZ_CONTENT_KEY] operator[SEP] operator[SEP] operator[&&] identifier[request] operator[SEP] identifier[getBizModel] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[appParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[BIZ_CONTENT_KEY] , Keyword[new] identifier[JSONWriter] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[request] operator[SEP] identifier[getBizModel] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] { } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[e] operator[SEP] { identifier[AlipayLogger] operator[SEP] identifier[logBizError] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[isNeedEncrypt] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[appParams] operator[SEP] identifier[get] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[BIZ_CONTENT_KEY] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[AlipayApiException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[areNotEmpty] operator[SEP] Keyword[this] operator[SEP] identifier[encryptKey] , Keyword[this] operator[SEP] identifier[encryptType] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[AlipayApiException] operator[SEP] literal[String] operator[+] identifier[encryptKey] operator[+] literal[String] operator[+] identifier[encryptType] operator[SEP] operator[SEP] } identifier[String] identifier[encryptContent] operator[=] identifier[AlipayEncrypt] operator[SEP] identifier[encryptContent] operator[SEP] identifier[appParams] operator[SEP] identifier[get] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[BIZ_CONTENT_KEY] operator[SEP] , Keyword[this] operator[SEP] identifier[encryptType] , Keyword[this] operator[SEP] identifier[encryptKey] , Keyword[this] operator[SEP] identifier[charset] operator[SEP] operator[SEP] identifier[appParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[BIZ_CONTENT_KEY] , identifier[encryptContent] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[appAuthToken] operator[SEP] operator[SEP] { identifier[appParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[APP_AUTH_TOKEN] , identifier[appAuthToken] operator[SEP] operator[SEP] } identifier[requestHolder] operator[SEP] identifier[setApplicationParams] operator[SEP] identifier[appParams] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[charset] operator[SEP] operator[SEP] { identifier[charset] operator[=] identifier[AlipayConstants] operator[SEP] identifier[CHARSET_UTF8] operator[SEP] } identifier[AlipayHashMap] identifier[protocalMustParams] operator[=] Keyword[new] identifier[AlipayHashMap] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[METHOD] , identifier[request] operator[SEP] identifier[getApiMethodName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[VERSION] , identifier[request] operator[SEP] identifier[getApiVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[APP_ID] , Keyword[this] operator[SEP] identifier[appId] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[SIGN_TYPE] , Keyword[this] operator[SEP] identifier[signType] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[TERMINAL_TYPE] , identifier[request] operator[SEP] identifier[getTerminalType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[TERMINAL_INFO] , identifier[request] operator[SEP] identifier[getTerminalInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[NOTIFY_URL] , identifier[request] operator[SEP] identifier[getNotifyUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[RETURN_URL] , identifier[request] operator[SEP] identifier[getReturnUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[CHARSET] , identifier[charset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[isNeedEncrypt] operator[SEP] operator[SEP] operator[SEP] { identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[ENCRYPT_TYPE] , Keyword[this] operator[SEP] identifier[encryptType] operator[SEP] operator[SEP] } identifier[Long] identifier[timestamp] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[DateFormat] identifier[df] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[DATE_TIME_FORMAT] operator[SEP] operator[SEP] identifier[df] operator[SEP] identifier[setTimeZone] operator[SEP] identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[DATE_TIMEZONE] operator[SEP] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[TIMESTAMP] , identifier[df] operator[SEP] identifier[format] operator[SEP] Keyword[new] identifier[Date] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[requestHolder] operator[SEP] identifier[setProtocalMustParams] operator[SEP] identifier[protocalMustParams] operator[SEP] operator[SEP] identifier[AlipayHashMap] identifier[protocalOptParams] operator[=] Keyword[new] identifier[AlipayHashMap] operator[SEP] operator[SEP] operator[SEP] identifier[protocalOptParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[FORMAT] , identifier[format] operator[SEP] operator[SEP] identifier[protocalOptParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[ACCESS_TOKEN] , identifier[accessToken] operator[SEP] operator[SEP] identifier[protocalOptParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[ALIPAY_SDK] , identifier[AlipayConstants] operator[SEP] identifier[SDK_VERSION] operator[SEP] operator[SEP] identifier[protocalOptParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[PROD_CODE] , identifier[request] operator[SEP] identifier[getProdCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[requestHolder] operator[SEP] identifier[setProtocalOptParams] operator[SEP] identifier[protocalOptParams] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] Keyword[this] operator[SEP] identifier[signType] operator[SEP] operator[SEP] { identifier[String] identifier[signContent] operator[=] identifier[AlipaySignature] operator[SEP] identifier[getSignatureContent] operator[SEP] identifier[requestHolder] operator[SEP] operator[SEP] identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[SIGN] , identifier[AlipaySignature] operator[SEP] identifier[rsaSign] operator[SEP] identifier[signContent] , identifier[privateKey] , identifier[charset] , Keyword[this] operator[SEP] identifier[signType] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[protocalMustParams] operator[SEP] identifier[put] operator[SEP] identifier[AlipayConstants] operator[SEP] identifier[SIGN] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[requestHolder] operator[SEP] }
public Vector getVector(String word) { // determine the index for the word int index = termToIndex.getDimension(word); return (index < 0) ? null : wordSpace.getRowVector(index); }
class class_name[name] begin[{] method[getVector, return_type[type[Vector]], modifier[public], parameter[word]] begin[{] local_variable[type[int], index] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRowVector, postfix_operators=[], prefix_operators=[], qualifier=wordSpace, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Vector] identifier[getVector] operator[SEP] identifier[String] identifier[word] operator[SEP] { Keyword[int] identifier[index] operator[=] identifier[termToIndex] operator[SEP] identifier[getDimension] operator[SEP] identifier[word] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[index] operator[<] Other[0] operator[SEP] operator[?] Other[null] operator[:] identifier[wordSpace] operator[SEP] identifier[getRowVector] operator[SEP] identifier[index] operator[SEP] operator[SEP] }