code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static MomentInterval parseISO(String text) throws ParseException { if (text.isEmpty()) { throw new IndexOutOfBoundsException("Empty text."); } // prescan for format analysis int start = 0; int n = Math.min(text.length(), 117); boolean sameFormat = true; int firstDate = 1; // loop starts one index position later int secondDate = 0; int timeLength = 0; boolean startsWithHyphen = (text.charAt(0) == '-'); if ((text.charAt(0) == 'P') || startsWithHyphen) { for (int i = 1; i < n; i++) { if (text.charAt(i) == '/') { if (i + 1 == n) { throw new ParseException("Missing end component.", n); } else if (startsWithHyphen) { if ((text.charAt(1) == '\u221E') || (i == 1)) { start = i + 1; } } else { start = i + 1; } break; } } } int literals = 0; int literals2 = 0; boolean ordinalStyle = false; boolean weekStyle = false; boolean weekStyle2 = false; boolean secondComponent = false; int slash = -1; for (int i = start + 1; i < n; i++) { char c = text.charAt(i); if (secondComponent) { if ( (c == 'P') || ((c == '-') && (i == n - 1)) || ((c == '+') && (i == n - 2) && (text.charAt(i + 1) == '\u221E')) ) { secondComponent = false; break; } else if ((c == 'T') || (timeLength > 0)) { timeLength++; } else { if (c == 'W') { weekStyle2 = true; } else if ((c == '-') && (i > slash + 1)) { literals2++; } secondDate++; } } else if (c == '/') { if (slash == -1) { slash = i; secondComponent = true; timeLength = 0; } else { throw new ParseException("Interval with two slashes found: " + text, i); } } else if ((c == 'T') || (timeLength > 0)) { timeLength++; } else if (c == '-') { firstDate++; literals++; } else if (c == 'W') { firstDate++; weekStyle = true; } else { firstDate++; } } if (secondComponent && (weekStyle != weekStyle2)) { throw new ParseException("Mixed date styles not allowed.", n); } char c = text.charAt(start); int componentLength = firstDate - 4; if ((c == '+') || (c == '-')) { componentLength -= 2; } if (!weekStyle) { ordinalStyle = ((literals == 1) || ((literals == 0) && (componentLength == 3))); } boolean extended = (literals > 0); boolean hasT = true; if (secondComponent) { if (timeLength == 0) { // no T in end component => no date part hasT = false; timeLength = secondDate; secondDate = 0; } sameFormat = ((firstDate == secondDate) && (literals == literals2) && hasSecondOffset(text, n)); } // prepare component parsers ChronoFormatter<Moment> startFormat = ( extended ? Iso8601Format.EXTENDED_DATE_TIME_OFFSET : Iso8601Format.BASIC_DATE_TIME_OFFSET); ChronoFormatter<Moment> endFormat = (sameFormat ? startFormat : null); // null means reduced iso format // create interval Parser parser = new Parser(startFormat, endFormat, extended, weekStyle, ordinalStyle, timeLength, hasT); return parser.parse(text); }
class class_name[name] begin[{] method[parseISO, return_type[type[MomentInterval]], modifier[public static], parameter[text]] begin[{] if[call[text.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Empty text.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], start] local_variable[type[int], n] local_variable[type[boolean], sameFormat] local_variable[type[int], firstDate] local_variable[type[int], secondDate] local_variable[type[int], timeLength] local_variable[type[boolean], startsWithHyphen] if[binary_operation[binary_operation[call[text.charAt, parameter[literal[0]]], ==, literal['P']], ||, member[.startsWithHyphen]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=MemberReference(member=startsWithHyphen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='∞'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing end component."), 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=ParseException, sub_type=None)), label=None)])), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] local_variable[type[int], literals] local_variable[type[int], literals2] local_variable[type[boolean], ordinalStyle] local_variable[type[boolean], weekStyle] local_variable[type[boolean], weekStyle2] local_variable[type[boolean], secondComponent] local_variable[type[int], slash] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=MemberReference(member=secondComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='T'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=timeLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='W'), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=firstDate, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=firstDate, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=weekStyle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=firstDate, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=literals, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=timeLength, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=slash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Interval with two slashes found: "), operandr=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParseException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=slash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=secondComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='P'), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='∞'), operator===), operator=&&), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='T'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=timeLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=||), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='W'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=slash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=literals2, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=weekStyle2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MemberReference(member=secondDate, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=timeLength, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=secondComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.secondComponent], &&, binary_operation[member[.weekStyle], !=, member[.weekStyle2]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Mixed date styles not allowed."), 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=ParseException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[char], c] local_variable[type[int], componentLength] if[binary_operation[binary_operation[member[.c], ==, literal['+']], ||, binary_operation[member[.c], ==, literal['-']]]] begin[{] assign[member[.componentLength], literal[2]] else begin[{] None end[}] if[member[.weekStyle]] begin[{] assign[member[.ordinalStyle], binary_operation[binary_operation[member[.literals], ==, literal[1]], ||, binary_operation[binary_operation[member[.literals], ==, literal[0]], &&, binary_operation[member[.componentLength], ==, literal[3]]]]] else begin[{] None end[}] local_variable[type[boolean], extended] local_variable[type[boolean], hasT] if[member[.secondComponent]] begin[{] if[binary_operation[member[.timeLength], ==, literal[0]]] begin[{] assign[member[.hasT], literal[false]] assign[member[.timeLength], member[.secondDate]] assign[member[.secondDate], literal[0]] else begin[{] None end[}] assign[member[.sameFormat], binary_operation[binary_operation[binary_operation[member[.firstDate], ==, member[.secondDate]], &&, binary_operation[member[.literals], ==, member[.literals2]]], &&, call[.hasSecondOffset, parameter[member[.text], member[.n]]]]] else begin[{] None end[}] local_variable[type[ChronoFormatter], startFormat] local_variable[type[ChronoFormatter], endFormat] local_variable[type[Parser], parser] return[call[parser.parse, parameter[member[.text]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MomentInterval] identifier[parseISO] operator[SEP] identifier[String] identifier[text] operator[SEP] Keyword[throws] identifier[ParseException] { Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] , Other[117] operator[SEP] operator[SEP] Keyword[boolean] identifier[sameFormat] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[firstDate] operator[=] Other[1] operator[SEP] Keyword[int] identifier[secondDate] operator[=] Other[0] operator[SEP] Keyword[int] identifier[timeLength] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[startsWithHyphen] operator[=] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] operator[||] identifier[startsWithHyphen] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[==] identifier[n] operator[SEP] { Keyword[throw] Keyword[new] identifier[ParseException] operator[SEP] literal[String] , identifier[n] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[startsWithHyphen] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[i] operator[==] Other[1] operator[SEP] operator[SEP] { identifier[start] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } } Keyword[else] { identifier[start] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } Keyword[break] operator[SEP] } } } Keyword[int] identifier[literals] operator[=] Other[0] operator[SEP] Keyword[int] identifier[literals2] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[ordinalStyle] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[weekStyle] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[weekStyle2] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[secondComponent] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[slash] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[start] operator[+] Other[1] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[secondComponent] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[i] operator[==] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[i] operator[==] identifier[n] operator[-] Other[2] operator[SEP] operator[&&] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[secondComponent] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[timeLength] operator[>] Other[0] operator[SEP] operator[SEP] { identifier[timeLength] operator[++] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[weekStyle2] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[i] operator[>] identifier[slash] operator[+] Other[1] operator[SEP] operator[SEP] { identifier[literals2] operator[++] operator[SEP] } identifier[secondDate] operator[++] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[slash] operator[==] operator[-] Other[1] operator[SEP] { identifier[slash] operator[=] identifier[i] operator[SEP] identifier[secondComponent] operator[=] literal[boolean] operator[SEP] identifier[timeLength] operator[=] Other[0] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[ParseException] operator[SEP] literal[String] operator[+] identifier[text] , identifier[i] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[timeLength] operator[>] Other[0] operator[SEP] operator[SEP] { identifier[timeLength] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[firstDate] operator[++] operator[SEP] identifier[literals] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[firstDate] operator[++] operator[SEP] identifier[weekStyle] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[firstDate] operator[++] operator[SEP] } } Keyword[if] operator[SEP] identifier[secondComponent] operator[&&] operator[SEP] identifier[weekStyle] operator[!=] identifier[weekStyle2] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ParseException] operator[SEP] literal[String] , identifier[n] operator[SEP] operator[SEP] } Keyword[char] identifier[c] operator[=] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[start] operator[SEP] operator[SEP] Keyword[int] identifier[componentLength] operator[=] identifier[firstDate] operator[-] Other[4] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[SEP] { identifier[componentLength] operator[-=] Other[2] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[weekStyle] operator[SEP] { identifier[ordinalStyle] operator[=] operator[SEP] operator[SEP] identifier[literals] operator[==] Other[1] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[literals] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[componentLength] operator[==] Other[3] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[extended] operator[=] operator[SEP] identifier[literals] operator[>] Other[0] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasT] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[secondComponent] operator[SEP] { Keyword[if] operator[SEP] identifier[timeLength] operator[==] Other[0] operator[SEP] { identifier[hasT] operator[=] literal[boolean] operator[SEP] identifier[timeLength] operator[=] identifier[secondDate] operator[SEP] identifier[secondDate] operator[=] Other[0] operator[SEP] } identifier[sameFormat] operator[=] operator[SEP] operator[SEP] identifier[firstDate] operator[==] identifier[secondDate] operator[SEP] operator[&&] operator[SEP] identifier[literals] operator[==] identifier[literals2] operator[SEP] operator[&&] identifier[hasSecondOffset] operator[SEP] identifier[text] , identifier[n] operator[SEP] operator[SEP] operator[SEP] } identifier[ChronoFormatter] operator[<] identifier[Moment] operator[>] identifier[startFormat] operator[=] operator[SEP] identifier[extended] operator[?] identifier[Iso8601Format] operator[SEP] identifier[EXTENDED_DATE_TIME_OFFSET] operator[:] identifier[Iso8601Format] operator[SEP] identifier[BASIC_DATE_TIME_OFFSET] operator[SEP] operator[SEP] identifier[ChronoFormatter] operator[<] identifier[Moment] operator[>] identifier[endFormat] operator[=] operator[SEP] identifier[sameFormat] operator[?] identifier[startFormat] operator[:] Other[null] operator[SEP] operator[SEP] identifier[Parser] identifier[parser] operator[=] Keyword[new] identifier[Parser] operator[SEP] identifier[startFormat] , identifier[endFormat] , identifier[extended] , identifier[weekStyle] , identifier[ordinalStyle] , identifier[timeLength] , identifier[hasT] operator[SEP] operator[SEP] Keyword[return] identifier[parser] operator[SEP] identifier[parse] operator[SEP] identifier[text] operator[SEP] operator[SEP] }
public static KvStateClientProxy createKvStateClientProxy( final InetAddress address, final Iterator<Integer> ports, final int eventLoopThreads, final int queryThreads, final KvStateRequestStats stats) { Preconditions.checkNotNull(address, "address"); Preconditions.checkNotNull(stats, "stats"); Preconditions.checkArgument(eventLoopThreads >= 1); Preconditions.checkArgument(queryThreads >= 1); try { String classname = "org.apache.flink.queryablestate.client.proxy.KvStateClientProxyImpl"; Class<? extends KvStateClientProxy> clazz = Class.forName(classname).asSubclass(KvStateClientProxy.class); Constructor<? extends KvStateClientProxy> constructor = clazz.getConstructor( InetAddress.class, Iterator.class, Integer.class, Integer.class, KvStateRequestStats.class); return constructor.newInstance(address, ports, eventLoopThreads, queryThreads, stats); } catch (ClassNotFoundException e) { final String msg = "Could not load Queryable State Client Proxy. " + ERROR_MESSAGE_ON_LOAD_FAILURE; if (LOG.isDebugEnabled()) { LOG.debug(msg + " Cause: " + e.getMessage()); } else { LOG.info(msg); } return null; } catch (InvocationTargetException e) { LOG.error("Queryable State Client Proxy could not be created: ", e.getTargetException()); return null; } catch (Throwable t) { LOG.error("Failed to instantiate the Queryable State Client Proxy.", t); return null; } }
class class_name[name] begin[{] method[createKvStateClientProxy, return_type[type[KvStateClientProxy]], modifier[public static], parameter[address, ports, eventLoopThreads, queryThreads, stats]] begin[{] call[Preconditions.checkNotNull, parameter[member[.address], literal["address"]]] call[Preconditions.checkNotNull, parameter[member[.stats], literal["stats"]]] call[Preconditions.checkArgument, parameter[binary_operation[member[.eventLoopThreads], >=, literal[1]]]] call[Preconditions.checkArgument, parameter[binary_operation[member[.queryThreads], >=, literal[1]]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.apache.flink.queryablestate.client.proxy.KvStateClientProxyImpl"), name=classname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KvStateClientProxy, sub_type=None))], member=asSubclass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=KvStateClientProxy, sub_type=None))], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetAddress, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Iterator, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KvStateRequestStats, sub_type=None))], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), name=constructor)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=KvStateClientProxy, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ports, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=eventLoopThreads, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryThreads, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not load Queryable State Client Proxy. "), operandr=MemberReference(member=ERROR_MESSAGE_ON_LOAD_FAILURE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=msg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Cause: "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Queryable State Client Proxy could not be created: "), MethodInvocation(arguments=[], member=getTargetException, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to instantiate the Queryable State Client Proxy."), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[KvStateClientProxy] identifier[createKvStateClientProxy] operator[SEP] Keyword[final] identifier[InetAddress] identifier[address] , Keyword[final] identifier[Iterator] operator[<] identifier[Integer] operator[>] identifier[ports] , Keyword[final] Keyword[int] identifier[eventLoopThreads] , Keyword[final] Keyword[int] identifier[queryThreads] , Keyword[final] identifier[KvStateRequestStats] identifier[stats] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[address] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[stats] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[eventLoopThreads] operator[>=] Other[1] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[queryThreads] operator[>=] Other[1] operator[SEP] operator[SEP] Keyword[try] { identifier[String] identifier[classname] operator[=] literal[String] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[KvStateClientProxy] operator[>] identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[classname] operator[SEP] operator[SEP] identifier[asSubclass] operator[SEP] identifier[KvStateClientProxy] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[KvStateClientProxy] operator[>] identifier[constructor] operator[=] identifier[clazz] operator[SEP] identifier[getConstructor] operator[SEP] identifier[InetAddress] operator[SEP] Keyword[class] , identifier[Iterator] operator[SEP] Keyword[class] , identifier[Integer] operator[SEP] Keyword[class] , identifier[Integer] operator[SEP] Keyword[class] , identifier[KvStateRequestStats] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[constructor] operator[SEP] identifier[newInstance] operator[SEP] identifier[address] , identifier[ports] , identifier[eventLoopThreads] , identifier[queryThreads] , identifier[stats] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[final] identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[ERROR_MESSAGE_ON_LOAD_FAILURE] 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] identifier[msg] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getTargetException] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public static void validateLifeCycleSignature(InterceptorMethodKind kind, String lifeCycle, Method m, boolean ejbClass, J2EEName name) throws EJBConfigurationException { // Validate method signature except for the parameter types, // which is done by this method. validateLifeCycleSignatureExceptParameters(kind, lifeCycle, m, ejbClass, name); // d450431 // Now verify method parameter types. Class<?>[] parmTypes = m.getParameterTypes(); if (ejbClass) { // This is EJB class, so interceptor should have no parameters. if (parmTypes.length != 0) { // CNTR0231E: "{0}" interceptor method "{1}" signature is incorrect. String method = m.toGenericString(); Tr.error(tc, "INVALID_LIFECYCLE_SIGNATURE_CNTR0231E", new Object[] { method, lifeCycle }); throw new EJBConfigurationException(lifeCycle + " interceptor \"" + method + "\" must have zero parameters."); } } else { // This is an interceptor class, so InvocationContext is a required parameter // for the interceptor method. if ((parmTypes.length == 1) && (parmTypes[0].equals(InvocationContext.class))) { // Has correct signature of 1 parameter of type InvocationContext } else { // CNTR0232E: The {0} method does not have the required // method signature for a {1} method of a interceptor class. String method = m.toGenericString(); Tr.error(tc, "INVALID_LIFECYCLE_SIGNATURE_CNTR0232E", new Object[] { method, lifeCycle }); throw new EJBConfigurationException("CNTR0232E: The \"" + method + "\" method does not have the required method signature for a \"" + lifeCycle + "\" method of a interceptor class."); } } }
class class_name[name] begin[{] method[validateLifeCycleSignature, return_type[void], modifier[public static], parameter[kind, lifeCycle, m, ejbClass, name]] begin[{] call[.validateLifeCycleSignatureExceptParameters, parameter[member[.kind], member[.lifeCycle], member[.m], member[.ejbClass], member[.name]]] local_variable[type[Class], parmTypes] if[member[.ejbClass]] begin[{] if[binary_operation[member[parmTypes.length], !=, literal[0]]] begin[{] local_variable[type[String], method] call[Tr.error, parameter[member[.tc], literal["INVALID_LIFECYCLE_SIGNATURE_CNTR0231E"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lifeCycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lifeCycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" interceptor \""), operator=+), operandr=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" must have zero parameters."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBConfigurationException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] if[binary_operation[binary_operation[member[parmTypes.length], ==, literal[1]], &&, member[.parmTypes]]] begin[{] else begin[{] local_variable[type[String], method] call[Tr.error, parameter[member[.tc], literal["INVALID_LIFECYCLE_SIGNATURE_CNTR0232E"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lifeCycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CNTR0232E: The \""), operandr=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" method does not have the required method signature for a \""), operator=+), operandr=MemberReference(member=lifeCycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" method of a interceptor class."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBConfigurationException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[validateLifeCycleSignature] operator[SEP] identifier[InterceptorMethodKind] identifier[kind] , identifier[String] identifier[lifeCycle] , identifier[Method] identifier[m] , Keyword[boolean] identifier[ejbClass] , identifier[J2EEName] identifier[name] operator[SEP] Keyword[throws] identifier[EJBConfigurationException] { identifier[validateLifeCycleSignatureExceptParameters] operator[SEP] identifier[kind] , identifier[lifeCycle] , identifier[m] , identifier[ejbClass] , identifier[name] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parmTypes] operator[=] identifier[m] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ejbClass] operator[SEP] { Keyword[if] operator[SEP] identifier[parmTypes] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[String] identifier[method] operator[=] identifier[m] operator[SEP] identifier[toGenericString] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[method] , identifier[lifeCycle] } operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[EJBConfigurationException] operator[SEP] identifier[lifeCycle] operator[+] literal[String] operator[+] identifier[method] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] identifier[parmTypes] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] operator[&&] operator[SEP] identifier[parmTypes] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[InvocationContext] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] { } Keyword[else] { identifier[String] identifier[method] operator[=] identifier[m] operator[SEP] identifier[toGenericString] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[method] , identifier[lifeCycle] } operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[EJBConfigurationException] operator[SEP] literal[String] operator[+] identifier[method] operator[+] literal[String] operator[+] identifier[lifeCycle] operator[+] literal[String] operator[SEP] operator[SEP] } } }
public int appendAll(OptionalParameter[] optionalParameters) { int length = 0; for (OptionalParameter optionalParamameter : optionalParameters) { length += append(optionalParamameter); } return length; }
class class_name[name] begin[{] method[appendAll, return_type[type[int]], modifier[public], parameter[optionalParameters]] begin[{] local_variable[type[int], length] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=optionalParamameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=optionalParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=optionalParamameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OptionalParameter, sub_type=None))), label=None) return[member[.length]] end[}] END[}]
Keyword[public] Keyword[int] identifier[appendAll] operator[SEP] identifier[OptionalParameter] operator[SEP] operator[SEP] identifier[optionalParameters] operator[SEP] { Keyword[int] identifier[length] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[OptionalParameter] identifier[optionalParamameter] operator[:] identifier[optionalParameters] operator[SEP] { identifier[length] operator[+=] identifier[append] operator[SEP] identifier[optionalParamameter] operator[SEP] operator[SEP] } Keyword[return] identifier[length] operator[SEP] }
public void addComponent(ComponentDescription description) { final String componentName = description.getComponentName(); final String componentClassName = description.getComponentClassName(); if (componentName == null) { throw EeLogger.ROOT_LOGGER.nullVar("componentName", "module", moduleName); } if (componentClassName == null) { throw EeLogger.ROOT_LOGGER.nullVar("componentClassName","module", moduleName); } if (componentsByName.containsKey(componentName)) { throw EeLogger.ROOT_LOGGER.componentAlreadyDefined(componentName); } componentsByName.put(componentName, description); List<ComponentDescription> list = componentsByClassName.get(componentClassName); if (list == null) { componentsByClassName.put(componentClassName, list = new ArrayList<ComponentDescription>(1)); } list.add(description); }
class class_name[name] begin[{] method[addComponent, return_type[void], modifier[public], parameter[description]] begin[{] local_variable[type[String], componentName] local_variable[type[String], componentClassName] if[binary_operation[member[.componentName], ==, literal[null]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="componentName"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="module"), MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nullVar, postfix_operators=[], prefix_operators=[], qualifier=EeLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[binary_operation[member[.componentClassName], ==, literal[null]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="componentClassName"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="module"), MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nullVar, postfix_operators=[], prefix_operators=[], qualifier=EeLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[call[componentsByName.containsKey, parameter[member[.componentName]]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=componentName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=componentAlreadyDefined, postfix_operators=[], prefix_operators=[], qualifier=EeLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] call[componentsByName.put, parameter[member[.componentName], member[.description]]] local_variable[type[List], list] if[binary_operation[member[.list], ==, literal[null]]] begin[{] call[componentsByClassName.put, parameter[member[.componentClassName], assign[member[.list], ClassCreator(arguments=[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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ComponentDescription, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]]] else begin[{] None end[}] call[list.add, parameter[member[.description]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addComponent] operator[SEP] identifier[ComponentDescription] identifier[description] operator[SEP] { Keyword[final] identifier[String] identifier[componentName] operator[=] identifier[description] operator[SEP] identifier[getComponentName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[componentClassName] operator[=] identifier[description] operator[SEP] identifier[getComponentClassName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[componentName] operator[==] Other[null] operator[SEP] { Keyword[throw] identifier[EeLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[nullVar] operator[SEP] literal[String] , literal[String] , identifier[moduleName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentClassName] operator[==] Other[null] operator[SEP] { Keyword[throw] identifier[EeLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[nullVar] operator[SEP] literal[String] , literal[String] , identifier[moduleName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentsByName] operator[SEP] identifier[containsKey] operator[SEP] identifier[componentName] operator[SEP] operator[SEP] { Keyword[throw] identifier[EeLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[componentAlreadyDefined] operator[SEP] identifier[componentName] operator[SEP] operator[SEP] } identifier[componentsByName] operator[SEP] identifier[put] operator[SEP] identifier[componentName] , identifier[description] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ComponentDescription] operator[>] identifier[list] operator[=] identifier[componentsByClassName] operator[SEP] identifier[get] operator[SEP] identifier[componentClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[==] Other[null] operator[SEP] { identifier[componentsByClassName] operator[SEP] identifier[put] operator[SEP] identifier[componentClassName] , identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ComponentDescription] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[description] operator[SEP] operator[SEP] }
protected int getNextIndex(final int currentIndex) { if (!isPaused()) { return currentIndex + 1; } int ret = currentIndex; while (isPaused()) { sendStepPausing(ret + 1); try { Thread.sleep(getPauseSpan()); } catch (InterruptedException e) { LOG.warn("thread.sleep.error", e); } TestScript testScript = current.getTestScript(); if (testScript.isScriptFileChanged()) { LOG.info("script.file.changed"); current.setTestScript( dao.load(testScript.getScriptFile(), testScript.getSheetName(), false)); } // コンソールから有効なコマンド入力があるまでループします。 if (cmd == null || cmd.key == null) { continue; } final int cmdRet = cmd.execute(ret, current.getTestScript(), appCtx); if (cmdRet < 0) { LOG.info("cmd.error"); } else { ret = cmdRet; if (current.getTestScript().getTestStep(ret) == null) { LOG.info("test.step.end"); break; } LOG.info("empty"); LOG.info("test.step.next.prev"); for (int i = ret - 1; i <= ret + 1; i++) { TestStep nextStep = current.getTestScript().getTestStep(i); if (nextStep == null) { continue; } String nextMark = i == ret + 1 ? " <- 次に実行" : ""; LOG.info("test.step.next", new Object[] { nextStep.getNo(), nextStep.getItemName(), nextStep.getLocator(), nextMark }); } LOG.info("empty"); } // if (cmd.key.release && cmdRet >= 0) { cmd = null; break; } else { cmd = null; } } return ret; }
class class_name[name] begin[{] method[getNextIndex, return_type[type[int]], modifier[protected], parameter[currentIndex]] begin[{] if[call[.isPaused, parameter[]]] begin[{] return[binary_operation[member[.currentIndex], +, literal[1]]] else begin[{] None end[}] local_variable[type[int], ret] while[call[.isPaused, parameter[]]] begin[{] call[.sendStepPausing, parameter[binary_operation[member[.ret], +, literal[1]]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPauseSpan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="thread.sleep.error"), 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=['InterruptedException']))], finally_block=None, label=None, resources=None) local_variable[type[TestScript], testScript] if[call[testScript.isScriptFileChanged, parameter[]]] begin[{] call[LOG.info, parameter[literal["script.file.changed"]]] call[current.setTestScript, parameter[call[dao.load, parameter[call[testScript.getScriptFile, parameter[]], call[testScript.getSheetName, parameter[]], literal[false]]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.cmd], ==, literal[null]], ||, binary_operation[member[cmd.key], ==, literal[null]]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[int], cmdRet] if[binary_operation[member[.cmdRet], <, literal[0]]] begin[{] call[LOG.info, parameter[literal["cmd.error"]]] else begin[{] assign[member[.ret], member[.cmdRet]] if[binary_operation[call[current.getTestScript, parameter[]], ==, literal[null]]] begin[{] call[LOG.info, parameter[literal["test.step.end"]]] BreakStatement(goto=None, label=None) else begin[{] None end[}] call[LOG.info, parameter[literal["empty"]]] call[LOG.info, parameter[literal["test.step.next.prev"]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTestScript, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTestStep, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=nextStep)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TestStep, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nextStep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" <- 次に実行")), name=nextMark)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="test.step.next"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getNo, postfix_operators=[], prefix_operators=[], qualifier=nextStep, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getItemName, postfix_operators=[], prefix_operators=[], qualifier=nextStep, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLocator, postfix_operators=[], prefix_operators=[], qualifier=nextStep, selectors=[], type_arguments=None), MemberReference(member=nextMark, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[LOG.info, parameter[literal["empty"]]] end[}] if[binary_operation[member[cmd.key.release], &&, binary_operation[member[.cmdRet], >=, literal[0]]]] begin[{] assign[member[.cmd], literal[null]] BreakStatement(goto=None, label=None) else begin[{] assign[member[.cmd], literal[null]] end[}] end[}] return[member[.ret]] end[}] END[}]
Keyword[protected] Keyword[int] identifier[getNextIndex] operator[SEP] Keyword[final] Keyword[int] identifier[currentIndex] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isPaused] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[currentIndex] operator[+] Other[1] operator[SEP] } Keyword[int] identifier[ret] operator[=] identifier[currentIndex] operator[SEP] Keyword[while] operator[SEP] identifier[isPaused] operator[SEP] operator[SEP] operator[SEP] { identifier[sendStepPausing] operator[SEP] identifier[ret] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] identifier[getPauseSpan] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[TestScript] identifier[testScript] operator[=] identifier[current] operator[SEP] identifier[getTestScript] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[testScript] operator[SEP] identifier[isScriptFileChanged] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[current] operator[SEP] identifier[setTestScript] operator[SEP] identifier[dao] operator[SEP] identifier[load] operator[SEP] identifier[testScript] operator[SEP] identifier[getScriptFile] operator[SEP] operator[SEP] , identifier[testScript] operator[SEP] identifier[getSheetName] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cmd] operator[==] Other[null] operator[||] identifier[cmd] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[final] Keyword[int] identifier[cmdRet] operator[=] identifier[cmd] operator[SEP] identifier[execute] operator[SEP] identifier[ret] , identifier[current] operator[SEP] identifier[getTestScript] operator[SEP] operator[SEP] , identifier[appCtx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmdRet] operator[<] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[ret] operator[=] identifier[cmdRet] operator[SEP] Keyword[if] operator[SEP] identifier[current] operator[SEP] identifier[getTestScript] operator[SEP] operator[SEP] operator[SEP] identifier[getTestStep] operator[SEP] identifier[ret] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] 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] Keyword[int] identifier[i] operator[=] identifier[ret] operator[-] Other[1] operator[SEP] identifier[i] operator[<=] identifier[ret] operator[+] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[TestStep] identifier[nextStep] operator[=] identifier[current] operator[SEP] identifier[getTestScript] operator[SEP] operator[SEP] operator[SEP] identifier[getTestStep] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextStep] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[String] identifier[nextMark] operator[=] identifier[i] operator[==] identifier[ret] operator[+] Other[1] operator[?] literal[String] operator[:] literal[String] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[nextStep] operator[SEP] identifier[getNo] operator[SEP] operator[SEP] , identifier[nextStep] operator[SEP] identifier[getItemName] operator[SEP] operator[SEP] , identifier[nextStep] operator[SEP] identifier[getLocator] operator[SEP] operator[SEP] , identifier[nextMark] } operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cmd] operator[SEP] identifier[key] operator[SEP] identifier[release] operator[&&] identifier[cmdRet] operator[>=] Other[0] operator[SEP] { identifier[cmd] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] { identifier[cmd] operator[=] Other[null] operator[SEP] } } Keyword[return] identifier[ret] operator[SEP] }
public void setStyleName(String v) { if (Style_Type.featOkTst && ((Style_Type)jcasType).casFeat_styleName == null) jcasType.jcas.throwFeatMissing("styleName", "de.julielab.jules.types.Style"); jcasType.ll_cas.ll_setStringValue(addr, ((Style_Type)jcasType).casFeatCode_styleName, v);}
class class_name[name] begin[{] method[setStyleName, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[Style_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Style_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["styleName"], literal["de.julielab.jules.types.Style"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Style_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setStyleName] operator[SEP] identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[Style_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Style_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_styleName] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Style_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_styleName] , identifier[v] operator[SEP] operator[SEP] }
public final DoubleProperty rowHeightProperty() { if (rowHeight == null) { rowHeight = new StyleableDoubleProperty(20) { @Override public CssMetaData<AllDayView, Number> getCssMetaData() { return StyleableProperties.ROW_HEIGHT; } @Override public Object getBean() { return AllDayView.this; } @Override public String getName() { return "rowHeight"; //$NON-NLS-1$ } }; } return rowHeight; }
class class_name[name] begin[{] method[rowHeightProperty, return_type[type[DoubleProperty]], modifier[final public], parameter[]] begin[{] if[binary_operation[member[.rowHeight], ==, literal[null]]] begin[{] assign[member[.rowHeight], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=ROW_HEIGHT, postfix_operators=[], prefix_operators=[], qualifier=StyleableProperties, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getCssMetaData, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AllDayView, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))], dimensions=[], name=CssMetaData, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=AllDayView, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getBean, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rowHeight"), label=None)], documentation=None, modifiers={'public'}, name=getName, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StyleableDoubleProperty, sub_type=None))] else begin[{] None end[}] return[member[.rowHeight]] end[}] END[}]
Keyword[public] Keyword[final] identifier[DoubleProperty] identifier[rowHeightProperty] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[rowHeight] operator[==] Other[null] operator[SEP] { identifier[rowHeight] operator[=] Keyword[new] identifier[StyleableDoubleProperty] operator[SEP] Other[20] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[CssMetaData] operator[<] identifier[AllDayView] , identifier[Number] operator[>] identifier[getCssMetaData] operator[SEP] operator[SEP] { Keyword[return] identifier[StyleableProperties] operator[SEP] identifier[ROW_HEIGHT] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getBean] operator[SEP] operator[SEP] { Keyword[return] identifier[AllDayView] operator[SEP] Keyword[this] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getName] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } } operator[SEP] } Keyword[return] identifier[rowHeight] operator[SEP] }
protected boolean isButtonEnabledForSelectedMessages(List<HttpMessage> httpMessages) { for (HttpMessage httpMessage : httpMessages) { if (httpMessage != null && !isButtonEnabledForSelectedHttpMessage(httpMessage)) { return false; } } return true; }
class class_name[name] begin[{] method[isButtonEnabledForSelectedMessages, return_type[type[boolean]], modifier[protected], parameter[httpMessages]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=httpMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=httpMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isButtonEnabledForSelectedHttpMessage, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=httpMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=httpMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpMessage, sub_type=None))), label=None) return[literal[true]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isButtonEnabledForSelectedMessages] operator[SEP] identifier[List] operator[<] identifier[HttpMessage] operator[>] identifier[httpMessages] operator[SEP] { Keyword[for] operator[SEP] identifier[HttpMessage] identifier[httpMessage] operator[:] identifier[httpMessages] operator[SEP] { Keyword[if] operator[SEP] identifier[httpMessage] operator[!=] Other[null] operator[&&] operator[!] identifier[isButtonEnabledForSelectedHttpMessage] operator[SEP] identifier[httpMessage] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
private void reportException(int s) { Throwable ex = ((s == CANCELLED) ? new CancellationException() : (s == EXCEPTIONAL) ? getThrowableException() : null); if (ex != null) U.throwException(ex); }
class class_name[name] begin[{] method[reportException, return_type[void], modifier[private], parameter[s]] begin[{] local_variable[type[Throwable], ex] if[binary_operation[member[.ex], !=, literal[null]]] begin[{] call[U.throwException, parameter[member[.ex]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[reportException] operator[SEP] Keyword[int] identifier[s] operator[SEP] { identifier[Throwable] identifier[ex] operator[=] operator[SEP] operator[SEP] identifier[s] operator[==] identifier[CANCELLED] operator[SEP] operator[?] Keyword[new] identifier[CancellationException] operator[SEP] operator[SEP] operator[:] operator[SEP] identifier[s] operator[==] identifier[EXCEPTIONAL] operator[SEP] operator[?] identifier[getThrowableException] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ex] operator[!=] Other[null] operator[SEP] identifier[U] operator[SEP] identifier[throwException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] }
public double scorePath(DependencyPath path) { double score = 0; for (DependencyRelation wordRelation : path) { if (wordRelation.relation().equals("SBJ")) score += 5; else if (wordRelation.relation().equals("OBJ")) score += 4; else if (wordRelation.relation().equals("OBL")) score += 3; else if (wordRelation.relation().equals("GEN")) score += 2; else score += 1; } return score; }
class class_name[name] begin[{] method[scorePath, return_type[type[double]], modifier[public], parameter[path]] begin[{] local_variable[type[double], score] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=relation, postfix_operators=[], prefix_operators=[], qualifier=wordRelation, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SBJ")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=relation, postfix_operators=[], prefix_operators=[], qualifier=wordRelation, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="OBJ")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=relation, postfix_operators=[], prefix_operators=[], qualifier=wordRelation, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="OBL")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=relation, postfix_operators=[], prefix_operators=[], qualifier=wordRelation, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GEN")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=wordRelation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DependencyRelation, sub_type=None))), label=None) return[member[.score]] end[}] END[}]
Keyword[public] Keyword[double] identifier[scorePath] operator[SEP] identifier[DependencyPath] identifier[path] operator[SEP] { Keyword[double] identifier[score] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[DependencyRelation] identifier[wordRelation] operator[:] identifier[path] operator[SEP] { Keyword[if] operator[SEP] identifier[wordRelation] operator[SEP] identifier[relation] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[score] operator[+=] Other[5] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[wordRelation] operator[SEP] identifier[relation] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[score] operator[+=] Other[4] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[wordRelation] operator[SEP] identifier[relation] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[score] operator[+=] Other[3] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[wordRelation] operator[SEP] identifier[relation] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[score] operator[+=] Other[2] operator[SEP] Keyword[else] identifier[score] operator[+=] Other[1] operator[SEP] } Keyword[return] identifier[score] operator[SEP] }
public PackageElement getAbbreviatedPackageElement(PackageElement pkg) { String parsedPackageName = utils.parsePackageName(pkg); ModuleElement encl = (ModuleElement) pkg.getEnclosingElement(); PackageElement abbrevPkg = encl == null ? utils.elementUtils.getPackageElement(parsedPackageName) : ((JavacElements) utils.elementUtils).getPackageElement(encl, parsedPackageName); return abbrevPkg; }
class class_name[name] begin[{] method[getAbbreviatedPackageElement, return_type[type[PackageElement]], modifier[public], parameter[pkg]] begin[{] local_variable[type[String], parsedPackageName] local_variable[type[ModuleElement], encl] local_variable[type[PackageElement], abbrevPkg] return[member[.abbrevPkg]] end[}] END[}]
Keyword[public] identifier[PackageElement] identifier[getAbbreviatedPackageElement] operator[SEP] identifier[PackageElement] identifier[pkg] operator[SEP] { identifier[String] identifier[parsedPackageName] operator[=] identifier[utils] operator[SEP] identifier[parsePackageName] operator[SEP] identifier[pkg] operator[SEP] operator[SEP] identifier[ModuleElement] identifier[encl] operator[=] operator[SEP] identifier[ModuleElement] operator[SEP] identifier[pkg] operator[SEP] identifier[getEnclosingElement] operator[SEP] operator[SEP] operator[SEP] identifier[PackageElement] identifier[abbrevPkg] operator[=] identifier[encl] operator[==] Other[null] operator[?] identifier[utils] operator[SEP] identifier[elementUtils] operator[SEP] identifier[getPackageElement] operator[SEP] identifier[parsedPackageName] operator[SEP] operator[:] operator[SEP] operator[SEP] identifier[JavacElements] operator[SEP] identifier[utils] operator[SEP] identifier[elementUtils] operator[SEP] operator[SEP] identifier[getPackageElement] operator[SEP] identifier[encl] , identifier[parsedPackageName] operator[SEP] operator[SEP] Keyword[return] identifier[abbrevPkg] operator[SEP] }
public static int[] getLoopColsRowsForSubregion( GridCoverage2D gridCoverage, Envelope2D subregion ) throws Exception { GridGeometry2D gridGeometry = gridCoverage.getGridGeometry(); GridEnvelope2D subRegionGrid = gridGeometry.worldToGrid(subregion); int minCol = subRegionGrid.x; int maxCol = subRegionGrid.x + subRegionGrid.width; int minRow = subRegionGrid.y; int maxRow = subRegionGrid.y + subRegionGrid.height; return new int[]{minCol, maxCol, minRow, maxRow}; }
class class_name[name] begin[{] method[getLoopColsRowsForSubregion, return_type[type[int]], modifier[public static], parameter[gridCoverage, subregion]] begin[{] local_variable[type[GridGeometry2D], gridGeometry] local_variable[type[GridEnvelope2D], subRegionGrid] local_variable[type[int], minCol] local_variable[type[int], maxCol] local_variable[type[int], minRow] local_variable[type[int], maxRow] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=minCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[getLoopColsRowsForSubregion] operator[SEP] identifier[GridCoverage2D] identifier[gridCoverage] , identifier[Envelope2D] identifier[subregion] operator[SEP] Keyword[throws] identifier[Exception] { identifier[GridGeometry2D] identifier[gridGeometry] operator[=] identifier[gridCoverage] operator[SEP] identifier[getGridGeometry] operator[SEP] operator[SEP] operator[SEP] identifier[GridEnvelope2D] identifier[subRegionGrid] operator[=] identifier[gridGeometry] operator[SEP] identifier[worldToGrid] operator[SEP] identifier[subregion] operator[SEP] operator[SEP] Keyword[int] identifier[minCol] operator[=] identifier[subRegionGrid] operator[SEP] identifier[x] operator[SEP] Keyword[int] identifier[maxCol] operator[=] identifier[subRegionGrid] operator[SEP] identifier[x] operator[+] identifier[subRegionGrid] operator[SEP] identifier[width] operator[SEP] Keyword[int] identifier[minRow] operator[=] identifier[subRegionGrid] operator[SEP] identifier[y] operator[SEP] Keyword[int] identifier[maxRow] operator[=] identifier[subRegionGrid] operator[SEP] identifier[y] operator[+] identifier[subRegionGrid] operator[SEP] identifier[height] operator[SEP] Keyword[return] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { identifier[minCol] , identifier[maxCol] , identifier[minRow] , identifier[maxRow] } operator[SEP] }
public static String getActualTableName(final OutputWriter outputWriter) { assert outputWriter instanceof DatastoreOutputWriter; final DatastoreOutputWriter dow = (DatastoreOutputWriter) outputWriter; return dow.getTableName(); }
class class_name[name] begin[{] method[getActualTableName, return_type[type[String]], modifier[public static], parameter[outputWriter]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=outputWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DatastoreOutputWriter, sub_type=None), operator=instanceof), label=None, value=None) local_variable[type[DatastoreOutputWriter], dow] return[call[dow.getTableName, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getActualTableName] operator[SEP] Keyword[final] identifier[OutputWriter] identifier[outputWriter] operator[SEP] { Keyword[assert] identifier[outputWriter] Keyword[instanceof] identifier[DatastoreOutputWriter] operator[SEP] Keyword[final] identifier[DatastoreOutputWriter] identifier[dow] operator[=] operator[SEP] identifier[DatastoreOutputWriter] operator[SEP] identifier[outputWriter] operator[SEP] Keyword[return] identifier[dow] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[SEP] }
protected Formatter<VersionIdentifier> parseSubFormatter(CharSequenceScanner scanner, String formatPattern, StringBuilder infixBuffer, FormatPatternStatus status) { char c = scanner.next(); if (c == 'V') { char segment = scanner.forceNext(); if (segment == '\0') { throw new IllegalStateException(formatPattern + "<separator>"); } String segmentSeparator = Character.toString(segment); int minimumSegmentCount = 0; int maximumSegmentCount = Integer.MAX_VALUE; int segmentPadding = 0; if (scanner.expect('{')) { minimumSegmentCount = (int) scanner.readLong(10); scanner.require(','); maximumSegmentCount = (int) scanner.readLong(10); scanner.require(','); segmentPadding = (int) scanner.readLong(10); scanner.require('}'); } status.versionSegmentsCount++; return new VersionIdentifierFormatterVersionSegments(infixBuffer.toString(), segmentSeparator, minimumSegmentCount, maximumSegmentCount, segmentPadding); } else if ((c == 'P') || (c == 'A') || (c == 'L')) { int maximumLength = 0; if (scanner.expect('{')) { maximumLength = (int) scanner.readLong(10); scanner.require('}'); } if (c == 'P') { status.phaseCount++; return new VersionIdentifierFormatterPhase(infixBuffer.toString(), maximumLength); } else if (c == 'A') { status.phaseCount++; return new VersionIdentifierFormatterPhaseAlias(infixBuffer.toString(), maximumLength); } else { return new VersionIdentifierFormatterLabel(infixBuffer.toString(), maximumLength); } } else if ((c == 'R') || (c == 'N')) { int padding = 0; if (scanner.expect('{')) { padding = (int) scanner.readLong(10); scanner.require('}'); } if (c == 'R') { return new VersionIdentifierFormatterRevision(infixBuffer.toString(), padding); } else { status.phaseNumberCount++; return new VersionIdentifierFormatterPhaseNumber(infixBuffer.toString(), padding); } } else if (c == 'T') { DateFormat dateFormat = null; if (scanner.expect('{')) { String datePattern = scanner.readUntil('}', false); if (datePattern == null) { scanner.require('}'); } dateFormat = new SimpleDateFormat(datePattern); } return new VersionIdentifierFormatterTimestamp(this.iso8601Util, dateFormat, infixBuffer.toString()); } else if (c == 'S') { String snapshotIndicator = VersionIdentifier.SNAPSHOT; if (scanner.expect('{')) { snapshotIndicator = scanner.readUntil('}', false); if (snapshotIndicator == null) { scanner.require('}'); } } status.snapshotCount++; infixBuffer.append(snapshotIndicator); return new VersionIdentifierFormatterSnapshot(infixBuffer.toString()); } else if (c == '$') { return new StaticFormatter<>(infixBuffer.toString()); } else if ((c == '(') && (!status.inBrace)) { status.inBrace = true; return null; } else if ((c == ')') && (status.inBrace)) { status.inBrace = false; return null; } else { throw new IllegalStateException(Character.toString(c)); } }
class class_name[name] begin[{] method[parseSubFormatter, return_type[type[Formatter]], modifier[protected], parameter[scanner, formatPattern, infixBuffer, status]] begin[{] local_variable[type[char], c] if[binary_operation[member[.c], ==, literal['V']]] begin[{] local_variable[type[char], segment] if[binary_operation[member[.segment], ==, literal['\0']]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=formatPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<separator>"), 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[String], segmentSeparator] local_variable[type[int], minimumSegmentCount] local_variable[type[int], maximumSegmentCount] local_variable[type[int], segmentPadding] if[call[scanner.expect, parameter[literal['{']]]] begin[{] assign[member[.minimumSegmentCount], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] call[scanner.require, parameter[literal[',']]] assign[member[.maximumSegmentCount], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] call[scanner.require, parameter[literal[',']]] assign[member[.segmentPadding], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] call[scanner.require, parameter[literal['}']]] else begin[{] None end[}] member[status.versionSegmentsCount] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None), MemberReference(member=segmentSeparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minimumSegmentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maximumSegmentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=segmentPadding, 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=VersionIdentifierFormatterVersionSegments, sub_type=None))] else begin[{] if[binary_operation[binary_operation[binary_operation[member[.c], ==, literal['P']], ||, binary_operation[member[.c], ==, literal['A']]], ||, binary_operation[member[.c], ==, literal['L']]]] begin[{] local_variable[type[int], maximumLength] if[call[scanner.expect, parameter[literal['{']]]] begin[{] assign[member[.maximumLength], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] call[scanner.require, parameter[literal['}']]] else begin[{] None end[}] if[binary_operation[member[.c], ==, literal['P']]] begin[{] member[status.phaseCount] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None), MemberReference(member=maximumLength, 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=VersionIdentifierFormatterPhase, sub_type=None))] else begin[{] if[binary_operation[member[.c], ==, literal['A']]] begin[{] member[status.phaseCount] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None), MemberReference(member=maximumLength, 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=VersionIdentifierFormatterPhaseAlias, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None), MemberReference(member=maximumLength, 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=VersionIdentifierFormatterLabel, sub_type=None))] end[}] end[}] else begin[{] if[binary_operation[binary_operation[member[.c], ==, literal['R']], ||, binary_operation[member[.c], ==, literal['N']]]] begin[{] local_variable[type[int], padding] if[call[scanner.expect, parameter[literal['{']]]] begin[{] assign[member[.padding], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] call[scanner.require, parameter[literal['}']]] else begin[{] None end[}] if[binary_operation[member[.c], ==, literal['R']]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None), MemberReference(member=padding, 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=VersionIdentifierFormatterRevision, sub_type=None))] else begin[{] member[status.phaseNumberCount] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None), MemberReference(member=padding, 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=VersionIdentifierFormatterPhaseNumber, sub_type=None))] end[}] else begin[{] if[binary_operation[member[.c], ==, literal['T']]] begin[{] local_variable[type[DateFormat], dateFormat] if[call[scanner.expect, parameter[literal['{']]]] begin[{] local_variable[type[String], datePattern] if[binary_operation[member[.datePattern], ==, literal[null]]] begin[{] call[scanner.require, parameter[literal['}']]] else begin[{] None end[}] assign[member[.dateFormat], ClassCreator(arguments=[MemberReference(member=datePattern, 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=SimpleDateFormat, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=iso8601Util, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=dateFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VersionIdentifierFormatterTimestamp, sub_type=None))] else begin[{] if[binary_operation[member[.c], ==, literal['S']]] begin[{] local_variable[type[String], snapshotIndicator] if[call[scanner.expect, parameter[literal['{']]]] begin[{] assign[member[.snapshotIndicator], call[scanner.readUntil, parameter[literal['}'], literal[false]]]] if[binary_operation[member[.snapshotIndicator], ==, literal[null]]] begin[{] call[scanner.require, parameter[literal['}']]] else begin[{] None end[}] else begin[{] None end[}] member[status.snapshotCount] call[infixBuffer.append, parameter[member[.snapshotIndicator]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VersionIdentifierFormatterSnapshot, sub_type=None))] else begin[{] if[binary_operation[member[.c], ==, literal['$']]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=infixBuffer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=StaticFormatter, sub_type=None))] else begin[{] if[binary_operation[binary_operation[member[.c], ==, literal['(']], &&, member[status.inBrace]]] begin[{] assign[member[status.inBrace], literal[true]] return[literal[null]] else begin[{] if[binary_operation[binary_operation[member[.c], ==, literal[')']], &&, member[status.inBrace]]] begin[{] assign[member[status.inBrace], literal[false]] return[literal[null]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Character, 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[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[protected] identifier[Formatter] operator[<] identifier[VersionIdentifier] operator[>] identifier[parseSubFormatter] operator[SEP] identifier[CharSequenceScanner] identifier[scanner] , identifier[String] identifier[formatPattern] , identifier[StringBuilder] identifier[infixBuffer] , identifier[FormatPatternStatus] identifier[status] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[scanner] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[char] identifier[segment] operator[=] identifier[scanner] operator[SEP] identifier[forceNext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[segment] operator[==] literal[String] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[formatPattern] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[segmentSeparator] operator[=] identifier[Character] operator[SEP] identifier[toString] operator[SEP] identifier[segment] operator[SEP] operator[SEP] Keyword[int] identifier[minimumSegmentCount] operator[=] Other[0] operator[SEP] Keyword[int] identifier[maximumSegmentCount] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[int] identifier[segmentPadding] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[scanner] operator[SEP] identifier[expect] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[minimumSegmentCount] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[scanner] operator[SEP] identifier[readLong] operator[SEP] Other[10] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[maximumSegmentCount] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[scanner] operator[SEP] identifier[readLong] operator[SEP] Other[10] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[segmentPadding] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[scanner] operator[SEP] identifier[readLong] operator[SEP] Other[10] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[status] operator[SEP] identifier[versionSegmentsCount] operator[++] operator[SEP] Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterVersionSegments] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[segmentSeparator] , identifier[minimumSegmentCount] , identifier[maximumSegmentCount] , identifier[segmentPadding] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[SEP] { Keyword[int] identifier[maximumLength] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[scanner] operator[SEP] identifier[expect] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[maximumLength] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[scanner] operator[SEP] identifier[readLong] operator[SEP] Other[10] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[status] operator[SEP] identifier[phaseCount] operator[++] operator[SEP] Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterPhase] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[maximumLength] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[status] operator[SEP] identifier[phaseCount] operator[++] operator[SEP] Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterPhaseAlias] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[maximumLength] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterLabel] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[maximumLength] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[SEP] { Keyword[int] identifier[padding] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[scanner] operator[SEP] identifier[expect] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[padding] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[scanner] operator[SEP] identifier[readLong] operator[SEP] Other[10] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterRevision] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[padding] operator[SEP] operator[SEP] } Keyword[else] { identifier[status] operator[SEP] identifier[phaseNumberCount] operator[++] operator[SEP] Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterPhaseNumber] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[padding] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[DateFormat] identifier[dateFormat] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[scanner] operator[SEP] identifier[expect] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[datePattern] operator[=] identifier[scanner] operator[SEP] identifier[readUntil] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[datePattern] operator[==] Other[null] operator[SEP] { identifier[scanner] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[dateFormat] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] identifier[datePattern] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterTimestamp] operator[SEP] Keyword[this] operator[SEP] identifier[iso8601Util] , identifier[dateFormat] , identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[String] identifier[snapshotIndicator] operator[=] identifier[VersionIdentifier] operator[SEP] identifier[SNAPSHOT] operator[SEP] Keyword[if] operator[SEP] identifier[scanner] operator[SEP] identifier[expect] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[snapshotIndicator] operator[=] identifier[scanner] operator[SEP] identifier[readUntil] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[snapshotIndicator] operator[==] Other[null] operator[SEP] { identifier[scanner] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[status] operator[SEP] identifier[snapshotCount] operator[++] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[append] operator[SEP] identifier[snapshotIndicator] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[VersionIdentifierFormatterSnapshot] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[return] Keyword[new] identifier[StaticFormatter] operator[<] operator[>] operator[SEP] identifier[infixBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[status] operator[SEP] identifier[inBrace] operator[SEP] operator[SEP] { identifier[status] operator[SEP] identifier[inBrace] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[status] operator[SEP] identifier[inBrace] operator[SEP] operator[SEP] { identifier[status] operator[SEP] identifier[inBrace] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[Character] operator[SEP] identifier[toString] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] } }
public double precision(int outputNum) { assertIndex(outputNum); //double precision = tp / (double) (tp + fp); return countTruePositive[outputNum] / (double) (countTruePositive[outputNum] + countFalsePositive[outputNum]); }
class class_name[name] begin[{] method[precision, return_type[type[double]], modifier[public], parameter[outputNum]] begin[{] call[.assertIndex, parameter[member[.outputNum]]] return[binary_operation[member[.countTruePositive], /, Cast(expression=BinaryOperation(operandl=MemberReference(member=countTruePositive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=outputNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=countFalsePositive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=outputNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), type=BasicType(dimensions=[], name=double))]] end[}] END[}]
Keyword[public] Keyword[double] identifier[precision] operator[SEP] Keyword[int] identifier[outputNum] operator[SEP] { identifier[assertIndex] operator[SEP] identifier[outputNum] operator[SEP] operator[SEP] Keyword[return] identifier[countTruePositive] operator[SEP] identifier[outputNum] operator[SEP] operator[/] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[countTruePositive] operator[SEP] identifier[outputNum] operator[SEP] operator[+] identifier[countFalsePositive] operator[SEP] identifier[outputNum] operator[SEP] operator[SEP] operator[SEP] }
void buildStatus(Runnable closure) { GhprbBuildStatusContext context = new GhprbBuildStatusContext(); ContextExtensionPoint.executeInContext(closure, context); extensions.add(new GhprbBuildStatus(context.getCompletedStatus())); }
class class_name[name] begin[{] method[buildStatus, return_type[void], modifier[default], parameter[closure]] begin[{] local_variable[type[GhprbBuildStatusContext], context] call[ContextExtensionPoint.executeInContext, parameter[member[.closure], member[.context]]] call[extensions.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getCompletedStatus, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GhprbBuildStatus, sub_type=None))]] end[}] END[}]
Keyword[void] identifier[buildStatus] operator[SEP] identifier[Runnable] identifier[closure] operator[SEP] { identifier[GhprbBuildStatusContext] identifier[context] operator[=] Keyword[new] identifier[GhprbBuildStatusContext] operator[SEP] operator[SEP] operator[SEP] identifier[ContextExtensionPoint] operator[SEP] identifier[executeInContext] operator[SEP] identifier[closure] , identifier[context] operator[SEP] operator[SEP] identifier[extensions] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[GhprbBuildStatus] operator[SEP] identifier[context] operator[SEP] identifier[getCompletedStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void addTriple(final String subject, final String predicate, final String value, final String datatype, final String language) { addQuad(subject, predicate, value, datatype, language, "@default"); }
class class_name[name] begin[{] method[addTriple, return_type[void], modifier[public], parameter[subject, predicate, value, datatype, language]] begin[{] call[.addQuad, parameter[member[.subject], member[.predicate], member[.value], member[.datatype], member[.language], literal["@default"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addTriple] operator[SEP] Keyword[final] identifier[String] identifier[subject] , Keyword[final] identifier[String] identifier[predicate] , Keyword[final] identifier[String] identifier[value] , Keyword[final] identifier[String] identifier[datatype] , Keyword[final] identifier[String] identifier[language] operator[SEP] { identifier[addQuad] operator[SEP] identifier[subject] , identifier[predicate] , identifier[value] , identifier[datatype] , identifier[language] , literal[String] operator[SEP] operator[SEP] }
private static GoogleCredentials getCredentialsWithScopes(final List<String> scopes) throws IOException { GoogleCredentials credentials = null; // first check whether the environment variable is set final String googleCredentialsPath = System.getenv("HELIOS_GOOGLE_CREDENTIALS"); if (googleCredentialsPath != null) { final File file = new File(googleCredentialsPath); if (file.exists()) { try (final FileInputStream s = new FileInputStream(file)) { credentials = GoogleCredentials.fromStream(s); LOG.info("Using Google Credentials from file: " + file.getAbsolutePath()); } } } // fallback to application default credentials if (credentials == null) { credentials = GoogleCredentials.getApplicationDefault(); LOG.info("Using Google Application Default Credentials"); } return scopes.isEmpty() ? credentials : credentials.createScoped(scopes); }
class class_name[name] begin[{] method[getCredentialsWithScopes, return_type[type[GoogleCredentials]], modifier[private static], parameter[scopes]] begin[{] local_variable[type[GoogleCredentials], credentials] local_variable[type[String], googleCredentialsPath] if[binary_operation[member[.googleCredentialsPath], !=, literal[null]]] begin[{] local_variable[type[File], file] if[call[file.exists, parameter[]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=credentials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromStream, postfix_operators=[], prefix_operators=[], qualifier=GoogleCredentials, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Using Google Credentials from file: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=s, type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)))]) else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.credentials], ==, literal[null]]] begin[{] assign[member[.credentials], call[GoogleCredentials.getApplicationDefault, parameter[]]] call[LOG.info, parameter[literal["Using Google Application Default Credentials"]]] else begin[{] None end[}] return[TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=scopes, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=scopes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createScoped, postfix_operators=[], prefix_operators=[], qualifier=credentials, selectors=[], type_arguments=None), if_true=MemberReference(member=credentials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[private] Keyword[static] identifier[GoogleCredentials] identifier[getCredentialsWithScopes] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[scopes] operator[SEP] Keyword[throws] identifier[IOException] { identifier[GoogleCredentials] identifier[credentials] operator[=] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[googleCredentialsPath] operator[=] identifier[System] operator[SEP] identifier[getenv] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[googleCredentialsPath] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[googleCredentialsPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] operator[SEP] Keyword[final] identifier[FileInputStream] identifier[s] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] { identifier[credentials] operator[=] identifier[GoogleCredentials] operator[SEP] identifier[fromStream] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[credentials] operator[==] Other[null] operator[SEP] { identifier[credentials] operator[=] identifier[GoogleCredentials] operator[SEP] identifier[getApplicationDefault] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[scopes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] identifier[credentials] operator[:] identifier[credentials] operator[SEP] identifier[createScoped] operator[SEP] identifier[scopes] operator[SEP] operator[SEP] }
public SDVariable sizeAt(String name, SDVariable in, int dimension) { SDVariable ret = f().sizeAt(in, dimension); return updateVariableNameAndReference(ret, name); }
class class_name[name] begin[{] method[sizeAt, return_type[type[SDVariable]], modifier[public], parameter[name, in, dimension]] begin[{] local_variable[type[SDVariable], ret] return[call[.updateVariableNameAndReference, parameter[member[.ret], member[.name]]]] end[}] END[}]
Keyword[public] identifier[SDVariable] identifier[sizeAt] operator[SEP] identifier[String] identifier[name] , identifier[SDVariable] identifier[in] , Keyword[int] identifier[dimension] operator[SEP] { identifier[SDVariable] identifier[ret] operator[=] identifier[f] operator[SEP] operator[SEP] operator[SEP] identifier[sizeAt] operator[SEP] identifier[in] , identifier[dimension] operator[SEP] operator[SEP] Keyword[return] identifier[updateVariableNameAndReference] operator[SEP] identifier[ret] , identifier[name] operator[SEP] operator[SEP] }
public static TableCellButtonRenderer newTableCellButtonRenderer(String text) { return new TableCellButtonRenderer(null, null) { private static final long serialVersionUID = 1L; @Override protected String onSetText(final Object value) { String currentText = text; return currentText; } }; }
class class_name[name] begin[{] method[newTableCellButtonRenderer, return_type[type[TableCellButtonRenderer]], modifier[public static], parameter[text]] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1L), name=serialVersionUID)], documentation=None, modifiers={'final', 'private', 'static'}, type=BasicType(dimensions=[], name=long)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=currentText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=MemberReference(member=currentText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'protected'}, name=onSetText, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=value, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TableCellButtonRenderer, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[TableCellButtonRenderer] identifier[newTableCellButtonRenderer] operator[SEP] identifier[String] identifier[text] operator[SEP] { Keyword[return] Keyword[new] identifier[TableCellButtonRenderer] operator[SEP] Other[null] , Other[null] operator[SEP] { Keyword[private] Keyword[static] Keyword[final] Keyword[long] identifier[serialVersionUID] operator[=] Other[1L] operator[SEP] annotation[@] identifier[Override] Keyword[protected] identifier[String] identifier[onSetText] operator[SEP] Keyword[final] identifier[Object] identifier[value] operator[SEP] { identifier[String] identifier[currentText] operator[=] identifier[text] operator[SEP] Keyword[return] identifier[currentText] operator[SEP] } } operator[SEP] }
public SipTransaction sendRequestWithTransaction(Request request, boolean viaProxy, Dialog dialog) { return sendRequestWithTransaction(request, viaProxy, dialog, null); }
class class_name[name] begin[{] method[sendRequestWithTransaction, return_type[type[SipTransaction]], modifier[public], parameter[request, viaProxy, dialog]] begin[{] return[call[.sendRequestWithTransaction, parameter[member[.request], member[.viaProxy], member[.dialog], literal[null]]]] end[}] END[}]
Keyword[public] identifier[SipTransaction] identifier[sendRequestWithTransaction] operator[SEP] identifier[Request] identifier[request] , Keyword[boolean] identifier[viaProxy] , identifier[Dialog] identifier[dialog] operator[SEP] { Keyword[return] identifier[sendRequestWithTransaction] operator[SEP] identifier[request] , identifier[viaProxy] , identifier[dialog] , Other[null] operator[SEP] operator[SEP] }
public static String getValueForPath(CmsEntity entity, String path) { String result = null; if (path.startsWith("/")) { path = path.substring(1); } String attributeName; if (path.contains("/")) { attributeName = path.substring(0, path.indexOf("/")); path = path.substring(path.indexOf("/")); } else { attributeName = path; path = null; } int index = org.opencms.acacia.shared.CmsContentDefinition.extractIndex(attributeName); if (index > 0) { index--; } attributeName = entity.getTypeName() + "/" + org.opencms.acacia.shared.CmsContentDefinition.removeIndex(attributeName); CmsEntityAttribute attribute = entity.getAttribute(attributeName); if (!((attribute == null) || (attribute.isComplexValue() && (path == null)))) { if (attribute.isSimpleValue()) { if ((path == null) && (attribute.getValueCount() > 0)) { List<String> values = attribute.getSimpleValues(); result = values.get(index); } } else if (attribute.getValueCount() > (index)) { List<CmsEntity> values = attribute.getComplexValues(); result = getValueForPath(values.get(index), path); } } return result; }
class class_name[name] begin[{] method[getValueForPath, return_type[type[String]], modifier[public static], parameter[entity, path]] begin[{] local_variable[type[String], result] if[call[path.startsWith, parameter[literal["/"]]]] begin[{] assign[member[.path], call[path.substring, parameter[literal[1]]]] else begin[{] None end[}] local_variable[type[String], attributeName] if[call[path.contains, parameter[literal["/"]]]] begin[{] assign[member[.attributeName], call[path.substring, parameter[literal[0], call[path.indexOf, parameter[literal["/"]]]]]] assign[member[.path], call[path.substring, parameter[call[path.indexOf, parameter[literal["/"]]]]]] else begin[{] assign[member[.attributeName], member[.path]] assign[member[.path], literal[null]] end[}] local_variable[type[int], index] if[binary_operation[member[.index], >, literal[0]]] begin[{] member[.index] else begin[{] None end[}] assign[member[.attributeName], binary_operation[binary_operation[call[entity.getTypeName, parameter[]], +, literal["/"]], +, call[org.opencms.acacia.shared.CmsContentDefinition.removeIndex, parameter[member[.attributeName]]]]] local_variable[type[CmsEntityAttribute], attribute] if[binary_operation[binary_operation[member[.attribute], ==, literal[null]], ||, binary_operation[call[attribute.isComplexValue, parameter[]], &&, binary_operation[member[.path], ==, literal[null]]]]] begin[{] if[call[attribute.isSimpleValue, parameter[]]] begin[{] if[binary_operation[binary_operation[member[.path], ==, literal[null]], &&, binary_operation[call[attribute.getValueCount, parameter[]], >, literal[0]]]] begin[{] local_variable[type[List], values] assign[member[.result], call[values.get, parameter[member[.index]]]] else begin[{] None end[}] else begin[{] if[binary_operation[call[attribute.getValueCount, parameter[]], >, member[.index]]] begin[{] local_variable[type[List], values] assign[member[.result], call[.getValueForPath, parameter[call[values.get, parameter[member[.index]]], member[.path]]]] else begin[{] None end[}] end[}] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getValueForPath] operator[SEP] identifier[CmsEntity] identifier[entity] , identifier[String] identifier[path] operator[SEP] { identifier[String] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[path] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[String] identifier[attributeName] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[attributeName] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[path] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[path] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[attributeName] operator[=] identifier[path] operator[SEP] identifier[path] operator[=] Other[null] operator[SEP] } Keyword[int] identifier[index] operator[=] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[acacia] operator[SEP] identifier[shared] operator[SEP] identifier[CmsContentDefinition] operator[SEP] identifier[extractIndex] operator[SEP] identifier[attributeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>] Other[0] operator[SEP] { identifier[index] operator[--] operator[SEP] } identifier[attributeName] operator[=] identifier[entity] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[acacia] operator[SEP] identifier[shared] operator[SEP] identifier[CmsContentDefinition] operator[SEP] identifier[removeIndex] operator[SEP] identifier[attributeName] operator[SEP] operator[SEP] identifier[CmsEntityAttribute] identifier[attribute] operator[=] identifier[entity] operator[SEP] identifier[getAttribute] operator[SEP] identifier[attributeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[attribute] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[attribute] operator[SEP] identifier[isComplexValue] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[attribute] operator[SEP] identifier[isSimpleValue] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[attribute] operator[SEP] identifier[getValueCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[=] identifier[attribute] operator[SEP] identifier[getSimpleValues] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[attribute] operator[SEP] identifier[getValueCount] operator[SEP] operator[SEP] operator[>] operator[SEP] identifier[index] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[CmsEntity] operator[>] identifier[values] operator[=] identifier[attribute] operator[SEP] identifier[getComplexValues] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[getValueForPath] operator[SEP] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] , identifier[path] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public List<E> next() { if (numLeft.equals(total)) { numLeft = numLeft.subtract(BigInteger.ONE); return items; } int temp; // Find largest index j with a[j] < a[j+1] int j = a.length - 2; while (a[j] > a[j + 1]) { j--; } // Find index k such that a[k] is smallest integer // greater than a[j] to the right of a[j] int k = a.length - 1; while (a[j] > a[k]) { k--; } // Interchange a[j] and a[k] temp = a[k]; a[k] = a[j]; a[j] = temp; // Put tail end of permutation after jth position in increasing order int r = a.length - 1; int s = j + 1; while (r > s) { temp = a[s]; a[s] = a[r]; a[r] = temp; r--; s++; } numLeft = numLeft.subtract(BigInteger.ONE); List<E> ans = new ArrayList<E>(a.length); for (int index : a) { ans.add(items.get(index)); } return ans; }
class class_name[name] begin[{] method[next, return_type[type[List]], modifier[public], parameter[]] begin[{] if[call[numLeft.equals, parameter[member[.total]]]] begin[{] assign[member[.numLeft], call[numLeft.subtract, parameter[member[BigInteger.ONE]]]] return[member[.items]] else begin[{] None end[}] local_variable[type[int], temp] local_variable[type[int], j] while[binary_operation[member[.a], >, member[.a]]] begin[{] member[.j] end[}] local_variable[type[int], k] while[binary_operation[member[.a], >, member[.a]]] begin[{] member[.k] end[}] assign[member[.temp], member[.a]] assign[member[.a], member[.a]] assign[member[.a], member[.temp]] local_variable[type[int], r] local_variable[type[int], s] while[binary_operation[member[.r], >, member[.s]]] begin[{] assign[member[.temp], member[.a]] assign[member[.a], member[.a]] assign[member[.a], member[.temp]] member[.r] member[.s] end[}] assign[member[.numLeft], call[numLeft.subtract, parameter[member[BigInteger.ONE]]]] local_variable[type[List], ans] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=items, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ans, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None) return[member[.ans]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[E] operator[>] identifier[next] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[numLeft] operator[SEP] identifier[equals] operator[SEP] identifier[total] operator[SEP] operator[SEP] { identifier[numLeft] operator[=] identifier[numLeft] operator[SEP] identifier[subtract] operator[SEP] identifier[BigInteger] operator[SEP] identifier[ONE] operator[SEP] operator[SEP] Keyword[return] identifier[items] operator[SEP] } Keyword[int] identifier[temp] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[a] operator[SEP] identifier[length] operator[-] Other[2] operator[SEP] Keyword[while] operator[SEP] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[>] identifier[a] operator[SEP] identifier[j] operator[+] Other[1] operator[SEP] operator[SEP] { identifier[j] operator[--] operator[SEP] } Keyword[int] identifier[k] operator[=] identifier[a] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[>] identifier[a] operator[SEP] identifier[k] operator[SEP] operator[SEP] { identifier[k] operator[--] operator[SEP] } identifier[temp] operator[=] identifier[a] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[k] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[temp] operator[SEP] Keyword[int] identifier[r] operator[=] identifier[a] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[int] identifier[s] operator[=] identifier[j] operator[+] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[r] operator[>] identifier[s] operator[SEP] { identifier[temp] operator[=] identifier[a] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[s] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[r] operator[SEP] operator[=] identifier[temp] operator[SEP] identifier[r] operator[--] operator[SEP] identifier[s] operator[++] operator[SEP] } identifier[numLeft] operator[=] identifier[numLeft] operator[SEP] identifier[subtract] operator[SEP] identifier[BigInteger] operator[SEP] identifier[ONE] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] identifier[ans] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[E] operator[>] operator[SEP] identifier[a] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[:] identifier[a] operator[SEP] { identifier[ans] operator[SEP] identifier[add] operator[SEP] identifier[items] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ans] operator[SEP] }
protected void bindColumn(PersistentProperty property, PersistentProperty parentProperty, Column column, ColumnConfig cc, String path, Table table, String sessionFactoryBeanName) { if (cc != null) { column.setComment(cc.getComment()); column.setDefaultValue(cc.getDefaultValue()); column.setCustomRead(cc.getRead()); column.setCustomWrite(cc.getWrite()); } Class<?> userType = getUserType(property); String columnName = getColumnNameForPropertyAndPath(property, path, cc, sessionFactoryBeanName); if ((property instanceof Association) && userType == null) { Association association = (Association) property; // Only use conventional naming when the column has not been explicitly mapped. if (column.getName() == null) { column.setName(columnName); } if (property instanceof ManyToMany) { column.setNullable(false); } else if (property instanceof org.grails.datastore.mapping.model.types.OneToOne && association.isBidirectional() && !association.isOwningSide()) { if (isHasOne(((Association) property).getInverseSide())) { column.setNullable(false); } else { column.setNullable(true); } } else if ((property instanceof ToOne) && association.isCircular()) { column.setNullable(true); } else { column.setNullable(property.isNullable()); } } else { column.setName(columnName); column.setNullable(property.isNullable() || (parentProperty != null && parentProperty.isNullable())); // Use the constraints for this property to more accurately define // the column's length, precision, and scale if (String.class.isAssignableFrom(property.getType()) || byte[].class.isAssignableFrom(property.getType())) { bindStringColumnConstraints(column, property); } if (Number.class.isAssignableFrom(property.getType())) { bindNumericColumnConstraints(column, property, cc); } } handleUniqueConstraint(property, column, path, table, columnName, sessionFactoryBeanName); bindIndex(columnName, column, cc, table); final PersistentEntity owner = property.getOwner(); if (!owner.isRoot()) { Mapping mapping = getMapping(owner); if (mapping == null || mapping.getTablePerHierarchy()) { if (LOG.isDebugEnabled()) LOG.debug("[GrailsDomainBinder] Sub class property [" + property.getName() + "] for column name ["+column.getName()+"] set to nullable"); column.setNullable(true); } else { column.setNullable(property.isNullable()); } } if (LOG.isDebugEnabled()) LOG.debug("[GrailsDomainBinder] bound property [" + property.getName() + "] to column name ["+column.getName()+"] in table ["+table.getName()+"]"); }
class class_name[name] begin[{] method[bindColumn, return_type[void], modifier[protected], parameter[property, parentProperty, column, cc, path, table, sessionFactoryBeanName]] begin[{] if[binary_operation[member[.cc], !=, literal[null]]] begin[{] call[column.setComment, parameter[call[cc.getComment, parameter[]]]] call[column.setDefaultValue, parameter[call[cc.getDefaultValue, parameter[]]]] call[column.setCustomRead, parameter[call[cc.getRead, parameter[]]]] call[column.setCustomWrite, parameter[call[cc.getWrite, parameter[]]]] else begin[{] None end[}] local_variable[type[Class], userType] local_variable[type[String], columnName] if[binary_operation[binary_operation[member[.property], instanceof, type[Association]], &&, binary_operation[member[.userType], ==, literal[null]]]] begin[{] local_variable[type[Association], association] if[binary_operation[call[column.getName, parameter[]], ==, literal[null]]] begin[{] call[column.setName, parameter[member[.columnName]]] else begin[{] None end[}] if[binary_operation[member[.property], instanceof, type[ManyToMany]]] begin[{] call[column.setNullable, parameter[literal[false]]] else begin[{] if[binary_operation[binary_operation[binary_operation[member[.property], instanceof, type[org]], &&, call[association.isBidirectional, parameter[]]], &&, call[association.isOwningSide, parameter[]]]] begin[{] if[call[.isHasOne, parameter[Cast(expression=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Association, sub_type=None))]]] begin[{] call[column.setNullable, parameter[literal[false]]] else begin[{] call[column.setNullable, parameter[literal[true]]] end[}] else begin[{] if[binary_operation[binary_operation[member[.property], instanceof, type[ToOne]], &&, call[association.isCircular, parameter[]]]] begin[{] call[column.setNullable, parameter[literal[true]]] else begin[{] call[column.setNullable, parameter[call[property.isNullable, parameter[]]]] end[}] end[}] end[}] else begin[{] call[column.setName, parameter[member[.columnName]]] call[column.setNullable, parameter[binary_operation[call[property.isNullable, parameter[]], ||, binary_operation[binary_operation[member[.parentProperty], !=, literal[null]], &&, call[parentProperty.isNullable, parameter[]]]]]] if[binary_operation[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ||, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=BasicType(dimensions=[None], name=byte))]] begin[{] call[.bindStringColumnConstraints, parameter[member[.column], member[.property]]] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Number, sub_type=None))] begin[{] call[.bindNumericColumnConstraints, parameter[member[.column], member[.property], member[.cc]]] else begin[{] None end[}] end[}] call[.handleUniqueConstraint, parameter[member[.property], member[.column], member[.path], member[.table], member[.columnName], member[.sessionFactoryBeanName]]] call[.bindIndex, parameter[member[.columnName], member[.column], member[.cc], member[.table]]] local_variable[type[PersistentEntity], owner] if[call[owner.isRoot, parameter[]]] begin[{] local_variable[type[Mapping], mapping] if[binary_operation[binary_operation[member[.mapping], ==, literal[null]], ||, call[mapping.getTablePerHierarchy, parameter[]]]] begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["[GrailsDomainBinder] Sub class property ["], +, call[property.getName, parameter[]]], +, literal["] for column name ["]], +, call[column.getName, parameter[]]], +, literal["] set to nullable"]]]] else begin[{] None end[}] call[column.setNullable, parameter[literal[true]]] else begin[{] call[column.setNullable, parameter[call[property.isNullable, parameter[]]]] end[}] else begin[{] None end[}] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["[GrailsDomainBinder] bound property ["], +, call[property.getName, parameter[]]], +, literal["] to column name ["]], +, call[column.getName, parameter[]]], +, literal["] in table ["]], +, call[table.getName, parameter[]]], +, literal["]"]]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[bindColumn] operator[SEP] identifier[PersistentProperty] identifier[property] , identifier[PersistentProperty] identifier[parentProperty] , identifier[Column] identifier[column] , identifier[ColumnConfig] identifier[cc] , identifier[String] identifier[path] , identifier[Table] identifier[table] , identifier[String] identifier[sessionFactoryBeanName] operator[SEP] { Keyword[if] operator[SEP] identifier[cc] operator[!=] Other[null] operator[SEP] { identifier[column] operator[SEP] identifier[setComment] operator[SEP] identifier[cc] operator[SEP] identifier[getComment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[cc] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setCustomRead] operator[SEP] identifier[cc] operator[SEP] identifier[getRead] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setCustomWrite] operator[SEP] identifier[cc] operator[SEP] identifier[getWrite] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Class] operator[<] operator[?] operator[>] identifier[userType] operator[=] identifier[getUserType] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[String] identifier[columnName] operator[=] identifier[getColumnNameForPropertyAndPath] operator[SEP] identifier[property] , identifier[path] , identifier[cc] , identifier[sessionFactoryBeanName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[property] Keyword[instanceof] identifier[Association] operator[SEP] operator[&&] identifier[userType] operator[==] Other[null] operator[SEP] { identifier[Association] identifier[association] operator[=] operator[SEP] identifier[Association] operator[SEP] identifier[property] operator[SEP] Keyword[if] operator[SEP] identifier[column] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[column] operator[SEP] identifier[setName] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[property] Keyword[instanceof] identifier[ManyToMany] operator[SEP] { identifier[column] operator[SEP] identifier[setNullable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[property] Keyword[instanceof] identifier[org] operator[SEP] identifier[grails] operator[SEP] identifier[datastore] operator[SEP] identifier[mapping] operator[SEP] identifier[model] operator[SEP] identifier[types] operator[SEP] identifier[OneToOne] operator[&&] identifier[association] operator[SEP] identifier[isBidirectional] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[association] operator[SEP] identifier[isOwningSide] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isHasOne] operator[SEP] operator[SEP] operator[SEP] identifier[Association] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[getInverseSide] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[column] operator[SEP] identifier[setNullable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[column] operator[SEP] identifier[setNullable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[property] Keyword[instanceof] identifier[ToOne] operator[SEP] operator[&&] identifier[association] operator[SEP] identifier[isCircular] operator[SEP] operator[SEP] operator[SEP] { identifier[column] operator[SEP] identifier[setNullable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[column] operator[SEP] identifier[setNullable] operator[SEP] identifier[property] operator[SEP] identifier[isNullable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[column] operator[SEP] identifier[setName] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setNullable] operator[SEP] identifier[property] operator[SEP] identifier[isNullable] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[parentProperty] operator[!=] Other[null] operator[&&] identifier[parentProperty] operator[SEP] identifier[isNullable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[property] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[||] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[property] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[bindStringColumnConstraints] operator[SEP] identifier[column] , identifier[property] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Number] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[property] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[bindNumericColumnConstraints] operator[SEP] identifier[column] , identifier[property] , identifier[cc] operator[SEP] operator[SEP] } } identifier[handleUniqueConstraint] operator[SEP] identifier[property] , identifier[column] , identifier[path] , identifier[table] , identifier[columnName] , identifier[sessionFactoryBeanName] operator[SEP] operator[SEP] identifier[bindIndex] operator[SEP] identifier[columnName] , identifier[column] , identifier[cc] , identifier[table] operator[SEP] operator[SEP] Keyword[final] identifier[PersistentEntity] identifier[owner] operator[=] identifier[property] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[owner] operator[SEP] identifier[isRoot] operator[SEP] operator[SEP] operator[SEP] { identifier[Mapping] identifier[mapping] operator[=] identifier[getMapping] operator[SEP] identifier[owner] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mapping] operator[==] Other[null] operator[||] identifier[mapping] operator[SEP] identifier[getTablePerHierarchy] operator[SEP] 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[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[column] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setNullable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[column] operator[SEP] identifier[setNullable] operator[SEP] identifier[property] operator[SEP] identifier[isNullable] operator[SEP] operator[SEP] 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[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[column] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[table] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] }
public static WxOutMsg handle(WxInMsg msg, WxHandler handler) { WxOutMsg out = null; switch (WxMsgType.valueOf(msg.getMsgType())) { case text: out = handler.text(msg); break; case image: out = handler.image(msg); break; case voice: out = handler.voice(msg); break; case video: out = handler.video(msg); break; case location: out = handler.location(msg); break; case link: out = handler.link(msg); break; case event: out = handleEvent(msg, handler); break; case shortvideo: out = handler.shortvideo(msg); break; default: log.infof("New MsyType=%s ? fallback to defaultMsg", msg.getMsgType()); out = handler.defaultMsg(msg); break; } return out; }
class class_name[name] begin[{] method[handle, return_type[type[WxOutMsg]], modifier[public static], parameter[msg, handler]] begin[{] local_variable[type[WxOutMsg], out] SwitchStatement(cases=[SwitchStatementCase(case=['text'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=text, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['image'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=image, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['voice'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=voice, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['video'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=video, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['location'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=location, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['link'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=link, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['event'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['shortvideo'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shortvideo, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="New MsyType=%s ? fallback to defaultMsg"), MethodInvocation(arguments=[], member=getMsgType, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], member=infof, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=defaultMsg, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMsgType, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=WxMsgType, selectors=[], type_arguments=None), label=None) return[member[.out]] end[}] END[}]
Keyword[public] Keyword[static] identifier[WxOutMsg] identifier[handle] operator[SEP] identifier[WxInMsg] identifier[msg] , identifier[WxHandler] identifier[handler] operator[SEP] { identifier[WxOutMsg] identifier[out] operator[=] Other[null] operator[SEP] Keyword[switch] operator[SEP] identifier[WxMsgType] operator[SEP] identifier[valueOf] operator[SEP] identifier[msg] operator[SEP] identifier[getMsgType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[text] operator[:] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[text] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[image] operator[:] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[image] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[voice] operator[:] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[voice] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[video] operator[:] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[video] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[location] operator[:] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[location] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[link] operator[:] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[link] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[event] operator[:] identifier[out] operator[=] identifier[handleEvent] operator[SEP] identifier[msg] , identifier[handler] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[shortvideo] operator[:] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[shortvideo] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[log] operator[SEP] identifier[infof] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getMsgType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[=] identifier[handler] operator[SEP] identifier[defaultMsg] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[return] identifier[out] operator[SEP] }
public long writeToTable(String datasetName, String tableName, String csvData) throws IOException, InterruptedException, TimeoutException { // [START ] TableId tableId = TableId.of(datasetName, tableName); WriteChannelConfiguration writeChannelConfiguration = WriteChannelConfiguration.newBuilder(tableId).setFormatOptions(FormatOptions.csv()).build(); TableDataWriteChannel writer = bigquery.writer(writeChannelConfiguration); // Write data to writer try { writer.write(ByteBuffer.wrap(csvData.getBytes(Charsets.UTF_8))); } finally { writer.close(); } // Get load job Job job = writer.getJob(); job = job.waitFor(); LoadStatistics stats = job.getStatistics(); return stats.getOutputRows(); // [END ] }
class class_name[name] begin[{] method[writeToTable, return_type[type[long]], modifier[public], parameter[datasetName, tableName, csvData]] begin[{] local_variable[type[TableId], tableId] local_variable[type[WriteChannelConfiguration], writeChannelConfiguration] local_variable[type[TableDataWriteChannel], writer] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=Charsets, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=csvData, selectors=[], type_arguments=None)], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=ByteBuffer, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], label=None, resources=None) local_variable[type[Job], job] assign[member[.job], call[job.waitFor, parameter[]]] local_variable[type[LoadStatistics], stats] return[call[stats.getOutputRows, parameter[]]] end[}] END[}]
Keyword[public] Keyword[long] identifier[writeToTable] operator[SEP] identifier[String] identifier[datasetName] , identifier[String] identifier[tableName] , identifier[String] identifier[csvData] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] , identifier[TimeoutException] { identifier[TableId] identifier[tableId] operator[=] identifier[TableId] operator[SEP] identifier[of] operator[SEP] identifier[datasetName] , identifier[tableName] operator[SEP] operator[SEP] identifier[WriteChannelConfiguration] identifier[writeChannelConfiguration] operator[=] identifier[WriteChannelConfiguration] operator[SEP] identifier[newBuilder] operator[SEP] identifier[tableId] operator[SEP] operator[SEP] identifier[setFormatOptions] operator[SEP] identifier[FormatOptions] operator[SEP] identifier[csv] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[TableDataWriteChannel] identifier[writer] operator[=] identifier[bigquery] operator[SEP] identifier[writer] operator[SEP] identifier[writeChannelConfiguration] operator[SEP] operator[SEP] Keyword[try] { identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[csvData] operator[SEP] identifier[getBytes] operator[SEP] identifier[Charsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } identifier[Job] identifier[job] operator[=] identifier[writer] operator[SEP] identifier[getJob] operator[SEP] operator[SEP] operator[SEP] identifier[job] operator[=] identifier[job] operator[SEP] identifier[waitFor] operator[SEP] operator[SEP] operator[SEP] identifier[LoadStatistics] identifier[stats] operator[=] identifier[job] operator[SEP] identifier[getStatistics] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[stats] operator[SEP] identifier[getOutputRows] operator[SEP] operator[SEP] operator[SEP] }
Group getGroup(String id, AccessToken accessToken, String... attributes) { return getResource(id, accessToken, attributes); }
class class_name[name] begin[{] method[getGroup, return_type[type[Group]], modifier[default], parameter[id, accessToken, attributes]] begin[{] return[call[.getResource, parameter[member[.id], member[.accessToken], member[.attributes]]]] end[}] END[}]
identifier[Group] identifier[getGroup] operator[SEP] identifier[String] identifier[id] , identifier[AccessToken] identifier[accessToken] , identifier[String] operator[...] identifier[attributes] operator[SEP] { Keyword[return] identifier[getResource] operator[SEP] identifier[id] , identifier[accessToken] , identifier[attributes] operator[SEP] operator[SEP] }
public CompositeGeneratorNode appendNewLine(final CompositeGeneratorNode parent, final String lineSeparator) { List<IGeneratorNode> _children = parent.getChildren(); NewLineNode _newLineNode = new NewLineNode(lineSeparator, false); _children.add(_newLineNode); return parent; }
class class_name[name] begin[{] method[appendNewLine, return_type[type[CompositeGeneratorNode]], modifier[public], parameter[parent, lineSeparator]] begin[{] local_variable[type[List], _children] local_variable[type[NewLineNode], _newLineNode] call[_children.add, parameter[member[._newLineNode]]] return[member[.parent]] end[}] END[}]
Keyword[public] identifier[CompositeGeneratorNode] identifier[appendNewLine] operator[SEP] Keyword[final] identifier[CompositeGeneratorNode] identifier[parent] , Keyword[final] identifier[String] identifier[lineSeparator] operator[SEP] { identifier[List] operator[<] identifier[IGeneratorNode] operator[>] identifier[_children] operator[=] identifier[parent] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[NewLineNode] identifier[_newLineNode] operator[=] Keyword[new] identifier[NewLineNode] operator[SEP] identifier[lineSeparator] , literal[boolean] operator[SEP] operator[SEP] identifier[_children] operator[SEP] identifier[add] operator[SEP] identifier[_newLineNode] operator[SEP] operator[SEP] Keyword[return] identifier[parent] operator[SEP] }
public static void cublasZhbmv(char uplo, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, Pointer x, int incx, cuDoubleComplex beta, Pointer y, int incy) { cublasZhbmvNative(uplo, n, k, alpha, A, lda, x, incx, beta, y, incy); checkResultBLAS(); }
class class_name[name] begin[{] method[cublasZhbmv, return_type[void], modifier[public static], parameter[uplo, n, k, alpha, A, lda, x, incx, beta, y, incy]] begin[{] call[.cublasZhbmvNative, parameter[member[.uplo], member[.n], member[.k], member[.alpha], member[.A], member[.lda], member[.x], member[.incx], member[.beta], member[.y], member[.incy]]] call[.checkResultBLAS, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cublasZhbmv] operator[SEP] Keyword[char] identifier[uplo] , Keyword[int] identifier[n] , Keyword[int] identifier[k] , identifier[cuDoubleComplex] identifier[alpha] , identifier[Pointer] identifier[A] , Keyword[int] identifier[lda] , identifier[Pointer] identifier[x] , Keyword[int] identifier[incx] , identifier[cuDoubleComplex] identifier[beta] , identifier[Pointer] identifier[y] , Keyword[int] identifier[incy] operator[SEP] { identifier[cublasZhbmvNative] operator[SEP] identifier[uplo] , identifier[n] , identifier[k] , identifier[alpha] , identifier[A] , identifier[lda] , identifier[x] , identifier[incx] , identifier[beta] , identifier[y] , identifier[incy] operator[SEP] operator[SEP] identifier[checkResultBLAS] operator[SEP] operator[SEP] operator[SEP] }
public Edge edgeFromJson(final JSONObject json, final Vertex out, final Vertex in) throws IOException { return this.edgeFromJson(json.toString(), out, in); }
class class_name[name] begin[{] method[edgeFromJson, return_type[type[Edge]], modifier[public], parameter[json, out, in]] begin[{] return[THIS[call[None.edgeFromJson, parameter[call[json.toString, parameter[]], member[.out], member[.in]]]]] end[}] END[}]
Keyword[public] identifier[Edge] identifier[edgeFromJson] operator[SEP] Keyword[final] identifier[JSONObject] identifier[json] , Keyword[final] identifier[Vertex] identifier[out] , Keyword[final] identifier[Vertex] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] Keyword[this] operator[SEP] identifier[edgeFromJson] operator[SEP] identifier[json] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[out] , identifier[in] operator[SEP] operator[SEP] }
public void forwardField(String sourceField, String targetField) { TransformationStep step = new TransformationStep(); step.setTargetField(targetField); step.setSourceFields(sourceField); step.setOperationName("forward"); steps.add(step); }
class class_name[name] begin[{] method[forwardField, return_type[void], modifier[public], parameter[sourceField, targetField]] begin[{] local_variable[type[TransformationStep], step] call[step.setTargetField, parameter[member[.targetField]]] call[step.setSourceFields, parameter[member[.sourceField]]] call[step.setOperationName, parameter[literal["forward"]]] call[steps.add, parameter[member[.step]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[forwardField] operator[SEP] identifier[String] identifier[sourceField] , identifier[String] identifier[targetField] operator[SEP] { identifier[TransformationStep] identifier[step] operator[=] Keyword[new] identifier[TransformationStep] operator[SEP] operator[SEP] operator[SEP] identifier[step] operator[SEP] identifier[setTargetField] operator[SEP] identifier[targetField] operator[SEP] operator[SEP] identifier[step] operator[SEP] identifier[setSourceFields] operator[SEP] identifier[sourceField] operator[SEP] operator[SEP] identifier[step] operator[SEP] identifier[setOperationName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[steps] operator[SEP] identifier[add] operator[SEP] identifier[step] operator[SEP] operator[SEP] }
public final ListTransferRunsPagedResponse listTransferRuns(TransferConfigName parent) { ListTransferRunsRequest request = ListTransferRunsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listTransferRuns(request); }
class class_name[name] begin[{] method[listTransferRuns, return_type[type[ListTransferRunsPagedResponse]], modifier[final public], parameter[parent]] begin[{] local_variable[type[ListTransferRunsRequest], request] return[call[.listTransferRuns, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[ListTransferRunsPagedResponse] identifier[listTransferRuns] operator[SEP] identifier[TransferConfigName] identifier[parent] operator[SEP] { identifier[ListTransferRunsRequest] identifier[request] operator[=] identifier[ListTransferRunsRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[parent] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[listTransferRuns] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public char getChar(String key) { String s = getString(key); if (s == null || s.trim().length() == 0) { return (char) 0; } else { return s.charAt(0); } }
class class_name[name] begin[{] method[getChar, return_type[type[char]], modifier[public], parameter[key]] begin[{] local_variable[type[String], s] if[binary_operation[binary_operation[member[.s], ==, literal[null]], ||, binary_operation[call[s.trim, parameter[]], ==, literal[0]]]] begin[{] return[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=char))] else begin[{] return[call[s.charAt, parameter[literal[0]]]] end[}] end[}] END[}]
Keyword[public] Keyword[char] identifier[getChar] operator[SEP] identifier[String] identifier[key] operator[SEP] { identifier[String] identifier[s] operator[=] identifier[getString] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[||] identifier[s] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] Keyword[char] operator[SEP] Other[0] operator[SEP] } Keyword[else] { Keyword[return] identifier[s] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] } }
private void insert(Model target, BioPAXElement bpe) { // do nothing if you already inserted this if (!target.contains(bpe)) { //if there is an identical (in fact, "equal") object BioPAXElement ibpe = target.getByID(bpe.getUri()); if (ibpe != null && ibpe.equals(bpe)) /* - ibpe.equals(bpe) can be 'false' here, because, * even though the above !target.contains(bpe) is true, * it probably compared objects using '==' operator * (see the ModelImpl for details) */ { updateObjectFields(bpe, ibpe, target); // We have a merged element, add it into the tracker mergedElements.add(ibpe); } else { target.add(bpe); this.addIntoEquivalanceMap(bpe); traverser.traverse(bpe, target); // We have a new element, add it into the tracker addedElements.add(bpe); } } }
class class_name[name] begin[{] method[insert, return_type[void], modifier[private], parameter[target, bpe]] begin[{] if[call[target.contains, parameter[member[.bpe]]]] begin[{] local_variable[type[BioPAXElement], ibpe] if[binary_operation[binary_operation[member[.ibpe], !=, literal[null]], &&, call[ibpe.equals, parameter[member[.bpe]]]]] begin[{] call[.updateObjectFields, parameter[member[.bpe], member[.ibpe], member[.target]]] call[mergedElements.add, parameter[member[.ibpe]]] else begin[{] call[target.add, parameter[member[.bpe]]] THIS[call[None.addIntoEquivalanceMap, parameter[member[.bpe]]]] call[traverser.traverse, parameter[member[.bpe], member[.target]]] call[addedElements.add, parameter[member[.bpe]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[insert] operator[SEP] identifier[Model] identifier[target] , identifier[BioPAXElement] identifier[bpe] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[target] operator[SEP] identifier[contains] operator[SEP] identifier[bpe] operator[SEP] operator[SEP] { identifier[BioPAXElement] identifier[ibpe] operator[=] identifier[target] operator[SEP] identifier[getByID] operator[SEP] identifier[bpe] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ibpe] operator[!=] Other[null] operator[&&] identifier[ibpe] operator[SEP] identifier[equals] operator[SEP] identifier[bpe] operator[SEP] operator[SEP] { identifier[updateObjectFields] operator[SEP] identifier[bpe] , identifier[ibpe] , identifier[target] operator[SEP] operator[SEP] identifier[mergedElements] operator[SEP] identifier[add] operator[SEP] identifier[ibpe] operator[SEP] operator[SEP] } Keyword[else] { identifier[target] operator[SEP] identifier[add] operator[SEP] identifier[bpe] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[addIntoEquivalanceMap] operator[SEP] identifier[bpe] operator[SEP] operator[SEP] identifier[traverser] operator[SEP] identifier[traverse] operator[SEP] identifier[bpe] , identifier[target] operator[SEP] operator[SEP] identifier[addedElements] operator[SEP] identifier[add] operator[SEP] identifier[bpe] operator[SEP] operator[SEP] } } }
private InputStream getInputStream(String url) throws Exception { HttpGet getMethod = new HttpGet(url); DefaultHttpClient client = new DefaultHttpClient(m_cManager); client.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, TIMEOUT_SECONDS * 1000); UsernamePasswordCredentials creds = getCreds(url); if (creds != null) { client.getCredentialsProvider().setCredentials(AuthScope.ANY, creds); client.addRequestInterceptor(new PreemptiveAuth()); } client.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, true); HttpInputStream in = new HttpInputStream(client, getMethod); if (in.getStatusCode() != 200) { try { in.close(); } catch (Exception e) { } throw new IOException("HTTP request failed. Got status code " + in.getStatusCode() + " from remote server while attempting to GET " + url); } else { return in; } }
class class_name[name] begin[{] method[getInputStream, return_type[type[InputStream]], modifier[private], parameter[url]] begin[{] local_variable[type[HttpGet], getMethod] local_variable[type[DefaultHttpClient], client] call[client.getParams, parameter[]] local_variable[type[UsernamePasswordCredentials], creds] if[binary_operation[member[.creds], !=, literal[null]]] begin[{] call[client.getCredentialsProvider, parameter[]] call[client.addRequestInterceptor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PreemptiveAuth, sub_type=None))]] else begin[{] None end[}] call[client.getParams, parameter[]] local_variable[type[HttpInputStream], in] if[binary_operation[call[in.getStatusCode, parameter[]], !=, literal[200]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HTTP request failed. Got status code "), operandr=MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from remote server while attempting to GET "), operator=+), operandr=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] return[member[.in]] end[}] end[}] END[}]
Keyword[private] identifier[InputStream] identifier[getInputStream] operator[SEP] identifier[String] identifier[url] operator[SEP] Keyword[throws] identifier[Exception] { identifier[HttpGet] identifier[getMethod] operator[=] Keyword[new] identifier[HttpGet] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[DefaultHttpClient] identifier[client] operator[=] Keyword[new] identifier[DefaultHttpClient] operator[SEP] identifier[m_cManager] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] identifier[setIntParameter] operator[SEP] identifier[CoreConnectionPNames] operator[SEP] identifier[CONNECTION_TIMEOUT] , identifier[TIMEOUT_SECONDS] operator[*] Other[1000] operator[SEP] operator[SEP] identifier[UsernamePasswordCredentials] identifier[creds] operator[=] identifier[getCreds] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[creds] operator[!=] Other[null] operator[SEP] { identifier[client] operator[SEP] identifier[getCredentialsProvider] operator[SEP] operator[SEP] operator[SEP] identifier[setCredentials] operator[SEP] identifier[AuthScope] operator[SEP] identifier[ANY] , identifier[creds] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[addRequestInterceptor] operator[SEP] Keyword[new] identifier[PreemptiveAuth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[client] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] identifier[setBooleanParameter] operator[SEP] identifier[ClientPNames] operator[SEP] identifier[HANDLE_REDIRECTS] , literal[boolean] operator[SEP] operator[SEP] identifier[HttpInputStream] identifier[in] operator[=] Keyword[new] identifier[HttpInputStream] operator[SEP] identifier[client] , identifier[getMethod] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[in] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[!=] Other[200] operator[SEP] { Keyword[try] { identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[in] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[url] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[in] operator[SEP] } }
public void setClasspath (Path path) { _cloader = ClasspathUtils.getClassLoaderForPath(getProject(), path, "narya"); // set the parent of the classloader to be the classloader used to load this task, rather // than the classloader used to load Ant, so that we have access to Narya classes like // TransportHint ((AntClassLoader)_cloader).setParent(getClass().getClassLoader()); }
class class_name[name] begin[{] method[setClasspath, return_type[void], modifier[public], parameter[path]] begin[{] assign[member[._cloader], call[ClasspathUtils.getClassLoaderForPath, parameter[call[.getProject, parameter[]], member[.path], literal["narya"]]]] Cast(expression=MemberReference(member=_cloader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AntClassLoader, sub_type=None)) end[}] END[}]
Keyword[public] Keyword[void] identifier[setClasspath] operator[SEP] identifier[Path] identifier[path] operator[SEP] { identifier[_cloader] operator[=] identifier[ClasspathUtils] operator[SEP] identifier[getClassLoaderForPath] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] , identifier[path] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AntClassLoader] operator[SEP] identifier[_cloader] operator[SEP] operator[SEP] identifier[setParent] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void addRelation() { try { if (m_throwable != null) { // relation data is corrupt, ignore relation if (LOG.isWarnEnabled()) { LOG.warn( Messages.get().getBundle().key( Messages.LOG_IMPORTEXPORT_ERROR_IMPORTING_RELATION_1, m_destination), m_throwable); } getReport().println(m_throwable); getReport().addError(m_throwable); m_throwable = null; return; } RelationData relData = new RelationData(m_relationPath, m_relationId, m_relationType); m_relationsForResource.add(relData); m_relationData.put(Integer.valueOf(m_fileCounter), relData); } finally { m_relationId = null; m_relationPath = null; m_relationType = null; } }
class class_name[name] begin[{] method[addRelation, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_throwable, 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=isWarnEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_IMPORTEXPORT_ERROR_IMPORTING_RELATION_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=m_destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=m_throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getReport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=m_throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getReport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=m_throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addError, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_throwable, 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)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=m_relationPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_relationId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_relationType, 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=RelationData, sub_type=None)), name=relData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RelationData, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=relData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=m_relationsForResource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=m_fileCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MemberReference(member=relData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=m_relationData, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_relationId, 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=m_relationPath, 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=m_relationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[addRelation] operator[SEP] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[m_throwable] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_IMPORTEXPORT_ERROR_IMPORTING_RELATION_1] , identifier[m_destination] operator[SEP] , identifier[m_throwable] operator[SEP] operator[SEP] } identifier[getReport] operator[SEP] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[m_throwable] operator[SEP] operator[SEP] identifier[getReport] operator[SEP] operator[SEP] operator[SEP] identifier[addError] operator[SEP] identifier[m_throwable] operator[SEP] operator[SEP] identifier[m_throwable] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } identifier[RelationData] identifier[relData] operator[=] Keyword[new] identifier[RelationData] operator[SEP] identifier[m_relationPath] , identifier[m_relationId] , identifier[m_relationType] operator[SEP] operator[SEP] identifier[m_relationsForResource] operator[SEP] identifier[add] operator[SEP] identifier[relData] operator[SEP] operator[SEP] identifier[m_relationData] operator[SEP] identifier[put] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[m_fileCounter] operator[SEP] , identifier[relData] operator[SEP] operator[SEP] } Keyword[finally] { identifier[m_relationId] operator[=] Other[null] operator[SEP] identifier[m_relationPath] operator[=] Other[null] operator[SEP] identifier[m_relationType] operator[=] Other[null] operator[SEP] } }
String getDocumentationDir() { String baseDir = project.getBuild().getDirectory(); if (baseDir == null || new File(baseDir).exists()) { baseDir = project.getBasedir().getAbsolutePath(); baseDir = baseDir + "/target"; if (!new File(baseDir).exists()) { //maven plugin declared in child module baseDir = project.getBasedir().getAbsolutePath(); } } if (!baseDir.endsWith("/")) { baseDir = baseDir + "/"; } if (outputDir == null) { outputDir = "cukedoctor/"; } if (!outputDir.endsWith("/")) { outputDir = outputDir + "/"; } return baseDir + outputDir; }
class class_name[name] begin[{] method[getDocumentationDir, return_type[type[String]], modifier[default], parameter[]] begin[{] local_variable[type[String], baseDir] if[binary_operation[binary_operation[member[.baseDir], ==, literal[null]], ||, ClassCreator(arguments=[MemberReference(member=baseDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=exists, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]] begin[{] assign[member[.baseDir], call[project.getBasedir, parameter[]]] assign[member[.baseDir], binary_operation[member[.baseDir], +, literal["/target"]]] if[ClassCreator(arguments=[MemberReference(member=baseDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[], member=exists, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] begin[{] assign[member[.baseDir], call[project.getBasedir, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] if[call[baseDir.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.baseDir], binary_operation[member[.baseDir], +, literal["/"]]] else begin[{] None end[}] if[binary_operation[member[.outputDir], ==, literal[null]]] begin[{] assign[member[.outputDir], literal["cukedoctor/"]] else begin[{] None end[}] if[call[outputDir.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.outputDir], binary_operation[member[.outputDir], +, literal["/"]]] else begin[{] None end[}] return[binary_operation[member[.baseDir], +, member[.outputDir]]] end[}] END[}]
identifier[String] identifier[getDocumentationDir] operator[SEP] operator[SEP] { identifier[String] identifier[baseDir] operator[=] identifier[project] operator[SEP] identifier[getBuild] operator[SEP] operator[SEP] operator[SEP] identifier[getDirectory] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[baseDir] operator[==] Other[null] operator[||] Keyword[new] identifier[File] operator[SEP] identifier[baseDir] operator[SEP] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[baseDir] operator[=] identifier[project] operator[SEP] identifier[getBasedir] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[baseDir] operator[=] identifier[baseDir] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[new] identifier[File] operator[SEP] identifier[baseDir] operator[SEP] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[baseDir] operator[=] identifier[project] operator[SEP] identifier[getBasedir] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[baseDir] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[baseDir] operator[=] identifier[baseDir] operator[+] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[outputDir] operator[==] Other[null] operator[SEP] { identifier[outputDir] operator[=] literal[String] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[outputDir] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[outputDir] operator[=] identifier[outputDir] operator[+] literal[String] operator[SEP] } Keyword[return] identifier[baseDir] operator[+] identifier[outputDir] operator[SEP] }
public boolean add(Object obj) { if (obj == null) { obj = NULL; } Entry tab[] = mTable; int hash = hashCode(obj); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; e = e.mNext) { Object iobj = e.get(); if (iobj == null) { // Clean up after a cleared Reference. if (prev != null) { prev.mNext = e.mNext; } else { tab[index] = e.mNext; } mCount--; } else if (e.mHash == hash && obj.getClass() == iobj.getClass() && equals(obj, iobj)) { // Already in set. return false; } else { prev = e; } } if (mCount >= mThreshold) { // Cleanup the table if the threshold is exceeded. cleanup(); } if (mCount >= mThreshold) { // Rehash the table if the threshold is still exceeded. rehash(); tab = mTable; index = (hash & 0x7FFFFFFF) % tab.length; } // Create a new entry. tab[index] = new Entry((obj == NULL ? new Null() : obj), hash, tab[index]); mCount++; return true; }
class class_name[name] begin[{] method[add, return_type[type[boolean]], modifier[public], parameter[obj]] begin[{] if[binary_operation[member[.obj], ==, literal[null]]] begin[{] assign[member[.obj], member[.NULL]] else begin[{] None end[}] local_variable[type[Entry], tab] local_variable[type[int], hash] local_variable[type[int], index] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=iobj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=iobj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mHash, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[]), operandr=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=iobj, selectors=[], type_arguments=None), operator===), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iobj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prev, 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=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=mNext, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mNext, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[]), type==, value=MemberReference(member=mNext, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[])), label=None)])), StatementExpression(expression=MemberReference(member=mCount, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=e), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=prev)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=mNext, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[]))]), label=None) if[binary_operation[member[.mCount], >=, member[.mThreshold]]] begin[{] call[.cleanup, parameter[]] else begin[{] None end[}] if[binary_operation[member[.mCount], >=, member[.mThreshold]]] begin[{] call[.rehash, parameter[]] assign[member[.tab], member[.mTable]] assign[member[.index], binary_operation[binary_operation[member[.hash], &, literal[0x7FFFFFFF]], %, member[tab.length]]] else begin[{] None end[}] assign[member[.tab], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Null, sub_type=None))), MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, 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=Entry, sub_type=None))] member[.mCount] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[add] operator[SEP] identifier[Object] identifier[obj] operator[SEP] { Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] { identifier[obj] operator[=] identifier[NULL] operator[SEP] } identifier[Entry] identifier[tab] operator[SEP] operator[SEP] operator[=] identifier[mTable] operator[SEP] Keyword[int] identifier[hash] operator[=] identifier[hashCode] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] operator[SEP] identifier[hash] operator[&] literal[Integer] operator[SEP] operator[%] identifier[tab] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] identifier[e] operator[=] identifier[tab] operator[SEP] identifier[index] operator[SEP] , identifier[prev] operator[=] Other[null] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] identifier[e] operator[=] identifier[e] operator[SEP] identifier[mNext] operator[SEP] { identifier[Object] identifier[iobj] operator[=] identifier[e] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iobj] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[prev] operator[!=] Other[null] operator[SEP] { identifier[prev] operator[SEP] identifier[mNext] operator[=] identifier[e] operator[SEP] identifier[mNext] operator[SEP] } Keyword[else] { identifier[tab] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[e] operator[SEP] identifier[mNext] operator[SEP] } identifier[mCount] operator[--] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[mHash] operator[==] identifier[hash] operator[&&] identifier[obj] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[==] identifier[iobj] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[&&] identifier[equals] operator[SEP] identifier[obj] , identifier[iobj] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { identifier[prev] operator[=] identifier[e] operator[SEP] } } Keyword[if] operator[SEP] identifier[mCount] operator[>=] identifier[mThreshold] operator[SEP] { identifier[cleanup] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mCount] operator[>=] identifier[mThreshold] operator[SEP] { identifier[rehash] operator[SEP] operator[SEP] operator[SEP] identifier[tab] operator[=] identifier[mTable] operator[SEP] identifier[index] operator[=] operator[SEP] identifier[hash] operator[&] literal[Integer] operator[SEP] operator[%] identifier[tab] operator[SEP] identifier[length] operator[SEP] } identifier[tab] operator[SEP] identifier[index] operator[SEP] operator[=] Keyword[new] identifier[Entry] operator[SEP] operator[SEP] identifier[obj] operator[==] identifier[NULL] operator[?] Keyword[new] identifier[Null] operator[SEP] operator[SEP] operator[:] identifier[obj] operator[SEP] , identifier[hash] , identifier[tab] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] identifier[mCount] operator[++] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
@Override public void visitClassContext(ClassContext classContext) { try { classVersion = classContext.getJavaClass().getMajor(); if (classVersion >= Const.MAJOR_1_4) { stack = new OpcodeStack(); super.visitClassContext(classContext); } } finally { stack = null; } }
class class_name[name] begin[{] method[visitClassContext, return_type[void], modifier[public], parameter[classContext]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=classVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getJavaClass, postfix_operators=[], prefix_operators=[], qualifier=classContext, selectors=[MethodInvocation(arguments=[], member=getMajor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=classVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAJOR_1_4, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stack, 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=OpcodeStack, sub_type=None))), label=None), StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=classContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitClassContext, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitClassContext] operator[SEP] identifier[ClassContext] identifier[classContext] operator[SEP] { Keyword[try] { identifier[classVersion] operator[=] identifier[classContext] operator[SEP] identifier[getJavaClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMajor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classVersion] operator[>=] identifier[Const] operator[SEP] identifier[MAJOR_1_4] operator[SEP] { identifier[stack] operator[=] Keyword[new] identifier[OpcodeStack] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[visitClassContext] operator[SEP] identifier[classContext] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[stack] operator[=] Other[null] operator[SEP] } }
protected boolean isParentAnnotatedWithTraceeContextProvider(final Element element) { Element parentElement = element.getEnclosingElement(); if (parentElement == null || parentElement.getKind() != ElementKind.CLASS || !isTypeAnnotatedWithTraceeContextProvider((TypeElement) parentElement)) { error(element, "Enclosing type of method %s annotated with annotation %s is not annotated with annotation %s.", element.getSimpleName(), Flatten.class.getSimpleName(), TraceeContextProvider.class.getSimpleName()); return false; } return true; }
class class_name[name] begin[{] method[isParentAnnotatedWithTraceeContextProvider, return_type[type[boolean]], modifier[protected], parameter[element]] begin[{] local_variable[type[Element], parentElement] if[binary_operation[binary_operation[binary_operation[member[.parentElement], ==, literal[null]], ||, binary_operation[call[parentElement.getKind, parameter[]], !=, member[ElementKind.CLASS]]], ||, call[.isTypeAnnotatedWithTraceeContextProvider, parameter[Cast(expression=MemberReference(member=parentElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TypeElement, sub_type=None))]]]] begin[{] call[.error, parameter[member[.element], literal["Enclosing type of method %s annotated with annotation %s is not annotated with annotation %s."], call[element.getSimpleName, parameter[]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Flatten, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TraceeContextProvider, sub_type=None))]] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isParentAnnotatedWithTraceeContextProvider] operator[SEP] Keyword[final] identifier[Element] identifier[element] operator[SEP] { identifier[Element] identifier[parentElement] operator[=] identifier[element] operator[SEP] identifier[getEnclosingElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parentElement] operator[==] Other[null] operator[||] identifier[parentElement] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[!=] identifier[ElementKind] operator[SEP] identifier[CLASS] operator[||] operator[!] identifier[isTypeAnnotatedWithTraceeContextProvider] operator[SEP] operator[SEP] identifier[TypeElement] operator[SEP] identifier[parentElement] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[element] , literal[String] , identifier[element] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[Flatten] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[TraceeContextProvider] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private void appendLinebreaks(Tag tag, boolean open) { String name = tag.getTagName(); int pos = TAG_LIST.indexOf(name); switch (pos) { case 0: // H1 setMarker("=", open); setIndentation(2, open); appendLinebreak(2); break; case 1: // H2 setMarker("==", open); setIndentation(3, open); appendLinebreak(2); break; case 2: // H3 setMarker("===", open); setIndentation(4, open); appendLinebreak(2); break; case 3: // H4 setMarker("====", open); setIndentation(5, open); appendLinebreak(2); break; case 4: // H5 setMarker("=====", open); setIndentation(6, open); appendLinebreak(2); break; case 5: // H6 setMarker("=======", open); setIndentation(7, open); appendLinebreak(2); break; case 6: // P case 7: // DIV appendLinebreak(2); break; case 8: // SPAN break; case 9: // BR appendLinebreak(1, true); break; case 10: // OL case 11: // UL appendLinebreak(2); break; case 12: // LI setMarker("*", open); setIndentation(5, open); appendLinebreak(1); break; case 13: // TABLE setIndentation(5, open); appendLinebreak(2); if (open) { appendLinebreak(1); appendText("-----"); appendLinebreak(1); } break; case 14: // TD setMarker("--", open); appendLinebreak(2); break; case 15: // TR if (!open) { appendLinebreak(1); appendText("-----"); appendLinebreak(1); } break; case 16: // TH case 17: // THEAD case 18: // TBODY case 19: // TFOOT appendLinebreak(1); break; default: // unknown tag (ignore) } }
class class_name[name] begin[{] method[appendLinebreaks, return_type[void], modifier[private], parameter[tag, open]] begin[{] local_variable[type[String], name] local_variable[type[int], pos] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="="), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=="), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="==="), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="===="), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="====="), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="======="), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=9)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*"), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=13)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIndentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-----")], member=appendText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=14)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="--"), MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15)], statements=[IfStatement(condition=MemberReference(member=open, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-----")], member=appendText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=17), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=19)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=appendLinebreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[])], expression=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[appendLinebreaks] operator[SEP] identifier[Tag] identifier[tag] , Keyword[boolean] identifier[open] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[tag] operator[SEP] identifier[getTagName] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] identifier[TAG_LIST] operator[SEP] identifier[indexOf] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[pos] operator[SEP] { Keyword[case] Other[0] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[setIndentation] operator[SEP] Other[2] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[1] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[setIndentation] operator[SEP] Other[3] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[setIndentation] operator[SEP] Other[4] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[setIndentation] operator[SEP] Other[5] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[setIndentation] operator[SEP] Other[6] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[5] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[setIndentation] operator[SEP] Other[7] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[6] operator[:] Keyword[case] Other[7] operator[:] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[8] operator[:] Keyword[break] operator[SEP] Keyword[case] Other[9] operator[:] identifier[appendLinebreak] operator[SEP] Other[1] , literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[10] operator[:] Keyword[case] Other[11] operator[:] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[12] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[setIndentation] operator[SEP] Other[5] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[13] operator[:] identifier[setIndentation] operator[SEP] Other[5] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[open] operator[SEP] { identifier[appendLinebreak] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[appendText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[14] operator[:] identifier[setMarker] operator[SEP] literal[String] , identifier[open] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[15] operator[:] Keyword[if] operator[SEP] operator[!] identifier[open] operator[SEP] { identifier[appendLinebreak] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[appendText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[appendLinebreak] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[16] operator[:] Keyword[case] Other[17] operator[:] Keyword[case] Other[18] operator[:] Keyword[case] Other[19] operator[:] identifier[appendLinebreak] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] } }
public Set<Explanation<OWLAxiom>> getExplanations(OWLAxiom entailment, int limit) throws ExplanationException { OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); SyntacticLocalityModuleExtractor extractor = new SyntacticLocalityModuleExtractor(manager, (OWLOntology) null, workingAxioms, ModuleType.STAR); module = extractor.extract(entailment.getSignature()); BlackBoxExplanationGenerator2<OWLAxiom> gen = new BlackBoxExplanationGenerator2<OWLAxiom>(module, entailmentCheckerFactory, new StructuralTypePriorityExpansionStrategy(), new DivideAndConquerContractionStrategy(), new NullExplanationProgressMonitor<OWLAxiom>()); Set<Explanation<OWLAxiom>> expls = gen.getExplanations(entailment, 1); Explanation<OWLAxiom> expl = expls.iterator().next(); Set<OWLAxiom> commonAxioms = new HashSet<OWLAxiom>(); for(OWLAxiom ax : expl.getAxioms()) { module.remove(ax); EntailmentChecker<OWLAxiom> entailmentChecker = entailmentCheckerFactory.createEntailementChecker(entailment); if(!entailmentChecker.isEntailed(module)) { commonAxioms.add(ax); } module.add(ax); } System.out.println("There are " + commonAxioms.size() + " common axioms"); Set<OWLEntity> commonAxiomsSig = new HashSet<OWLEntity>(); for(OWLAxiom ax : commonAxioms) { System.out.println("\t" + ax); commonAxiomsSig.addAll(ax.getSignature()); } Set<OWLAxiom> expansionCandidates = new HashSet<OWLAxiom>(); Set<OWLAxiom> directExpansionCandidates = new HashSet<OWLAxiom>(); for(OWLAxiom ax : module) { if (!commonAxioms.contains(ax)) { for(OWLEntity ent : ax.getSignature()) { if(commonAxiomsSig.contains(ent)) { expansionCandidates.add(ax); for(OWLEntity entailmentEnt : entailment.getSignature()) { if(ax.getSignature().contains(entailmentEnt)) { directExpansionCandidates.add(ax); } } } } } } System.out.println("There are " + directExpansionCandidates.size() + " direct expansion candidates"); for(OWLAxiom ax : new TreeSet<OWLAxiom>(directExpansionCandidates)) { System.out.println("\t" + ax); } System.out.println("There are " + expansionCandidates.size() + " expansion candidates"); for(OWLAxiom ax : new TreeSet<OWLAxiom>(expansionCandidates)) { System.out.println("\t" + ax); } return Collections.emptySet(); }
class class_name[name] begin[{] method[getExplanations, return_type[type[Set]], modifier[public], parameter[entailment, limit]] begin[{] local_variable[type[OWLOntologyManager], manager] local_variable[type[SyntacticLocalityModuleExtractor], extractor] assign[member[.module], call[extractor.extract, parameter[call[entailment.getSignature, parameter[]]]]] local_variable[type[BlackBoxExplanationGenerator2], gen] local_variable[type[Set], expls] local_variable[type[Explanation], expl] local_variable[type[Set], commonAxioms] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=module, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=entailment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createEntailementChecker, postfix_operators=[], prefix_operators=[], qualifier=entailmentCheckerFactory, selectors=[], type_arguments=None), name=entailmentChecker)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=OWLAxiom, sub_type=None))], dimensions=[], name=EntailmentChecker, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEntailed, postfix_operators=[], prefix_operators=['!'], qualifier=entailmentChecker, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=commonAxioms, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=module, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAxioms, postfix_operators=[], prefix_operators=[], qualifier=expl, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ax)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OWLAxiom, sub_type=None))), label=None) call[System.out.println, parameter[binary_operation[binary_operation[literal["There are "], +, call[commonAxioms.size, parameter[]]], +, literal[" common axioms"]]]] local_variable[type[Set], commonAxiomsSig] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operandr=MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSignature, postfix_operators=[], prefix_operators=[], qualifier=ax, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=commonAxiomsSig, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=commonAxioms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ax)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OWLAxiom, sub_type=None))), label=None) local_variable[type[Set], expansionCandidates] local_variable[type[Set], directExpansionCandidates] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=commonAxioms, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=commonAxiomsSig, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=expansionCandidates, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getSignature, postfix_operators=[], prefix_operators=[], qualifier=ax, selectors=[MethodInvocation(arguments=[MemberReference(member=entailmentEnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=directExpansionCandidates, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSignature, postfix_operators=[], prefix_operators=[], qualifier=entailment, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entailmentEnt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OWLEntity, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSignature, postfix_operators=[], prefix_operators=[], qualifier=ax, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OWLEntity, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ax)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OWLAxiom, sub_type=None))), label=None) call[System.out.println, parameter[binary_operation[binary_operation[literal["There are "], +, call[directExpansionCandidates.size, parameter[]]], +, literal[" direct expansion candidates"]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operandr=MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=ClassCreator(arguments=[MemberReference(member=directExpansionCandidates, 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=OWLAxiom, sub_type=None))], dimensions=None, name=TreeSet, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ax)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OWLAxiom, sub_type=None))), label=None) call[System.out.println, parameter[binary_operation[binary_operation[literal["There are "], +, call[expansionCandidates.size, parameter[]]], +, literal[" expansion candidates"]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operandr=MemberReference(member=ax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=ClassCreator(arguments=[MemberReference(member=expansionCandidates, 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=OWLAxiom, sub_type=None))], dimensions=None, name=TreeSet, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ax)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OWLAxiom, sub_type=None))), label=None) return[call[Collections.emptySet, parameter[]]] end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[Explanation] operator[<] identifier[OWLAxiom] operator[>] operator[>] identifier[getExplanations] operator[SEP] identifier[OWLAxiom] identifier[entailment] , Keyword[int] identifier[limit] operator[SEP] Keyword[throws] identifier[ExplanationException] { identifier[OWLOntologyManager] identifier[manager] operator[=] identifier[OWLManager] operator[SEP] identifier[createOWLOntologyManager] operator[SEP] operator[SEP] operator[SEP] identifier[SyntacticLocalityModuleExtractor] identifier[extractor] operator[=] Keyword[new] identifier[SyntacticLocalityModuleExtractor] operator[SEP] identifier[manager] , operator[SEP] identifier[OWLOntology] operator[SEP] Other[null] , identifier[workingAxioms] , identifier[ModuleType] operator[SEP] identifier[STAR] operator[SEP] operator[SEP] identifier[module] operator[=] identifier[extractor] operator[SEP] identifier[extract] operator[SEP] identifier[entailment] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BlackBoxExplanationGenerator2] operator[<] identifier[OWLAxiom] operator[>] identifier[gen] operator[=] Keyword[new] identifier[BlackBoxExplanationGenerator2] operator[<] identifier[OWLAxiom] operator[>] operator[SEP] identifier[module] , identifier[entailmentCheckerFactory] , Keyword[new] identifier[StructuralTypePriorityExpansionStrategy] operator[SEP] operator[SEP] , Keyword[new] identifier[DivideAndConquerContractionStrategy] operator[SEP] operator[SEP] , Keyword[new] identifier[NullExplanationProgressMonitor] operator[<] identifier[OWLAxiom] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Explanation] operator[<] identifier[OWLAxiom] operator[>] operator[>] identifier[expls] operator[=] identifier[gen] operator[SEP] identifier[getExplanations] operator[SEP] identifier[entailment] , Other[1] operator[SEP] operator[SEP] identifier[Explanation] operator[<] identifier[OWLAxiom] operator[>] identifier[expl] operator[=] identifier[expls] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[OWLAxiom] operator[>] identifier[commonAxioms] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[OWLAxiom] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OWLAxiom] identifier[ax] operator[:] identifier[expl] operator[SEP] identifier[getAxioms] operator[SEP] operator[SEP] operator[SEP] { identifier[module] operator[SEP] identifier[remove] operator[SEP] identifier[ax] operator[SEP] operator[SEP] identifier[EntailmentChecker] operator[<] identifier[OWLAxiom] operator[>] identifier[entailmentChecker] operator[=] identifier[entailmentCheckerFactory] operator[SEP] identifier[createEntailementChecker] operator[SEP] identifier[entailment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[entailmentChecker] operator[SEP] identifier[isEntailed] operator[SEP] identifier[module] operator[SEP] operator[SEP] { identifier[commonAxioms] operator[SEP] identifier[add] operator[SEP] identifier[ax] operator[SEP] operator[SEP] } identifier[module] operator[SEP] identifier[add] operator[SEP] identifier[ax] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[commonAxioms] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[OWLEntity] operator[>] identifier[commonAxiomsSig] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[OWLEntity] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OWLAxiom] identifier[ax] operator[:] identifier[commonAxioms] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[ax] operator[SEP] operator[SEP] identifier[commonAxiomsSig] operator[SEP] identifier[addAll] operator[SEP] identifier[ax] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[OWLAxiom] operator[>] identifier[expansionCandidates] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[OWLAxiom] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[OWLAxiom] operator[>] identifier[directExpansionCandidates] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[OWLAxiom] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OWLAxiom] identifier[ax] operator[:] identifier[module] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[commonAxioms] operator[SEP] identifier[contains] operator[SEP] identifier[ax] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[OWLEntity] identifier[ent] operator[:] identifier[ax] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[commonAxiomsSig] operator[SEP] identifier[contains] operator[SEP] identifier[ent] operator[SEP] operator[SEP] { identifier[expansionCandidates] operator[SEP] identifier[add] operator[SEP] identifier[ax] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OWLEntity] identifier[entailmentEnt] operator[:] identifier[entailment] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ax] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[entailmentEnt] operator[SEP] operator[SEP] { identifier[directExpansionCandidates] operator[SEP] identifier[add] operator[SEP] identifier[ax] operator[SEP] operator[SEP] } } } } } } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[directExpansionCandidates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OWLAxiom] identifier[ax] operator[:] Keyword[new] identifier[TreeSet] operator[<] identifier[OWLAxiom] operator[>] operator[SEP] identifier[directExpansionCandidates] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[ax] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[expansionCandidates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OWLAxiom] identifier[ax] operator[:] Keyword[new] identifier[TreeSet] operator[<] identifier[OWLAxiom] operator[>] operator[SEP] identifier[expansionCandidates] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[ax] operator[SEP] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP] }
private Serializable readContent(File file, ExportFileType exportFileType, Logger logWriter) throws IOException { String filePath = file.getAbsolutePath(); logWriter.info("reading "+filePath); switch(exportFileType) { case gfd: return IO.readBinaryFile(file); case json: return IO.readFile(file.getAbsolutePath(),StandardCharsets.UTF_8); default: throw new RuntimeException("Unknown extension file type:"+exportFileType); } }
class class_name[name] begin[{] method[readContent, return_type[type[Serializable]], modifier[private], parameter[file, exportFileType, logWriter]] begin[{] local_variable[type[String], filePath] call[logWriter.info, parameter[binary_operation[literal["reading "], +, member[.filePath]]]] SwitchStatement(cases=[SwitchStatementCase(case=['gfd'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readBinaryFile, postfix_operators=[], prefix_operators=[], qualifier=IO, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['json'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, selectors=[])], member=readFile, postfix_operators=[], prefix_operators=[], qualifier=IO, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown extension file type:"), operandr=MemberReference(member=exportFileType, 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=RuntimeException, sub_type=None)), label=None)])], expression=MemberReference(member=exportFileType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[private] identifier[Serializable] identifier[readContent] operator[SEP] identifier[File] identifier[file] , identifier[ExportFileType] identifier[exportFileType] , identifier[Logger] identifier[logWriter] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[filePath] operator[=] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[logWriter] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[filePath] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[exportFileType] operator[SEP] { Keyword[case] identifier[gfd] operator[:] Keyword[return] identifier[IO] operator[SEP] identifier[readBinaryFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[case] identifier[json] operator[:] Keyword[return] identifier[IO] operator[SEP] identifier[readFile] operator[SEP] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[exportFileType] operator[SEP] operator[SEP] } }
public PhotoList<Photo> getNotInSet(int perPage, int page) throws FlickrException { PhotoList<Photo> photos = new PhotoList<Photo>(); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", PhotosInterface.METHOD_GET_NOT_IN_SET); RequestContext requestContext = RequestContext.getRequestContext(); List<String> extras = requestContext.getExtras(); if (extras.size() > 0) { parameters.put("extras", StringUtilities.join(extras, ",")); } if (perPage > 0) { parameters.put("per_page", Integer.toString(perPage)); } if (page > 0) { parameters.put("page", Integer.toString(page)); } Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element photosElement = response.getPayload(); photos.setPage(photosElement.getAttribute("page")); photos.setPages(photosElement.getAttribute("pages")); photos.setPerPage(photosElement.getAttribute("perpage")); photos.setTotal(photosElement.getAttribute("total")); NodeList photoElements = photosElement.getElementsByTagName("photo"); for (int i = 0; i < photoElements.getLength(); i++) { Element photoElement = (Element) photoElements.item(i); photos.add(PhotoUtils.createPhoto(photoElement)); } return photos; }
class class_name[name] begin[{] method[getNotInSet, return_type[type[PhotoList]], modifier[public], parameter[perPage, page]] begin[{] local_variable[type[PhotoList], photos] local_variable[type[Map], parameters] call[parameters.put, parameter[literal["method"], member[PhotosInterface.METHOD_GET_NOT_IN_SET]]] local_variable[type[RequestContext], requestContext] local_variable[type[List], extras] if[binary_operation[call[extras.size, parameter[]], >, literal[0]]] begin[{] call[parameters.put, parameter[literal["extras"], call[StringUtilities.join, parameter[member[.extras], literal[","]]]]] else begin[{] None end[}] if[binary_operation[member[.perPage], >, literal[0]]] begin[{] call[parameters.put, parameter[literal["per_page"], call[Integer.toString, parameter[member[.perPage]]]]] else begin[{] None end[}] if[binary_operation[member[.page], >, literal[0]]] begin[{] call[parameters.put, parameter[literal["page"], call[Integer.toString, parameter[member[.page]]]]] else begin[{] None end[}] local_variable[type[Response], response] if[call[response.isError, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getErrorCode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FlickrException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Element], photosElement] call[photos.setPage, parameter[call[photosElement.getAttribute, parameter[literal["page"]]]]] call[photos.setPages, parameter[call[photosElement.getAttribute, parameter[literal["pages"]]]]] call[photos.setPerPage, parameter[call[photosElement.getAttribute, parameter[literal["perpage"]]]]] call[photos.setTotal, parameter[call[photosElement.getAttribute, parameter[literal["total"]]]]] local_variable[type[NodeList], photoElements] 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=photoElements, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=photoElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=photoElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createPhoto, postfix_operators=[], prefix_operators=[], qualifier=PhotoUtils, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=photos, selectors=[], type_arguments=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=photoElements, 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[.photos]] end[}] END[}]
Keyword[public] identifier[PhotoList] operator[<] identifier[Photo] operator[>] identifier[getNotInSet] operator[SEP] Keyword[int] identifier[perPage] , Keyword[int] identifier[page] operator[SEP] Keyword[throws] identifier[FlickrException] { identifier[PhotoList] operator[<] identifier[Photo] operator[>] identifier[photos] operator[=] Keyword[new] identifier[PhotoList] operator[<] identifier[Photo] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[PhotosInterface] operator[SEP] identifier[METHOD_GET_NOT_IN_SET] operator[SEP] operator[SEP] identifier[RequestContext] identifier[requestContext] operator[=] identifier[RequestContext] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[extras] operator[=] identifier[requestContext] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extras] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[StringUtilities] operator[SEP] identifier[join] operator[SEP] identifier[extras] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[perPage] operator[>] Other[0] operator[SEP] { identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[perPage] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[page] operator[>] Other[0] operator[SEP] { identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[page] operator[SEP] operator[SEP] operator[SEP] } identifier[Response] identifier[response] operator[=] identifier[transport] operator[SEP] identifier[get] operator[SEP] identifier[transport] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[parameters] , identifier[apiKey] , identifier[sharedSecret] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[FlickrException] operator[SEP] identifier[response] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] , identifier[response] operator[SEP] identifier[getErrorMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Element] identifier[photosElement] operator[=] identifier[response] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPage] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPages] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPerPage] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setTotal] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[photoElements] operator[=] identifier[photosElement] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[photoElements] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Element] identifier[photoElement] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[photoElements] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[add] operator[SEP] identifier[PhotoUtils] operator[SEP] identifier[createPhoto] operator[SEP] identifier[photoElement] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[photos] operator[SEP] }
protected static boolean createLoggingAction(final Logger logger, final Logger auditor, final TransactionLogger instance) { TransactionLogger oldInstance = getInstance(); if (oldInstance == null || oldInstance.finished) { if(loggingKeys == null) { synchronized (TransactionLogger.class) { if (loggingKeys == null) { logger.info("Initializing 'LoggingKeysHandler' class"); loggingKeys = new LoggingKeysHandler(keysPropStream); } } } initInstance(instance, logger, auditor); setInstance(instance); return true; } return false; // Really not sure it can happen - since we arrive here in a new thread of transaction I think it's ThreadLocal should be empty. But leaving this code just in case... }
class class_name[name] begin[{] method[createLoggingAction, return_type[type[boolean]], modifier[static protected], parameter[logger, auditor, instance]] begin[{] local_variable[type[TransactionLogger], oldInstance] if[binary_operation[binary_operation[member[.oldInstance], ==, literal[null]], ||, member[oldInstance.finished]]] begin[{] if[binary_operation[member[.loggingKeys], ==, literal[null]]] begin[{] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TransactionLogger, sub_type=None))] BEGIN[{] if[binary_operation[member[.loggingKeys], ==, literal[null]]] begin[{] call[logger.info, parameter[literal["Initializing 'LoggingKeysHandler' class"]]] assign[member[.loggingKeys], ClassCreator(arguments=[MemberReference(member=keysPropStream, 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=LoggingKeysHandler, sub_type=None))] else begin[{] None end[}] END[}] else begin[{] None end[}] call[.initInstance, parameter[member[.instance], member[.logger], member[.auditor]]] call[.setInstance, parameter[member[.instance]]] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[boolean] identifier[createLoggingAction] operator[SEP] Keyword[final] identifier[Logger] identifier[logger] , Keyword[final] identifier[Logger] identifier[auditor] , Keyword[final] identifier[TransactionLogger] identifier[instance] operator[SEP] { identifier[TransactionLogger] identifier[oldInstance] operator[=] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldInstance] operator[==] Other[null] operator[||] identifier[oldInstance] operator[SEP] identifier[finished] operator[SEP] { Keyword[if] operator[SEP] identifier[loggingKeys] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[TransactionLogger] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[loggingKeys] operator[==] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[loggingKeys] operator[=] Keyword[new] identifier[LoggingKeysHandler] operator[SEP] identifier[keysPropStream] operator[SEP] operator[SEP] } } } identifier[initInstance] operator[SEP] identifier[instance] , identifier[logger] , identifier[auditor] operator[SEP] operator[SEP] identifier[setInstance] operator[SEP] identifier[instance] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public List<Destination> getDestinations() { List<Destination> destinations = new ArrayList<Destination>(); Iterator<JMSDestination> destinationIterator = jmsDestinations.values().iterator(); while(destinationIterator.hasNext()) { destinations.add(destinationIterator.next().destination); } return destinations; }
class class_name[name] begin[{] method[getDestinations, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], destinations] local_variable[type[Iterator], destinationIterator] while[call[destinationIterator.hasNext, parameter[]]] begin[{] call[destinations.add, parameter[call[destinationIterator.next, parameter[]]]] end[}] return[member[.destinations]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Destination] operator[>] identifier[getDestinations] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Destination] operator[>] identifier[destinations] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Destination] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[JMSDestination] operator[>] identifier[destinationIterator] operator[=] identifier[jmsDestinations] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[destinationIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[destinations] operator[SEP] identifier[add] operator[SEP] identifier[destinationIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[destination] operator[SEP] operator[SEP] } Keyword[return] identifier[destinations] operator[SEP] }
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { syslog_ui_cmd_responses result = (syslog_ui_cmd_responses) service.get_payload_formatter().string_to_resource(syslog_ui_cmd_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.syslog_ui_cmd_response_array); } syslog_ui_cmd[] result_syslog_ui_cmd = new syslog_ui_cmd[result.syslog_ui_cmd_response_array.length]; for(int i = 0; i < result.syslog_ui_cmd_response_array.length; i++) { result_syslog_ui_cmd[i] = result.syslog_ui_cmd_response_array[i].syslog_ui_cmd[0]; } return result_syslog_ui_cmd; }
class class_name[name] begin[{] method[get_nitro_bulk_response, return_type[type[base_resource]], modifier[protected], parameter[service, response]] begin[{] local_variable[type[syslog_ui_cmd_responses], result] if[binary_operation[member[result.errorcode], !=, literal[0]]] begin[{] if[binary_operation[member[result.errorcode], ==, member[.SESSION_NOT_EXISTS]]] begin[{] call[service.clear_session, parameter[]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), MemberReference(member=errorcode, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), Cast(expression=MemberReference(member=syslog_ui_cmd_response_array, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=base_response, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=nitro_exception, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[syslog_ui_cmd], result_syslog_ui_cmd] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result_syslog_ui_cmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=syslog_ui_cmd_response_array, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=syslog_ui_cmd, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), 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=result.syslog_ui_cmd_response_array, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result_syslog_ui_cmd]] end[}] END[}]
Keyword[protected] identifier[base_resource] operator[SEP] operator[SEP] identifier[get_nitro_bulk_response] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[response] operator[SEP] Keyword[throws] identifier[Exception] { identifier[syslog_ui_cmd_responses] identifier[result] operator[=] operator[SEP] identifier[syslog_ui_cmd_responses] operator[SEP] identifier[service] operator[SEP] identifier[get_payload_formatter] operator[SEP] operator[SEP] operator[SEP] identifier[string_to_resource] operator[SEP] identifier[syslog_ui_cmd_responses] operator[SEP] Keyword[class] , identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[errorcode] operator[!=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[errorcode] operator[==] identifier[SESSION_NOT_EXISTS] operator[SEP] identifier[service] operator[SEP] identifier[clear_session] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[nitro_exception] operator[SEP] identifier[result] operator[SEP] identifier[message] , identifier[result] operator[SEP] identifier[errorcode] , operator[SEP] identifier[base_response] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[syslog_ui_cmd_response_array] operator[SEP] operator[SEP] } identifier[syslog_ui_cmd] operator[SEP] operator[SEP] identifier[result_syslog_ui_cmd] operator[=] Keyword[new] identifier[syslog_ui_cmd] operator[SEP] identifier[result] operator[SEP] identifier[syslog_ui_cmd_response_array] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[result] operator[SEP] identifier[syslog_ui_cmd_response_array] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result_syslog_ui_cmd] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[result] operator[SEP] identifier[syslog_ui_cmd_response_array] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[syslog_ui_cmd] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] identifier[result_syslog_ui_cmd] operator[SEP] }
public List<CorporationContractsResponse> getCorporationsCorporationIdContracts(Integer corporationId, String datasource, String ifNoneMatch, Integer page, String token) throws ApiException { ApiResponse<List<CorporationContractsResponse>> resp = getCorporationsCorporationIdContractsWithHttpInfo( corporationId, datasource, ifNoneMatch, page, token); return resp.getData(); }
class class_name[name] begin[{] method[getCorporationsCorporationIdContracts, return_type[type[List]], modifier[public], parameter[corporationId, datasource, ifNoneMatch, page, token]] begin[{] local_variable[type[ApiResponse], resp] return[call[resp.getData, parameter[]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CorporationContractsResponse] operator[>] identifier[getCorporationsCorporationIdContracts] operator[SEP] identifier[Integer] identifier[corporationId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[Integer] identifier[page] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[ApiResponse] operator[<] identifier[List] operator[<] identifier[CorporationContractsResponse] operator[>] operator[>] identifier[resp] operator[=] identifier[getCorporationsCorporationIdContractsWithHttpInfo] operator[SEP] identifier[corporationId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[page] , identifier[token] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] }
protected void enableConsumers(List<ConsumerHolder> consumerHolders) throws IOException { checkPreconditions(consumerHolders); try { for (ConsumerHolder consumerHolder : consumerHolders) { consumerHolder.enable(); } } catch (IOException e) { LOGGER.error("Failed to enable consumers - disabling already enabled consumers"); disableConsumers(consumerHolders); throw e; } }
class class_name[name] begin[{] method[enableConsumers, return_type[void], modifier[protected], parameter[consumerHolders]] begin[{] call[.checkPreconditions, parameter[member[.consumerHolders]]] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=enable, postfix_operators=[], prefix_operators=[], qualifier=consumerHolder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=consumerHolders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=consumerHolder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConsumerHolder, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to enable consumers - disabling already enabled consumers")], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=consumerHolders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=disableConsumers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[enableConsumers] operator[SEP] identifier[List] operator[<] identifier[ConsumerHolder] operator[>] identifier[consumerHolders] operator[SEP] Keyword[throws] identifier[IOException] { identifier[checkPreconditions] operator[SEP] identifier[consumerHolders] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[ConsumerHolder] identifier[consumerHolder] operator[:] identifier[consumerHolders] operator[SEP] { identifier[consumerHolder] operator[SEP] identifier[enable] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[disableConsumers] operator[SEP] identifier[consumerHolders] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
public List<MarketOrdersResponse> getMarketsRegionIdOrders(String orderType, Integer regionId, String datasource, String ifNoneMatch, Integer page, Integer typeId) throws ApiException { ApiResponse<List<MarketOrdersResponse>> resp = getMarketsRegionIdOrdersWithHttpInfo(orderType, regionId, datasource, ifNoneMatch, page, typeId); return resp.getData(); }
class class_name[name] begin[{] method[getMarketsRegionIdOrders, return_type[type[List]], modifier[public], parameter[orderType, regionId, datasource, ifNoneMatch, page, typeId]] begin[{] local_variable[type[ApiResponse], resp] return[call[resp.getData, parameter[]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[MarketOrdersResponse] operator[>] identifier[getMarketsRegionIdOrders] operator[SEP] identifier[String] identifier[orderType] , identifier[Integer] identifier[regionId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[Integer] identifier[page] , identifier[Integer] identifier[typeId] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[ApiResponse] operator[<] identifier[List] operator[<] identifier[MarketOrdersResponse] operator[>] operator[>] identifier[resp] operator[=] identifier[getMarketsRegionIdOrdersWithHttpInfo] operator[SEP] identifier[orderType] , identifier[regionId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[page] , identifier[typeId] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] }
public static VoltTable getPartitionKeys(TheHashinator hashinator, VoltType type) { // get partitionKeys response table so we can copy it final VoltTable partitionKeys; switch (type) { case INTEGER: partitionKeys = hashinator.m_integerPartitionKeys.get(); break; case STRING: partitionKeys = hashinator.m_stringPartitionKeys.get(); break; case VARBINARY: partitionKeys = hashinator.m_varbinaryPartitionKeys.get(); break; default: return null; } // return a clone because if the table is used at all in the voltdb process, // (like by an NT procedure), // you can corrupt the various offsets and positions in the underlying buffer return partitionKeys.semiDeepCopy(); }
class class_name[name] begin[{] method[getPartitionKeys, return_type[type[VoltTable]], modifier[public static], parameter[hashinator, type]] begin[{] local_variable[type[VoltTable], partitionKeys] SwitchStatement(cases=[SwitchStatementCase(case=['INTEGER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=hashinator.m_integerPartitionKeys, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STRING'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=hashinator.m_stringPartitionKeys, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['VARBINARY'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=hashinator.m_varbinaryPartitionKeys, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[call[partitionKeys.semiDeepCopy, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[VoltTable] identifier[getPartitionKeys] operator[SEP] identifier[TheHashinator] identifier[hashinator] , identifier[VoltType] identifier[type] operator[SEP] { Keyword[final] identifier[VoltTable] identifier[partitionKeys] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[INTEGER] operator[:] identifier[partitionKeys] operator[=] identifier[hashinator] operator[SEP] identifier[m_integerPartitionKeys] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[STRING] operator[:] identifier[partitionKeys] operator[=] identifier[hashinator] operator[SEP] identifier[m_stringPartitionKeys] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[VARBINARY] operator[:] identifier[partitionKeys] operator[=] identifier[hashinator] operator[SEP] identifier[m_varbinaryPartitionKeys] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[partitionKeys] operator[SEP] identifier[semiDeepCopy] operator[SEP] operator[SEP] operator[SEP] }
public static void export(Descriptor desc, PrintStream outs, String[] excludes, CFMetaData metadata) throws IOException { export(SSTableReader.open(desc), outs, excludes, metadata); }
class class_name[name] begin[{] method[export, return_type[void], modifier[public static], parameter[desc, outs, excludes, metadata]] begin[{] call[.export, parameter[call[SSTableReader.open, parameter[member[.desc]]], member[.outs], member[.excludes], member[.metadata]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[export] operator[SEP] identifier[Descriptor] identifier[desc] , identifier[PrintStream] identifier[outs] , identifier[String] operator[SEP] operator[SEP] identifier[excludes] , identifier[CFMetaData] identifier[metadata] operator[SEP] Keyword[throws] identifier[IOException] { identifier[export] operator[SEP] identifier[SSTableReader] operator[SEP] identifier[open] operator[SEP] identifier[desc] operator[SEP] , identifier[outs] , identifier[excludes] , identifier[metadata] operator[SEP] operator[SEP] }
public final void mT__65() throws RecognitionException { try { int _type = T__65; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalPureXbase.g:63:7: ( 'case' ) // InternalPureXbase.g:63:9: 'case' { match("case"); } state.type = _type; state.channel = _channel; } finally { } }
class class_name[name] begin[{] method[mT__65, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=T__65, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="case")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[mT__65] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { Keyword[int] identifier[_type] operator[=] identifier[T__65] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP] } Keyword[finally] { } }
@SuppressWarnings("unchecked") public static UniversalIdIntQueueMessage newInstance() { Date now = new Date(); UniversalIdIntQueueMessage msg = new UniversalIdIntQueueMessage(); msg.setQueueTimestamp(now).setNumRequeues(0).setId(QueueUtils.IDGEN.generateId64()) .setTimestamp(now); return msg; }
class class_name[name] begin[{] method[newInstance, return_type[type[UniversalIdIntQueueMessage]], modifier[public static], parameter[]] begin[{] local_variable[type[Date], now] local_variable[type[UniversalIdIntQueueMessage], msg] call[msg.setQueueTimestamp, parameter[member[.now]]] return[member[.msg]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[UniversalIdIntQueueMessage] identifier[newInstance] operator[SEP] operator[SEP] { identifier[Date] identifier[now] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[UniversalIdIntQueueMessage] identifier[msg] operator[=] Keyword[new] identifier[UniversalIdIntQueueMessage] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[setQueueTimestamp] operator[SEP] identifier[now] operator[SEP] operator[SEP] identifier[setNumRequeues] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[setId] operator[SEP] identifier[QueueUtils] operator[SEP] identifier[IDGEN] operator[SEP] identifier[generateId64] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTimestamp] operator[SEP] identifier[now] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP] }
public R setTags(List<String> tags) { JsonArray jsonArray = new JsonArray(); for (String s : tags) { jsonArray.add(s); } mBodyMap.put(BoxItem.FIELD_TAGS, jsonArray); return (R) this; }
class class_name[name] begin[{] method[setTags, return_type[type[R]], modifier[public], parameter[tags]] begin[{] local_variable[type[JsonArray], jsonArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=jsonArray, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=tags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[mBodyMap.put, parameter[member[BoxItem.FIELD_TAGS], member[.jsonArray]]] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))] end[}] END[}]
Keyword[public] identifier[R] identifier[setTags] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[tags] operator[SEP] { identifier[JsonArray] identifier[jsonArray] operator[=] Keyword[new] identifier[JsonArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[tags] operator[SEP] { identifier[jsonArray] operator[SEP] identifier[add] operator[SEP] identifier[s] operator[SEP] operator[SEP] } identifier[mBodyMap] operator[SEP] identifier[put] operator[SEP] identifier[BoxItem] operator[SEP] identifier[FIELD_TAGS] , identifier[jsonArray] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[R] operator[SEP] Keyword[this] operator[SEP] }
public static <T extends FrameJob> T hygiene(T job) { job.source = null; return job; }
class class_name[name] begin[{] method[hygiene, return_type[type[T]], modifier[public static], parameter[job]] begin[{] assign[member[job.source], literal[null]] return[member[.job]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[FrameJob] operator[>] identifier[T] identifier[hygiene] operator[SEP] identifier[T] identifier[job] operator[SEP] { identifier[job] operator[SEP] identifier[source] operator[=] Other[null] operator[SEP] Keyword[return] identifier[job] operator[SEP] }
public QueryExpression eq(String propertyName,String value) { return new SimpleQueryExpression(propertyName, ComparisonOperator.EQUAL,wrap(value)); }
class class_name[name] begin[{] method[eq, return_type[type[QueryExpression]], modifier[public], parameter[propertyName, value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EQUAL, postfix_operators=[], prefix_operators=[], qualifier=ComparisonOperator, selectors=[]), MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, 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=SimpleQueryExpression, sub_type=None))] end[}] END[}]
Keyword[public] identifier[QueryExpression] identifier[eq] operator[SEP] identifier[String] identifier[propertyName] , identifier[String] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[SimpleQueryExpression] operator[SEP] identifier[propertyName] , identifier[ComparisonOperator] operator[SEP] identifier[EQUAL] , identifier[wrap] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] }
public static OutputStream getFileOutputStream(String filename) throws IOException { OutputStream out = new FileOutputStream(filename); if (filename.endsWith(".gz")) { out = new GZIPOutputStream(out); } else if (filename.endsWith(".bz2")) { //out = new CBZip2OutputStream(out); out = getBZip2PipedOutputStream(filename); } return out; }
class class_name[name] begin[{] method[getFileOutputStream, return_type[type[OutputStream]], modifier[public static], parameter[filename]] begin[{] local_variable[type[OutputStream], out] if[call[filename.endsWith, parameter[literal[".gz"]]]] begin[{] assign[member[.out], ClassCreator(arguments=[MemberReference(member=out, 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=GZIPOutputStream, sub_type=None))] else begin[{] if[call[filename.endsWith, parameter[literal[".bz2"]]]] begin[{] assign[member[.out], call[.getBZip2PipedOutputStream, parameter[member[.filename]]]] else begin[{] None end[}] end[}] return[member[.out]] end[}] END[}]
Keyword[public] Keyword[static] identifier[OutputStream] identifier[getFileOutputStream] operator[SEP] identifier[String] identifier[filename] operator[SEP] Keyword[throws] identifier[IOException] { identifier[OutputStream] identifier[out] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filename] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[out] operator[=] Keyword[new] identifier[GZIPOutputStream] operator[SEP] identifier[out] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[filename] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[out] operator[=] identifier[getBZip2PipedOutputStream] operator[SEP] identifier[filename] operator[SEP] operator[SEP] } Keyword[return] identifier[out] operator[SEP] }
public java.util.List<ResourceKey> getFailedItems() { if (failedItems == null) { failedItems = new com.amazonaws.internal.SdkInternalList<ResourceKey>(); } return failedItems; }
class class_name[name] begin[{] method[getFailedItems, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.failedItems], ==, literal[null]]] begin[{] assign[member[.failedItems], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceKey, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.failedItems]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[ResourceKey] operator[>] identifier[getFailedItems] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[failedItems] operator[==] Other[null] operator[SEP] { identifier[failedItems] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ResourceKey] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[failedItems] operator[SEP] }
public void stop() { if (stopRequested) { return; } stopRequested = true; running = false; if (server != null) server.stop(); if (triggerThread != null) { triggerThread.interrupt(); triggerMonitor = null; } if (urfThread != null) { urfThread.interrupt(); urfProcessor = null; } if (blockIntegrityMonitor != null) blockIntegrityMonitor.running = false; if (blockFixerThread != null) blockFixerThread.interrupt(); if (blockCopierThread != null) blockCopierThread.interrupt(); if (corruptFileCounterThread != null) corruptFileCounterThread.interrupt(); if (purgeMonitor != null) purgeMonitor.running = false; if (purgeThread != null) purgeThread.interrupt(); if (placementMonitor != null) placementMonitor.stop(); if (statsCollector != null) statsCollector.stop(); if (statsCollectorThread != null) statsCollectorThread.interrupt(); if (infoServer != null) { try { infoServer.stop(); } catch (Exception e) { LOG.warn("Exception shutting down " + RaidNode.class, e); } } this.unregisterMBean(); }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public], parameter[]] begin[{] if[member[.stopRequested]] begin[{] return[None] else begin[{] None end[}] assign[member[.stopRequested], literal[true]] assign[member[.running], literal[false]] if[binary_operation[member[.server], !=, literal[null]]] begin[{] call[server.stop, parameter[]] else begin[{] None end[}] if[binary_operation[member[.triggerThread], !=, literal[null]]] begin[{] call[triggerThread.interrupt, parameter[]] assign[member[.triggerMonitor], literal[null]] else begin[{] None end[}] if[binary_operation[member[.urfThread], !=, literal[null]]] begin[{] call[urfThread.interrupt, parameter[]] assign[member[.urfProcessor], literal[null]] else begin[{] None end[}] if[binary_operation[member[.blockIntegrityMonitor], !=, literal[null]]] begin[{] assign[member[blockIntegrityMonitor.running], literal[false]] else begin[{] None end[}] if[binary_operation[member[.blockFixerThread], !=, literal[null]]] begin[{] call[blockFixerThread.interrupt, parameter[]] else begin[{] None end[}] if[binary_operation[member[.blockCopierThread], !=, literal[null]]] begin[{] call[blockCopierThread.interrupt, parameter[]] else begin[{] None end[}] if[binary_operation[member[.corruptFileCounterThread], !=, literal[null]]] begin[{] call[corruptFileCounterThread.interrupt, parameter[]] else begin[{] None end[}] if[binary_operation[member[.purgeMonitor], !=, literal[null]]] begin[{] assign[member[purgeMonitor.running], literal[false]] else begin[{] None end[}] if[binary_operation[member[.purgeThread], !=, literal[null]]] begin[{] call[purgeThread.interrupt, parameter[]] else begin[{] None end[}] if[binary_operation[member[.placementMonitor], !=, literal[null]]] begin[{] call[placementMonitor.stop, parameter[]] else begin[{] None end[}] if[binary_operation[member[.statsCollector], !=, literal[null]]] begin[{] call[statsCollector.stop, parameter[]] else begin[{] None end[}] if[binary_operation[member[.statsCollectorThread], !=, literal[null]]] begin[{] call[statsCollectorThread.interrupt, parameter[]] else begin[{] None end[}] if[binary_operation[member[.infoServer], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=infoServer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception shutting down "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RaidNode, sub_type=None)), operator=+), 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=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] THIS[call[None.unregisterMBean, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[stopRequested] operator[SEP] { Keyword[return] operator[SEP] } identifier[stopRequested] operator[=] literal[boolean] operator[SEP] identifier[running] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[server] operator[!=] Other[null] operator[SEP] identifier[server] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[triggerThread] operator[!=] Other[null] operator[SEP] { identifier[triggerThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] identifier[triggerMonitor] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[urfThread] operator[!=] Other[null] operator[SEP] { identifier[urfThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] identifier[urfProcessor] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[blockIntegrityMonitor] operator[!=] Other[null] operator[SEP] identifier[blockIntegrityMonitor] operator[SEP] identifier[running] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[blockFixerThread] operator[!=] Other[null] operator[SEP] identifier[blockFixerThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[blockCopierThread] operator[!=] Other[null] operator[SEP] identifier[blockCopierThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[corruptFileCounterThread] operator[!=] Other[null] operator[SEP] identifier[corruptFileCounterThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[purgeMonitor] operator[!=] Other[null] operator[SEP] identifier[purgeMonitor] operator[SEP] identifier[running] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[purgeThread] operator[!=] Other[null] operator[SEP] identifier[purgeThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[placementMonitor] operator[!=] Other[null] operator[SEP] identifier[placementMonitor] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[statsCollector] operator[!=] Other[null] operator[SEP] identifier[statsCollector] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[statsCollectorThread] operator[!=] Other[null] operator[SEP] identifier[statsCollectorThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[infoServer] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[infoServer] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[RaidNode] operator[SEP] Keyword[class] , identifier[e] operator[SEP] operator[SEP] } } Keyword[this] operator[SEP] identifier[unregisterMBean] operator[SEP] operator[SEP] operator[SEP] }
public static <T extends ParameterDescription> ElementMatcher.Junction<T> is(ParameterDescription.InDefinedShape parameter) { return definedParameter(new EqualityMatcher<ParameterDescription.InDefinedShape>(parameter)); }
class class_name[name] begin[{] method[is, return_type[type[ElementMatcher]], modifier[public static], parameter[parameter]] begin[{] return[call[.definedParameter, parameter[ClassCreator(arguments=[MemberReference(member=parameter, 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=ParameterDescription, sub_type=ReferenceType(arguments=None, dimensions=None, name=InDefinedShape, sub_type=None)))], dimensions=None, name=EqualityMatcher, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ParameterDescription] operator[>] identifier[ElementMatcher] operator[SEP] identifier[Junction] operator[<] identifier[T] operator[>] identifier[is] operator[SEP] identifier[ParameterDescription] operator[SEP] identifier[InDefinedShape] identifier[parameter] operator[SEP] { Keyword[return] identifier[definedParameter] operator[SEP] Keyword[new] identifier[EqualityMatcher] operator[<] identifier[ParameterDescription] operator[SEP] identifier[InDefinedShape] operator[>] operator[SEP] identifier[parameter] operator[SEP] operator[SEP] operator[SEP] }
public static MutableInodeFile fromJournalEntry(InodeFileEntry entry) { // If journal entry has no mode set, set default mode for backwards-compatibility. MutableInodeFile ret = new MutableInodeFile(BlockId.getContainerId(entry.getId())) .setName(entry.getName()) .setBlockIds(entry.getBlocksList()) .setBlockSizeBytes(entry.getBlockSizeBytes()) .setCacheable(entry.getCacheable()) .setCompleted(entry.getCompleted()) .setCreationTimeMs(entry.getCreationTimeMs()) .setLastModificationTimeMs(entry.getLastModificationTimeMs(), true) .setLength(entry.getLength()) .setParentId(entry.getParentId()) .setPersistenceState(PersistenceState.valueOf(entry.getPersistenceState())) .setPinned(entry.getPinned()) .setPersistJobId(entry.getPersistJobId()) .setReplicationDurable(entry.getReplicationDurable()) .setReplicationMax(entry.getReplicationMax()) .setReplicationMin(entry.getReplicationMin()) .setTempUfsPath(entry.getTempUfsPath()) .setTtl(entry.getTtl()) .setTtlAction((ProtobufUtils.fromProtobuf(entry.getTtlAction()))) .setUfsFingerprint(entry.hasUfsFingerprint() ? entry.getUfsFingerprint() : Constants.INVALID_UFS_FINGERPRINT); if (entry.hasAcl()) { ret.mAcl = ProtoUtils.fromProto(entry.getAcl()); } else { // Backward compatibility. AccessControlList acl = new AccessControlList(); acl.setOwningUser(entry.getOwner()); acl.setOwningGroup(entry.getGroup()); short mode = entry.hasMode() ? (short) entry.getMode() : Constants.DEFAULT_FILE_SYSTEM_MODE; acl.setMode(mode); ret.mAcl = acl; } return ret; }
class class_name[name] begin[{] method[fromJournalEntry, return_type[type[MutableInodeFile]], modifier[public static], parameter[entry]] begin[{] local_variable[type[MutableInodeFile], ret] if[call[entry.hasAcl, parameter[]]] begin[{] assign[member[ret.mAcl], call[ProtoUtils.fromProto, parameter[call[entry.getAcl, parameter[]]]]] else begin[{] local_variable[type[AccessControlList], acl] call[acl.setOwningUser, parameter[call[entry.getOwner, parameter[]]]] call[acl.setOwningGroup, parameter[call[entry.getGroup, parameter[]]]] local_variable[type[short], mode] call[acl.setMode, parameter[member[.mode]]] assign[member[ret.mAcl], member[.acl]] end[}] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MutableInodeFile] identifier[fromJournalEntry] operator[SEP] identifier[InodeFileEntry] identifier[entry] operator[SEP] { identifier[MutableInodeFile] identifier[ret] operator[=] Keyword[new] identifier[MutableInodeFile] operator[SEP] identifier[BlockId] operator[SEP] identifier[getContainerId] operator[SEP] identifier[entry] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setBlockIds] operator[SEP] identifier[entry] operator[SEP] identifier[getBlocksList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setBlockSizeBytes] operator[SEP] identifier[entry] operator[SEP] identifier[getBlockSizeBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setCacheable] operator[SEP] identifier[entry] operator[SEP] identifier[getCacheable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setCompleted] operator[SEP] identifier[entry] operator[SEP] identifier[getCompleted] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setCreationTimeMs] operator[SEP] identifier[entry] operator[SEP] identifier[getCreationTimeMs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setLastModificationTimeMs] operator[SEP] identifier[entry] operator[SEP] identifier[getLastModificationTimeMs] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[setLength] operator[SEP] identifier[entry] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setParentId] operator[SEP] identifier[entry] operator[SEP] identifier[getParentId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPersistenceState] operator[SEP] identifier[PersistenceState] operator[SEP] identifier[valueOf] operator[SEP] identifier[entry] operator[SEP] identifier[getPersistenceState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPinned] operator[SEP] identifier[entry] operator[SEP] identifier[getPinned] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPersistJobId] operator[SEP] identifier[entry] operator[SEP] identifier[getPersistJobId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setReplicationDurable] operator[SEP] identifier[entry] operator[SEP] identifier[getReplicationDurable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setReplicationMax] operator[SEP] identifier[entry] operator[SEP] identifier[getReplicationMax] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setReplicationMin] operator[SEP] identifier[entry] operator[SEP] identifier[getReplicationMin] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTempUfsPath] operator[SEP] identifier[entry] operator[SEP] identifier[getTempUfsPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTtl] operator[SEP] identifier[entry] operator[SEP] identifier[getTtl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTtlAction] operator[SEP] operator[SEP] identifier[ProtobufUtils] operator[SEP] identifier[fromProtobuf] operator[SEP] identifier[entry] operator[SEP] identifier[getTtlAction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setUfsFingerprint] operator[SEP] identifier[entry] operator[SEP] identifier[hasUfsFingerprint] operator[SEP] operator[SEP] operator[?] identifier[entry] operator[SEP] identifier[getUfsFingerprint] operator[SEP] operator[SEP] operator[:] identifier[Constants] operator[SEP] identifier[INVALID_UFS_FINGERPRINT] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[hasAcl] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[SEP] identifier[mAcl] operator[=] identifier[ProtoUtils] operator[SEP] identifier[fromProto] operator[SEP] identifier[entry] operator[SEP] identifier[getAcl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[AccessControlList] identifier[acl] operator[=] Keyword[new] identifier[AccessControlList] operator[SEP] operator[SEP] operator[SEP] identifier[acl] operator[SEP] identifier[setOwningUser] operator[SEP] identifier[entry] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[acl] operator[SEP] identifier[setOwningGroup] operator[SEP] identifier[entry] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[short] identifier[mode] operator[=] identifier[entry] operator[SEP] identifier[hasMode] operator[SEP] operator[SEP] operator[?] operator[SEP] Keyword[short] operator[SEP] identifier[entry] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] operator[:] identifier[Constants] operator[SEP] identifier[DEFAULT_FILE_SYSTEM_MODE] operator[SEP] identifier[acl] operator[SEP] identifier[setMode] operator[SEP] identifier[mode] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[mAcl] operator[=] identifier[acl] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
protected Object readResolve() throws ObjectStreamException { try { if (type == Type.SECRET && RAW.equals(format)) { return new SecretKeySpec(encoded, algorithm); } else if (type == Type.PUBLIC && X509.equals(format)) { KeyFactory f = KeyFactory.getInstance(algorithm); return f.generatePublic(new X509EncodedKeySpec(encoded)); } else if (type == Type.PRIVATE && PKCS8.equals(format)) { KeyFactory f = KeyFactory.getInstance(algorithm); return f.generatePrivate(new PKCS8EncodedKeySpec(encoded)); } else { throw new NotSerializableException ("unrecognized type/format combination: " + type + "/" + format); } } catch (NotSerializableException nse) { throw nse; } catch (Exception e) { NotSerializableException nse = new NotSerializableException ("java.security.Key: " + "[" + type + "] " + "[" + algorithm + "] " + "[" + format + "]"); nse.initCause(e); throw nse; } }
class class_name[name] begin[{] method[readResolve, return_type[type[Object]], modifier[protected], parameter[]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SECRET, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=RAW, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PUBLIC, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=X509, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PRIVATE, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=PKCS8, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unrecognized type/format combination: "), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=format, 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=NotSerializableException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=KeyFactory, selectors=[], type_arguments=None), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyFactory, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=encoded, 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=PKCS8EncodedKeySpec, sub_type=None))], member=generatePrivate, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=KeyFactory, selectors=[], type_arguments=None), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyFactory, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=encoded, 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=X509EncodedKeySpec, sub_type=None))], member=generatePublic, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=encoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=algorithm, 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=SecretKeySpec, sub_type=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=nse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nse, types=['NotSerializableException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.security.Key: "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="["), operator=+), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="["), operator=+), operandr=MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="["), operator=+), operandr=MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotSerializableException, sub_type=None)), name=nse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NotSerializableException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=nse, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=nse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[Object] identifier[readResolve] operator[SEP] operator[SEP] Keyword[throws] identifier[ObjectStreamException] { Keyword[try] { Keyword[if] operator[SEP] identifier[type] operator[==] identifier[Type] operator[SEP] identifier[SECRET] operator[&&] identifier[RAW] operator[SEP] identifier[equals] operator[SEP] identifier[format] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[encoded] , identifier[algorithm] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[Type] operator[SEP] identifier[PUBLIC] operator[&&] identifier[X509] operator[SEP] identifier[equals] operator[SEP] identifier[format] operator[SEP] operator[SEP] { identifier[KeyFactory] identifier[f] operator[=] identifier[KeyFactory] operator[SEP] identifier[getInstance] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP] identifier[generatePublic] operator[SEP] Keyword[new] identifier[X509EncodedKeySpec] operator[SEP] identifier[encoded] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[Type] operator[SEP] identifier[PRIVATE] operator[&&] identifier[PKCS8] operator[SEP] identifier[equals] operator[SEP] identifier[format] operator[SEP] operator[SEP] { identifier[KeyFactory] identifier[f] operator[=] identifier[KeyFactory] operator[SEP] identifier[getInstance] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP] identifier[generatePrivate] operator[SEP] Keyword[new] identifier[PKCS8EncodedKeySpec] operator[SEP] identifier[encoded] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[NotSerializableException] operator[SEP] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[+] identifier[format] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NotSerializableException] identifier[nse] operator[SEP] { Keyword[throw] identifier[nse] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[NotSerializableException] identifier[nse] operator[=] Keyword[new] identifier[NotSerializableException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[algorithm] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[format] operator[+] literal[String] operator[SEP] operator[SEP] identifier[nse] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[nse] operator[SEP] } }
@Override public EEnum getIfcBuildingElementPartTypeEnum() { if (ifcBuildingElementPartTypeEnumEEnum == null) { ifcBuildingElementPartTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(924); } return ifcBuildingElementPartTypeEnumEEnum; }
class class_name[name] begin[{] method[getIfcBuildingElementPartTypeEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcBuildingElementPartTypeEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcBuildingElementPartTypeEnumEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=924)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcBuildingElementPartTypeEnumEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcBuildingElementPartTypeEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcBuildingElementPartTypeEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcBuildingElementPartTypeEnumEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[924] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcBuildingElementPartTypeEnumEEnum] operator[SEP] }
@Override public void set(DataStoreSource source, String key, Object value) { SetRequest request = new SetRequest(source, Action.SET_SOURCE, messageId, clientId, 0, 0, 0, key, serializer.serialize(value).toString()); send(request); }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[source, key, value]] begin[{] local_variable[type[SetRequest], request] call[.send, parameter[member[.request]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[DataStoreSource] identifier[source] , identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] { identifier[SetRequest] identifier[request] operator[=] Keyword[new] identifier[SetRequest] operator[SEP] identifier[source] , identifier[Action] operator[SEP] identifier[SET_SOURCE] , identifier[messageId] , identifier[clientId] , Other[0] , Other[0] , Other[0] , identifier[key] , identifier[serializer] operator[SEP] identifier[serialize] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[send] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void orderedCopy(SegmentedByteArray src, long srcPos, long destPos, long length) { int segmentLength = 1 << log2OfSegmentSize; int currentSegment = (int)(destPos >>> log2OfSegmentSize); int segmentStartPos = (int)(destPos & bitmask); int remainingBytesInSegment = segmentLength - segmentStartPos; while(length > 0) { int bytesToCopyFromSegment = (int)Math.min(remainingBytesInSegment, length); ensureCapacity(currentSegment); int copiedBytes = src.orderedCopy(srcPos, segments[currentSegment], segmentStartPos, bytesToCopyFromSegment); srcPos += copiedBytes; length -= copiedBytes; segmentStartPos = 0; remainingBytesInSegment = segmentLength; currentSegment++; } }
class class_name[name] begin[{] method[orderedCopy, return_type[void], modifier[public], parameter[src, srcPos, destPos, length]] begin[{] local_variable[type[int], segmentLength] local_variable[type[int], currentSegment] local_variable[type[int], segmentStartPos] local_variable[type[int], remainingBytesInSegment] while[binary_operation[member[.length], >, literal[0]]] begin[{] local_variable[type[int], bytesToCopyFromSegment] call[.ensureCapacity, parameter[member[.currentSegment]]] local_variable[type[int], copiedBytes] assign[member[.srcPos], member[.copiedBytes]] assign[member[.length], member[.copiedBytes]] assign[member[.segmentStartPos], literal[0]] assign[member[.remainingBytesInSegment], member[.segmentLength]] member[.currentSegment] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[orderedCopy] operator[SEP] identifier[SegmentedByteArray] identifier[src] , Keyword[long] identifier[srcPos] , Keyword[long] identifier[destPos] , Keyword[long] identifier[length] operator[SEP] { Keyword[int] identifier[segmentLength] operator[=] Other[1] operator[<<] identifier[log2OfSegmentSize] operator[SEP] Keyword[int] identifier[currentSegment] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[destPos] operator[>] operator[>] operator[>] identifier[log2OfSegmentSize] operator[SEP] operator[SEP] Keyword[int] identifier[segmentStartPos] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[destPos] operator[&] identifier[bitmask] operator[SEP] operator[SEP] Keyword[int] identifier[remainingBytesInSegment] operator[=] identifier[segmentLength] operator[-] identifier[segmentStartPos] operator[SEP] Keyword[while] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[bytesToCopyFromSegment] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[remainingBytesInSegment] , identifier[length] operator[SEP] operator[SEP] identifier[ensureCapacity] operator[SEP] identifier[currentSegment] operator[SEP] operator[SEP] Keyword[int] identifier[copiedBytes] operator[=] identifier[src] operator[SEP] identifier[orderedCopy] operator[SEP] identifier[srcPos] , identifier[segments] operator[SEP] identifier[currentSegment] operator[SEP] , identifier[segmentStartPos] , identifier[bytesToCopyFromSegment] operator[SEP] operator[SEP] identifier[srcPos] operator[+=] identifier[copiedBytes] operator[SEP] identifier[length] operator[-=] identifier[copiedBytes] operator[SEP] identifier[segmentStartPos] operator[=] Other[0] operator[SEP] identifier[remainingBytesInSegment] operator[=] identifier[segmentLength] operator[SEP] identifier[currentSegment] operator[++] operator[SEP] } }
@FFDCIgnore(value = { IndexOutOfBoundsException.class }) // Liberty Change private static Object injectIntoCollectionOrArray(Class<?> rawType, Type genericType, Annotation[] paramAnns, MultivaluedMap<String, String> values, boolean isbean, boolean decoded, ParameterType pathParam, Message message) { //CHECKSTYLE:ON // Liberty change start ParamConverter<?> pm = null; if (message != null) { ServerProviderFactory pf = ServerProviderFactory.getInstance(message); pm = pf.createParameterHandler(rawType, genericType, paramAnns, message); if (pm != null) { if (tc.isDebugEnabled() && values.size() > 1) { Tr.debug(tc, "injectIntoCollectionOrArray unexpected: size of values > 1, values.size()=" + values.size()); } for (Map.Entry<String, List<String>> entry : values.entrySet()) { // always only ever 1? // if a user specifies the wrong id we should return null instead of blowing up try { return pm.fromString(entry.getValue().get(0)); } catch (IndexOutOfBoundsException e) { return null; } } } } // Liberty change end Class<?> type = getCollectionType(rawType); Class<?> realType = null; Type realGenericType = null; if (rawType.isArray()) { realType = rawType.getComponentType(); realGenericType = realType; } else { Type[] types = getActualTypes(genericType); if (types.length == 0 || !(types[0] instanceof ParameterizedType)) { realType = getActualType(genericType); realGenericType = realType; } else { realType = getRawType(types[0]); realGenericType = types[0] == realType ? realType : types[0]; } } Object theValues = null; if (type != null) { try { theValues = type.newInstance(); } catch (IllegalAccessException ex) { reportServerError("CLASS_ACCESS_FAILURE", type.getName()); } catch (Exception ex) { reportServerError("CLASS_INSTANTIATION_FAILURE", type.getName()); } } else { theValues = Array.newInstance(realType, isbean ? 1 : values.values().iterator().next().size()); } if (isbean) { Object o = InjectionUtils.handleBean(realType, paramAnns, values, pathParam, message, decoded); addToCollectionValues(theValues, o, 0); } else { List<String> valuesList = values.values().iterator().next(); valuesList = checkPathSegment(valuesList, realType, pathParam); for (int ind = 0; ind < valuesList.size(); ind++) { Object o = InjectionUtils.handleParameter(valuesList.get(ind), decoded, realType, realGenericType, paramAnns, pathParam, message); addToCollectionValues(theValues, o, ind); } } return theValues; }
class class_name[name] begin[{] method[injectIntoCollectionOrArray, return_type[type[Object]], modifier[private static], parameter[rawType, genericType, paramAnns, values, isbean, decoded, pathParam, message]] begin[{] local_variable[type[ParamConverter], pm] if[binary_operation[member[.message], !=, literal[null]]] begin[{] local_variable[type[ServerProviderFactory], pf] assign[member[.pm], call[pf.createParameterHandler, parameter[member[.rawType], member[.genericType], member[.paramAnns], member[.message]]]] if[binary_operation[member[.pm], !=, literal[null]]] begin[{] if[binary_operation[call[tc.isDebugEnabled, parameter[]], &&, binary_operation[call[values.size, parameter[]], >, literal[1]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["injectIntoCollectionOrArray unexpected: size of values > 1, values.size()="], +, call[values.size, parameter[]]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=fromString, postfix_operators=[], prefix_operators=[], qualifier=pm, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IndexOutOfBoundsException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] else begin[{] None end[}] local_variable[type[Class], type] local_variable[type[Class], realType] local_variable[type[Type], realGenericType] if[call[rawType.isArray, parameter[]]] begin[{] assign[member[.realType], call[rawType.getComponentType, parameter[]]] assign[member[.realGenericType], member[.realType]] else begin[{] local_variable[type[Type], types] if[binary_operation[binary_operation[member[types.length], ==, literal[0]], ||, binary_operation[member[.types], instanceof, type[ParameterizedType]]]] begin[{] assign[member[.realType], call[.getActualType, parameter[member[.genericType]]]] assign[member[.realGenericType], member[.realType]] else begin[{] assign[member[.realType], call[.getRawType, parameter[member[.types]]]] assign[member[.realGenericType], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=realType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), if_true=MemberReference(member=realType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] end[}] local_variable[type[Object], theValues] if[binary_operation[member[.type], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=theValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CLASS_ACCESS_FAILURE"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)], member=reportServerError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalAccessException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CLASS_INSTANTIATION_FAILURE"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)], member=reportServerError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] assign[member[.theValues], call[Array.newInstance, parameter[member[.realType], TernaryExpression(condition=MemberReference(member=isbean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]]] end[}] if[member[.isbean]] begin[{] local_variable[type[Object], o] call[.addToCollectionValues, parameter[member[.theValues], member[.o], literal[0]]] else begin[{] local_variable[type[List], valuesList] assign[member[.valuesList], call[.checkPathSegment, parameter[member[.valuesList], member[.realType], member[.pathParam]]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=valuesList, selectors=[], type_arguments=None), MemberReference(member=decoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=realType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=realGenericType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramAnns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pathParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleParameter, postfix_operators=[], prefix_operators=[], qualifier=InjectionUtils, selectors=[], type_arguments=None), name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=theValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addToCollectionValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=valuesList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ind)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ind, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] return[member[.theValues]] end[}] END[}]
annotation[@] identifier[FFDCIgnore] operator[SEP] identifier[value] operator[=] { identifier[IndexOutOfBoundsException] operator[SEP] Keyword[class] } operator[SEP] Keyword[private] Keyword[static] identifier[Object] identifier[injectIntoCollectionOrArray] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[rawType] , identifier[Type] identifier[genericType] , identifier[Annotation] operator[SEP] operator[SEP] identifier[paramAnns] , identifier[MultivaluedMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[values] , Keyword[boolean] identifier[isbean] , Keyword[boolean] identifier[decoded] , identifier[ParameterType] identifier[pathParam] , identifier[Message] identifier[message] operator[SEP] { identifier[ParamConverter] operator[<] operator[?] operator[>] identifier[pm] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[message] operator[!=] Other[null] operator[SEP] { identifier[ServerProviderFactory] identifier[pf] operator[=] identifier[ServerProviderFactory] operator[SEP] identifier[getInstance] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[pm] operator[=] identifier[pf] operator[SEP] identifier[createParameterHandler] operator[SEP] identifier[rawType] , identifier[genericType] , identifier[paramAnns] , identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pm] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[&&] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[values] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] identifier[pm] operator[SEP] identifier[fromString] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IndexOutOfBoundsException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } } } identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[getCollectionType] operator[SEP] identifier[rawType] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[realType] operator[=] Other[null] operator[SEP] identifier[Type] identifier[realGenericType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[rawType] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] { identifier[realType] operator[=] identifier[rawType] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP] identifier[realGenericType] operator[=] identifier[realType] operator[SEP] } Keyword[else] { identifier[Type] operator[SEP] operator[SEP] identifier[types] operator[=] identifier[getActualTypes] operator[SEP] identifier[genericType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[types] operator[SEP] identifier[length] operator[==] Other[0] operator[||] operator[!] operator[SEP] identifier[types] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] operator[SEP] { identifier[realType] operator[=] identifier[getActualType] operator[SEP] identifier[genericType] operator[SEP] operator[SEP] identifier[realGenericType] operator[=] identifier[realType] operator[SEP] } Keyword[else] { identifier[realType] operator[=] identifier[getRawType] operator[SEP] identifier[types] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[realGenericType] operator[=] identifier[types] operator[SEP] Other[0] operator[SEP] operator[==] identifier[realType] operator[?] identifier[realType] operator[:] identifier[types] operator[SEP] Other[0] operator[SEP] operator[SEP] } } identifier[Object] identifier[theValues] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[theValues] operator[=] identifier[type] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[ex] operator[SEP] { identifier[reportServerError] operator[SEP] literal[String] , identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[reportServerError] operator[SEP] literal[String] , identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[theValues] operator[=] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[realType] , identifier[isbean] operator[?] Other[1] operator[:] identifier[values] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isbean] operator[SEP] { identifier[Object] identifier[o] operator[=] identifier[InjectionUtils] operator[SEP] identifier[handleBean] operator[SEP] identifier[realType] , identifier[paramAnns] , identifier[values] , identifier[pathParam] , identifier[message] , identifier[decoded] operator[SEP] operator[SEP] identifier[addToCollectionValues] operator[SEP] identifier[theValues] , identifier[o] , Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[List] operator[<] identifier[String] operator[>] identifier[valuesList] operator[=] identifier[values] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[valuesList] operator[=] identifier[checkPathSegment] operator[SEP] identifier[valuesList] , identifier[realType] , identifier[pathParam] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ind] operator[=] Other[0] operator[SEP] identifier[ind] operator[<] identifier[valuesList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[ind] operator[++] operator[SEP] { identifier[Object] identifier[o] operator[=] identifier[InjectionUtils] operator[SEP] identifier[handleParameter] operator[SEP] identifier[valuesList] operator[SEP] identifier[get] operator[SEP] identifier[ind] operator[SEP] , identifier[decoded] , identifier[realType] , identifier[realGenericType] , identifier[paramAnns] , identifier[pathParam] , identifier[message] operator[SEP] operator[SEP] identifier[addToCollectionValues] operator[SEP] identifier[theValues] , identifier[o] , identifier[ind] operator[SEP] operator[SEP] } } Keyword[return] identifier[theValues] operator[SEP] }
public SourceSchema withRecordColumns(RecordColumn... recordColumns) { if (this.recordColumns == null) { setRecordColumns(new java.util.ArrayList<RecordColumn>(recordColumns.length)); } for (RecordColumn ele : recordColumns) { this.recordColumns.add(ele); } return this; }
class class_name[name] begin[{] method[withRecordColumns, return_type[type[SourceSchema]], modifier[public], parameter[recordColumns]] begin[{] if[binary_operation[THIS[member[None.recordColumns]], ==, literal[null]]] begin[{] call[.setRecordColumns, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=recordColumns, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RecordColumn, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=recordColumns, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=recordColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RecordColumn, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[SourceSchema] identifier[withRecordColumns] operator[SEP] identifier[RecordColumn] operator[...] identifier[recordColumns] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[recordColumns] operator[==] Other[null] operator[SEP] { identifier[setRecordColumns] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[RecordColumn] operator[>] operator[SEP] identifier[recordColumns] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[RecordColumn] identifier[ele] operator[:] identifier[recordColumns] operator[SEP] { Keyword[this] operator[SEP] identifier[recordColumns] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public BeanO addBean(BeanO beanO, ContainerTx containerTx) throws DuplicateKeyException, RemoteException { return activator.addBean(containerTx, beanO); }
class class_name[name] begin[{] method[addBean, return_type[type[BeanO]], modifier[public], parameter[beanO, containerTx]] begin[{] return[call[activator.addBean, parameter[member[.containerTx], member[.beanO]]]] end[}] END[}]
Keyword[public] identifier[BeanO] identifier[addBean] operator[SEP] identifier[BeanO] identifier[beanO] , identifier[ContainerTx] identifier[containerTx] operator[SEP] Keyword[throws] identifier[DuplicateKeyException] , identifier[RemoteException] { Keyword[return] identifier[activator] operator[SEP] identifier[addBean] operator[SEP] identifier[containerTx] , identifier[beanO] operator[SEP] operator[SEP] }
public static AuthenticationData createAuthenticationData(Certificate[] certs, UserRegistry userRegistry) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "createAuthenticationData", certs); } AuthenticationData authData = new WSAuthenticationData(); X509Certificate[] _certs; _certs = new X509Certificate[certs.length]; for (int i = 0; i < certs.length; i++) { if (certs[i] instanceof X509Certificate) { _certs[i] = (X509Certificate) certs[i]; } else { _certs = null; break; } } authData.set(AuthenticationData.CERTCHAIN, _certs); authData.set(AuthenticationData.REALM, getDefaultRealm(userRegistry)); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, CLASS_NAME + "createAuthenticationData", authData); } return authData; }
class class_name[name] begin[{] method[createAuthenticationData, return_type[type[AuthenticationData]], modifier[public static], parameter[certs, userRegistry]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], binary_operation[member[.CLASS_NAME], +, literal["createAuthenticationData"]], member[.certs]]] else begin[{] None end[}] local_variable[type[AuthenticationData], authData] local_variable[type[X509Certificate], _certs] assign[member[._certs], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=certs, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=X509Certificate, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=certs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=X509Certificate, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_certs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_certs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=certs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=X509Certificate, sub_type=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=certs, 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) call[authData.set, parameter[member[AuthenticationData.CERTCHAIN], member[._certs]]] call[authData.set, parameter[member[AuthenticationData.REALM], call[.getDefaultRealm, parameter[member[.userRegistry]]]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], binary_operation[member[.CLASS_NAME], +, literal["createAuthenticationData"]], member[.authData]]] else begin[{] None end[}] return[member[.authData]] end[}] END[}]
Keyword[public] Keyword[static] identifier[AuthenticationData] identifier[createAuthenticationData] operator[SEP] identifier[Certificate] operator[SEP] operator[SEP] identifier[certs] , identifier[UserRegistry] identifier[userRegistry] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[certs] operator[SEP] operator[SEP] } identifier[AuthenticationData] identifier[authData] operator[=] Keyword[new] identifier[WSAuthenticationData] operator[SEP] operator[SEP] operator[SEP] identifier[X509Certificate] operator[SEP] operator[SEP] identifier[_certs] operator[SEP] identifier[_certs] operator[=] Keyword[new] identifier[X509Certificate] operator[SEP] identifier[certs] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[certs] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[certs] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[X509Certificate] operator[SEP] { identifier[_certs] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[X509Certificate] operator[SEP] identifier[certs] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[else] { identifier[_certs] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP] } } identifier[authData] operator[SEP] identifier[set] operator[SEP] identifier[AuthenticationData] operator[SEP] identifier[CERTCHAIN] , identifier[_certs] operator[SEP] operator[SEP] identifier[authData] operator[SEP] identifier[set] operator[SEP] identifier[AuthenticationData] operator[SEP] identifier[REALM] , identifier[getDefaultRealm] operator[SEP] identifier[userRegistry] operator[SEP] 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] identifier[tc] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[authData] operator[SEP] operator[SEP] } Keyword[return] identifier[authData] operator[SEP] }
public StringClauses replace(Enum key, StringClauses newValue) { return replace(key.name(), newValue); }
class class_name[name] begin[{] method[replace, return_type[type[StringClauses]], modifier[public], parameter[key, newValue]] begin[{] return[call[.replace, parameter[call[key.name, parameter[]], member[.newValue]]]] end[}] END[}]
Keyword[public] identifier[StringClauses] identifier[replace] operator[SEP] identifier[Enum] identifier[key] , identifier[StringClauses] identifier[newValue] operator[SEP] { Keyword[return] identifier[replace] operator[SEP] identifier[key] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[newValue] operator[SEP] operator[SEP] }
public boolean createIfNotFoundError(DBException ex) throws DBException { if (ex.getErrorCode() == DBConstants.FILE_NOT_FOUND) if (this.getRecord() != null) if ((this.getRecord().getOpenMode() & DBConstants.OPEN_DONT_CREATE) == 0) { boolean loadInitialData = false; boolean useTemporaryFilename = false; if (this.getDatabase() != null) { if (DBConstants.TRUE.equalsIgnoreCase(this.getDatabase().getProperty(DBConstants.LOAD_INITIAL_DATA))) if ((this.getDatabase().getDatabaseOwner() == null) || (!DBConstants.FALSE.equalsIgnoreCase(this.getDatabase().getDatabaseOwner().getProperty(DBConstants.LOAD_INITIAL_DATA)))) // Global switch loadInitialData = true; if (DBConstants.TRUE.equalsIgnoreCase(this.getDatabase().getProperty(SQLParams.RENAME_TABLE_SUPPORT))) useTemporaryFilename = true; } if (this.getRecord().isQueryRecord()) { // If this is a query, try to create all the tables of the query for (int i = 0; i < this.getRecord().getRecordlistCount(); i++) { Record record = this.getRecord().getRecordlistAt(i); try { // TODO - I Should load into a temp table (see below) if (!record.getTable().create()) return false; } catch (DBException e) { continue; // Ignore if it already exists } if (loadInitialData) { RecordOwner recordOwner = record.getRecordOwner(); if (recordOwner == null) record.setRecordOwner(this.getRecord().getRecordOwner()); record.getTable().loadInitialData(); if (recordOwner == null) record.setRecordOwner(recordOwner); } } return true; // Success! } String tableName = null; boolean bSuccess = true; try { if (useTemporaryFilename) if (loadInitialData) { tableName = this.getRecord().getTableNames(false); this.getRecord().setTableNames(tableName + TEMP_SUFFIX); } bSuccess = this.create(); if (bSuccess) if (loadInitialData) { this.loadInitialData(); if (useTemporaryFilename) this.renameTable(tableName + TEMP_SUFFIX, tableName); } } catch (DBException e) { // Exception usually means another thread is creating and loading the data for this table... just wait for it to finish. if (tableName != null) this.getRecord().setTableNames(tableName); int oldOpenMode = this.getRecord().getOpenMode(); this.getRecord().setOpenMode(oldOpenMode | DBConstants.OPEN_DONT_CREATE); int oldKeyArea = this.getRecord().getDefaultOrder(); int i = 0; for (; i < 120; i++) // 120 Seconds max. { try { this.getRecord().setKeyArea(0); this.doSeek(DBConstants.EQUALS); // This will throw an exception if there is no table break; // Normal open = done loadingInitialData. } catch (DBException e2) { // Ignore this error, continue until the table exists } finally { this.getRecord().setKeyArea(oldKeyArea); } synchronized(this) { try { this.wait(1000); } catch (InterruptedException e1) { e1.printStackTrace(); } } } if (i == 20) { oldOpenMode = oldOpenMode | DBConstants.OPEN_DONT_CREATE; // Give up e.printStackTrace(); } this.getRecord().setOpenMode(oldOpenMode); } finally { if (tableName != null) this.getRecord().setTableNames(tableName); } return bSuccess; } return false; }
class class_name[name] begin[{] method[createIfNotFoundError, return_type[type[boolean]], modifier[public], parameter[ex]] begin[{] if[binary_operation[call[ex.getErrorCode, parameter[]], ==, member[DBConstants.FILE_NOT_FOUND]]] begin[{] if[binary_operation[THIS[call[None.getRecord, parameter[]]], !=, literal[null]]] begin[{] if[binary_operation[binary_operation[THIS[call[None.getRecord, parameter[]]call[None.getOpenMode, parameter[]]], &, member[DBConstants.OPEN_DONT_CREATE]], ==, literal[0]]] begin[{] local_variable[type[boolean], loadInitialData] local_variable[type[boolean], useTemporaryFilename] if[binary_operation[THIS[call[None.getDatabase, parameter[]]], !=, literal[null]]] begin[{] if[call[DBConstants.TRUE.equalsIgnoreCase, parameter[THIS[call[None.getDatabase, parameter[]]call[None.getProperty, parameter[member[DBConstants.LOAD_INITIAL_DATA]]]]]]] begin[{] if[binary_operation[binary_operation[THIS[call[None.getDatabase, parameter[]]call[None.getDatabaseOwner, parameter[]]], ==, literal[null]], ||, call[DBConstants.FALSE.equalsIgnoreCase, parameter[THIS[call[None.getDatabase, parameter[]]call[None.getDatabaseOwner, parameter[]]call[None.getProperty, parameter[member[DBConstants.LOAD_INITIAL_DATA]]]]]]]] begin[{] assign[member[.loadInitialData], literal[true]] else begin[{] None end[}] else begin[{] None end[}] if[call[DBConstants.TRUE.equalsIgnoreCase, parameter[THIS[call[None.getDatabase, parameter[]]call[None.getProperty, parameter[member[SQLParams.RENAME_TABLE_SUPPORT]]]]]]] begin[{] assign[member[.useTemporaryFilename], literal[true]] else begin[{] None end[}] else begin[{] None end[}] if[THIS[call[None.getRecord, parameter[]]call[None.isQueryRecord, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRecordlistAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=record)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=getTable, postfix_operators=[], prefix_operators=['!'], qualifier=record, selectors=[MethodInvocation(arguments=[], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))], catches=[CatchClause(block=[ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DBException']))], finally_block=None, label=None, resources=None), IfStatement(condition=MemberReference(member=loadInitialData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRecordOwner, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), name=recordOwner)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RecordOwner, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=recordOwner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getRecordOwner, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=setRecordOwner, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getTable, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[MethodInvocation(arguments=[], member=loadInitialData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=recordOwner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=recordOwner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRecordOwner, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getRecordlistCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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[literal[true]] else begin[{] None end[}] local_variable[type[String], tableName] local_variable[type[boolean], bSuccess] TryStatement(block=[IfStatement(condition=MemberReference(member=useTemporaryFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=IfStatement(condition=MemberReference(member=loadInitialData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getTableNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TEMP_SUFFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setTableNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bSuccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), IfStatement(condition=MemberReference(member=bSuccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=IfStatement(condition=MemberReference(member=loadInitialData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=loadInitialData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=MemberReference(member=useTemporaryFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TEMP_SUFFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=renameTable, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None))])))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTableNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getOpenMode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=oldOpenMode)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=oldOpenMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OPEN_DONT_CREATE, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[]), operator=|)], member=setOpenMode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getDefaultOrder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=oldKeyArea)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setKeyArea, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=EQUALS, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[])], member=doSeek, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e2, types=['DBException']))], finally_block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=oldKeyArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setKeyArea, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, resources=None), SynchronizedStatement(block=[TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], member=wait, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e1, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['InterruptedException']))], finally_block=None, label=None, resources=None)], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=120), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=oldOpenMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=oldOpenMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OPEN_DONT_CREATE, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[]), operator=|)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=oldOpenMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOpenMode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DBException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTableNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None))], label=None, resources=None) return[member[.bSuccess]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[createIfNotFoundError] operator[SEP] identifier[DBException] identifier[ex] operator[SEP] Keyword[throws] identifier[DBException] { Keyword[if] operator[SEP] identifier[ex] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] operator[==] identifier[DBConstants] operator[SEP] identifier[FILE_NOT_FOUND] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getOpenMode] operator[SEP] operator[SEP] operator[&] identifier[DBConstants] operator[SEP] identifier[OPEN_DONT_CREATE] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[boolean] identifier[loadInitialData] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[useTemporaryFilename] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[DBConstants] operator[SEP] identifier[TRUE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBConstants] operator[SEP] identifier[LOAD_INITIAL_DATA] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getDatabaseOwner] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] operator[!] identifier[DBConstants] operator[SEP] identifier[FALSE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getDatabaseOwner] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBConstants] operator[SEP] identifier[LOAD_INITIAL_DATA] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[loadInitialData] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[DBConstants] operator[SEP] identifier[TRUE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[SQLParams] operator[SEP] identifier[RENAME_TABLE_SUPPORT] operator[SEP] operator[SEP] operator[SEP] identifier[useTemporaryFilename] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[isQueryRecord] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getRecordlistCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Record] identifier[record] operator[=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getRecordlistAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[record] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[DBException] identifier[e] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[loadInitialData] operator[SEP] { identifier[RecordOwner] identifier[recordOwner] operator[=] identifier[record] operator[SEP] identifier[getRecordOwner] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recordOwner] operator[==] Other[null] operator[SEP] identifier[record] operator[SEP] identifier[setRecordOwner] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getRecordOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] identifier[loadInitialData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recordOwner] operator[==] Other[null] operator[SEP] identifier[record] operator[SEP] identifier[setRecordOwner] operator[SEP] identifier[recordOwner] operator[SEP] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] } identifier[String] identifier[tableName] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[bSuccess] operator[=] literal[boolean] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[useTemporaryFilename] operator[SEP] Keyword[if] operator[SEP] identifier[loadInitialData] operator[SEP] { identifier[tableName] operator[=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getTableNames] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setTableNames] operator[SEP] identifier[tableName] operator[+] identifier[TEMP_SUFFIX] operator[SEP] operator[SEP] } identifier[bSuccess] operator[=] Keyword[this] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bSuccess] operator[SEP] Keyword[if] operator[SEP] identifier[loadInitialData] operator[SEP] { Keyword[this] operator[SEP] identifier[loadInitialData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useTemporaryFilename] operator[SEP] Keyword[this] operator[SEP] identifier[renameTable] operator[SEP] identifier[tableName] operator[+] identifier[TEMP_SUFFIX] , identifier[tableName] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[DBException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[tableName] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setTableNames] operator[SEP] identifier[tableName] operator[SEP] operator[SEP] Keyword[int] identifier[oldOpenMode] operator[=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getOpenMode] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setOpenMode] operator[SEP] identifier[oldOpenMode] operator[|] identifier[DBConstants] operator[SEP] identifier[OPEN_DONT_CREATE] operator[SEP] operator[SEP] Keyword[int] identifier[oldKeyArea] operator[=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] Other[120] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[try] { Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setKeyArea] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[doSeek] operator[SEP] identifier[DBConstants] operator[SEP] identifier[EQUALS] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[catch] operator[SEP] identifier[DBException] identifier[e2] operator[SEP] { } Keyword[finally] { Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[oldKeyArea] operator[SEP] operator[SEP] } Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[try] { Keyword[this] operator[SEP] identifier[wait] operator[SEP] Other[1000] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e1] operator[SEP] { identifier[e1] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[i] operator[==] Other[20] operator[SEP] { identifier[oldOpenMode] operator[=] identifier[oldOpenMode] operator[|] identifier[DBConstants] operator[SEP] identifier[OPEN_DONT_CREATE] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setOpenMode] operator[SEP] identifier[oldOpenMode] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[tableName] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setTableNames] operator[SEP] identifier[tableName] operator[SEP] operator[SEP] } Keyword[return] identifier[bSuccess] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void build(final LNGIntVector ns) { for (int i = 0; i < this.heap.size(); i++) this.indices.set(this.heap.get(i), -1); this.heap.clear(); for (int i = 0; i < ns.size(); i++) { this.indices.set(ns.get(i), i); this.heap.push(ns.get(i)); } for (int i = this.heap.size() / 2 - 1; i >= 0; i--) this.percolateDown(i); }
class class_name[name] begin[{] method[build, return_type[void], modifier[public], parameter[ns]] begin[{] ForStatement(body=StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=indices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=heap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=heap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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) THIS[member[None.heap]call[None.clear, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=indices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ns, selectors=[], type_arguments=None), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=heap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ns, selectors=[], type_arguments=None)], member=push, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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=ns, 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) ForStatement(body=StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=percolateDown, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=heap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[build] operator[SEP] Keyword[final] identifier[LNGIntVector] identifier[ns] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[this] operator[SEP] identifier[indices] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , operator[-] Other[1] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[this] operator[SEP] identifier[indices] operator[SEP] identifier[set] operator[SEP] identifier[ns] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[i] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[push] operator[SEP] identifier[ns] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] Keyword[this] operator[SEP] identifier[percolateDown] operator[SEP] identifier[i] operator[SEP] operator[SEP] }
protected Node getXPathResultNode(String select, Document document) throws ConfigurationException, TransformerException, XpathException { return getXPathResultAsDocument(select, document).getDocumentElement(); }
class class_name[name] begin[{] method[getXPathResultNode, return_type[type[Node]], modifier[protected], parameter[select, document]] begin[{] return[call[.getXPathResultAsDocument, parameter[member[.select], member[.document]]]] end[}] END[}]
Keyword[protected] identifier[Node] identifier[getXPathResultNode] operator[SEP] identifier[String] identifier[select] , identifier[Document] identifier[document] operator[SEP] Keyword[throws] identifier[ConfigurationException] , identifier[TransformerException] , identifier[XpathException] { Keyword[return] identifier[getXPathResultAsDocument] operator[SEP] identifier[select] , identifier[document] operator[SEP] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] }
public void setVspace(String vspace) { _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VSPACE, vspace); }
class class_name[name] begin[{] method[setVspace, return_type[void], modifier[public], parameter[vspace]] begin[{] call[_imageState.registerAttribute, parameter[member[AbstractHtmlState.ATTR_GENERAL], member[HtmlConstants.VSPACE], member[.vspace]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setVspace] operator[SEP] identifier[String] identifier[vspace] operator[SEP] { identifier[_imageState] operator[SEP] identifier[registerAttribute] operator[SEP] identifier[AbstractHtmlState] operator[SEP] identifier[ATTR_GENERAL] , identifier[HtmlConstants] operator[SEP] identifier[VSPACE] , identifier[vspace] operator[SEP] operator[SEP] }
public void setMinimumDuration(@NotNull final Duration minimumDuration) { if (minimumDuration.compareTo(MAXIMUM_DURATION) > 0) { throw new IllegalArgumentException("The minimum duaration has to be smaller than 23:59:59."); } this.minimumDuration = durationToDate(minimumDuration); }
class class_name[name] begin[{] method[setMinimumDuration, return_type[void], modifier[public], parameter[minimumDuration]] begin[{] if[binary_operation[call[minimumDuration.compareTo, parameter[member[.MAXIMUM_DURATION]]], >, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The minimum duaration has to be smaller than 23:59:59.")], 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[}] assign[THIS[member[None.minimumDuration]], call[.durationToDate, parameter[member[.minimumDuration]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMinimumDuration] operator[SEP] annotation[@] identifier[NotNull] Keyword[final] identifier[Duration] identifier[minimumDuration] operator[SEP] { Keyword[if] operator[SEP] identifier[minimumDuration] operator[SEP] identifier[compareTo] operator[SEP] identifier[MAXIMUM_DURATION] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[minimumDuration] operator[=] identifier[durationToDate] operator[SEP] identifier[minimumDuration] operator[SEP] operator[SEP] }
private boolean handleOverridesAndConflicts(JvmOperation operation, Multimap<String, AbstractResolvedOperation> processedOperations) { String simpleName = operation.getSimpleName(); if (!processedOperations.containsKey(simpleName)) { return true; } List<AbstractResolvedOperation> conflictingOperations = null; for (AbstractResolvedOperation candidate : processedOperations.get(simpleName)) { OverrideTester overrideTester = candidate.getOverrideTester(); IOverrideCheckResult checkResult = overrideTester.isSubsignature(candidate, operation, false); if (checkResult.getDetails().contains(OverrideCheckDetails.DEFAULT_IMPL_CONFLICT)) { // The current operation conflicts with the candidate if (conflictingOperations == null) conflictingOperations = Lists.newLinkedList(); conflictingOperations.add(candidate); } else if (checkResult.isOverridingOrImplementing()) { return false; } } if (conflictingOperations != null) { if (conflictingOperations.size() == 1 && conflictingOperations.get(0) instanceof ConflictingDefaultOperation) { // The current operation contributes to the already existing conflict ConflictingDefaultOperation conflictingDefaultOperation = (ConflictingDefaultOperation) conflictingOperations.get(0); boolean isOverridden = false; for (IResolvedOperation conflictingOp : conflictingDefaultOperation.getConflictingOperations()) { if (conflictingOp.getResolvedDeclarator().isSubtypeOf(operation.getDeclaringType())) { isOverridden = true; break; } } if (!isOverridden) conflictingDefaultOperation.getConflictingOperations().add(createResolvedOperation(operation)); return false; } // A new conflict of default implementations was found if (operation.isAbstract()) { ConflictingDefaultOperation resolvedOperation = createConflictingOperation(conflictingOperations.get(0).getDeclaration()); resolvedOperation.getConflictingOperations().add(createResolvedOperation(operation)); for (AbstractResolvedOperation conflictingOp : conflictingOperations) { processedOperations.remove(simpleName, conflictingOp); if (conflictingOp.getDeclaration() != resolvedOperation.getDeclaration()) { resolvedOperation.getConflictingOperations().add(conflictingOp); } } processedOperations.put(simpleName, resolvedOperation); } else { ConflictingDefaultOperation resolvedOperation = createConflictingOperation(operation); for (AbstractResolvedOperation conflictingOp : conflictingOperations) { processedOperations.remove(simpleName, conflictingOp); resolvedOperation.getConflictingOperations().add(conflictingOp); } processedOperations.put(simpleName, resolvedOperation); } return false; } return true; }
class class_name[name] begin[{] method[handleOverridesAndConflicts, return_type[type[boolean]], modifier[private], parameter[operation, processedOperations]] begin[{] local_variable[type[String], simpleName] if[call[processedOperations.containsKey, parameter[member[.simpleName]]]] begin[{] return[literal[true]] else begin[{] None end[}] local_variable[type[List], conflictingOperations] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getOverrideTester, postfix_operators=[], prefix_operators=[], qualifier=candidate, selectors=[], type_arguments=None), name=overrideTester)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OverrideTester, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=isSubsignature, postfix_operators=[], prefix_operators=[], qualifier=overrideTester, selectors=[], type_arguments=None), name=checkResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IOverrideCheckResult, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getDetails, postfix_operators=[], prefix_operators=[], qualifier=checkResult, selectors=[MethodInvocation(arguments=[MemberReference(member=DEFAULT_IMPL_CONFLICT, postfix_operators=[], prefix_operators=[], qualifier=OverrideCheckDetails, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=isOverridingOrImplementing, postfix_operators=[], prefix_operators=[], qualifier=checkResult, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=conflictingOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=conflictingOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newLinkedList, postfix_operators=[], prefix_operators=[], qualifier=Lists, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=conflictingOperations, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=processedOperations, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=candidate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractResolvedOperation, sub_type=None))), label=None) if[binary_operation[member[.conflictingOperations], !=, literal[null]]] begin[{] if[binary_operation[binary_operation[call[conflictingOperations.size, parameter[]], ==, literal[1]], &&, binary_operation[call[conflictingOperations.get, parameter[literal[0]]], instanceof, type[ConflictingDefaultOperation]]]] begin[{] local_variable[type[ConflictingDefaultOperation], conflictingDefaultOperation] local_variable[type[boolean], isOverridden] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getResolvedDeclarator, postfix_operators=[], prefix_operators=[], qualifier=conflictingOp, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeclaringType, postfix_operators=[], prefix_operators=[], qualifier=operation, selectors=[], type_arguments=None)], member=isSubtypeOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isOverridden, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getConflictingOperations, postfix_operators=[], prefix_operators=[], qualifier=conflictingDefaultOperation, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=conflictingOp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IResolvedOperation, sub_type=None))), label=None) if[member[.isOverridden]] begin[{] call[conflictingDefaultOperation.getConflictingOperations, parameter[]] else begin[{] None end[}] return[literal[false]] else begin[{] None end[}] if[call[operation.isAbstract, parameter[]]] begin[{] local_variable[type[ConflictingDefaultOperation], resolvedOperation] call[resolvedOperation.getConflictingOperations, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conflictingOp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=processedOperations, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeclaration, postfix_operators=[], prefix_operators=[], qualifier=conflictingOp, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getDeclaration, postfix_operators=[], prefix_operators=[], qualifier=resolvedOperation, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getConflictingOperations, postfix_operators=[], prefix_operators=[], qualifier=resolvedOperation, selectors=[MethodInvocation(arguments=[MemberReference(member=conflictingOp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=conflictingOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=conflictingOp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractResolvedOperation, sub_type=None))), label=None) call[processedOperations.put, parameter[member[.simpleName], member[.resolvedOperation]]] else begin[{] local_variable[type[ConflictingDefaultOperation], resolvedOperation] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conflictingOp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=processedOperations, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getConflictingOperations, postfix_operators=[], prefix_operators=[], qualifier=resolvedOperation, selectors=[MethodInvocation(arguments=[MemberReference(member=conflictingOp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=conflictingOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=conflictingOp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractResolvedOperation, sub_type=None))), label=None) call[processedOperations.put, parameter[member[.simpleName], member[.resolvedOperation]]] end[}] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[handleOverridesAndConflicts] operator[SEP] identifier[JvmOperation] identifier[operation] , identifier[Multimap] operator[<] identifier[String] , identifier[AbstractResolvedOperation] operator[>] identifier[processedOperations] operator[SEP] { identifier[String] identifier[simpleName] operator[=] identifier[operation] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[processedOperations] operator[SEP] identifier[containsKey] operator[SEP] identifier[simpleName] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[List] operator[<] identifier[AbstractResolvedOperation] operator[>] identifier[conflictingOperations] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[AbstractResolvedOperation] identifier[candidate] operator[:] identifier[processedOperations] operator[SEP] identifier[get] operator[SEP] identifier[simpleName] operator[SEP] operator[SEP] { identifier[OverrideTester] identifier[overrideTester] operator[=] identifier[candidate] operator[SEP] identifier[getOverrideTester] operator[SEP] operator[SEP] operator[SEP] identifier[IOverrideCheckResult] identifier[checkResult] operator[=] identifier[overrideTester] operator[SEP] identifier[isSubsignature] operator[SEP] identifier[candidate] , identifier[operation] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[checkResult] operator[SEP] identifier[getDetails] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[OverrideCheckDetails] operator[SEP] identifier[DEFAULT_IMPL_CONFLICT] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[conflictingOperations] operator[==] Other[null] operator[SEP] identifier[conflictingOperations] operator[=] identifier[Lists] operator[SEP] identifier[newLinkedList] operator[SEP] operator[SEP] operator[SEP] identifier[conflictingOperations] operator[SEP] identifier[add] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[checkResult] operator[SEP] identifier[isOverridingOrImplementing] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[conflictingOperations] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[conflictingOperations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[conflictingOperations] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[ConflictingDefaultOperation] operator[SEP] { identifier[ConflictingDefaultOperation] identifier[conflictingDefaultOperation] operator[=] operator[SEP] identifier[ConflictingDefaultOperation] operator[SEP] identifier[conflictingOperations] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[boolean] identifier[isOverridden] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[IResolvedOperation] identifier[conflictingOp] operator[:] identifier[conflictingDefaultOperation] operator[SEP] identifier[getConflictingOperations] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[conflictingOp] operator[SEP] identifier[getResolvedDeclarator] operator[SEP] operator[SEP] operator[SEP] identifier[isSubtypeOf] operator[SEP] identifier[operation] operator[SEP] identifier[getDeclaringType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[isOverridden] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isOverridden] operator[SEP] identifier[conflictingDefaultOperation] operator[SEP] identifier[getConflictingOperations] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[createResolvedOperation] operator[SEP] identifier[operation] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[operation] operator[SEP] identifier[isAbstract] operator[SEP] operator[SEP] operator[SEP] { identifier[ConflictingDefaultOperation] identifier[resolvedOperation] operator[=] identifier[createConflictingOperation] operator[SEP] identifier[conflictingOperations] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getDeclaration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resolvedOperation] operator[SEP] identifier[getConflictingOperations] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[createResolvedOperation] operator[SEP] identifier[operation] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AbstractResolvedOperation] identifier[conflictingOp] operator[:] identifier[conflictingOperations] operator[SEP] { identifier[processedOperations] operator[SEP] identifier[remove] operator[SEP] identifier[simpleName] , identifier[conflictingOp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conflictingOp] operator[SEP] identifier[getDeclaration] operator[SEP] operator[SEP] operator[!=] identifier[resolvedOperation] operator[SEP] identifier[getDeclaration] operator[SEP] operator[SEP] operator[SEP] { identifier[resolvedOperation] operator[SEP] identifier[getConflictingOperations] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[conflictingOp] operator[SEP] operator[SEP] } } identifier[processedOperations] operator[SEP] identifier[put] operator[SEP] identifier[simpleName] , identifier[resolvedOperation] operator[SEP] operator[SEP] } Keyword[else] { identifier[ConflictingDefaultOperation] identifier[resolvedOperation] operator[=] identifier[createConflictingOperation] operator[SEP] identifier[operation] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AbstractResolvedOperation] identifier[conflictingOp] operator[:] identifier[conflictingOperations] operator[SEP] { identifier[processedOperations] operator[SEP] identifier[remove] operator[SEP] identifier[simpleName] , identifier[conflictingOp] operator[SEP] operator[SEP] identifier[resolvedOperation] operator[SEP] identifier[getConflictingOperations] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[conflictingOp] operator[SEP] operator[SEP] } identifier[processedOperations] operator[SEP] identifier[put] operator[SEP] identifier[simpleName] , identifier[resolvedOperation] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public com.google.api.ads.adwords.axis.v201809.rm.UserListClosingReason getClosingReason() { return closingReason; }
class class_name[name] begin[{] method[getClosingReason, return_type[type[com]], modifier[public], parameter[]] begin[{] return[member[.closingReason]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[rm] operator[SEP] identifier[UserListClosingReason] identifier[getClosingReason] operator[SEP] operator[SEP] { Keyword[return] identifier[closingReason] operator[SEP] }
public static void main(String... args) { if (args.length == 0 || args[0].trim().isEmpty()) { System.err.println("missing argument: loggly token\nsee http://loggly.com/docs/customer-token-authentication-token/"); System.exit(1); } final String TOKEN = args[0]; final ILogglyClient loggly = new LogglyClient(TOKEN); System.out.println("posting single event to Loggly asynchronously..."); loggly.log("Hello!\nThis is a\nmulti-line event!\n", new LogglyClient.Callback() { public void success() { System.out.println("callback succeeded"); } public void failure(String error) { System.err.println("callback failed: " + error); } }); System.out.println("posting bulk events to Loggly asynchronously..."); loggly.logBulk(Arrays.asList("E1", "E2"), new LogglyClient.Callback() { public void success() { System.out.println("bulk callback succeeded"); } public void failure(String error) { System.err.println("bulk callback failed: " + error); } }); System.out.println("posting single event to Loggly..."); boolean ok = loggly.log("Hello!\nThis is a\nmulti-line event!\n"); System.out.println(ok ? "ok" : "err"); System.out.println("posting single JSON event to Loggly..."); final String json = "{ \"timestamp\": \"2015-01-01T12:34:00Z\", \"message\": \"Event 100\", \"count\": 100 }"; ok = loggly.log(json); System.out.println(ok ? "ok" : "err"); System.out.println("posting bulk events to Loggly..."); ok = loggly.logBulk("This is a\nmulti-line event 1", "Event 2", "Event 3"); System.out.println(ok ? "ok" : "err"); System.out.println("setting log tags to 'foo', 'bar', and 'baz'..."); loggly.setTags("foo", "bar,baz"); ok = loggly.log("This should be tagged with 'foo', 'bar', and 'baz'"); System.out.println(ok ? "ok" : "err"); }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] if[binary_operation[binary_operation[member[args.length], ==, literal[0]], ||, member[.args]]] begin[{] call[System.err.println, parameter[literal["missing argument: loggly token\nsee http://loggly.com/docs/customer-token-authentication-token/"]]] call[System.exit, parameter[literal[1]]] else begin[{] None end[}] local_variable[type[String], TOKEN] local_variable[type[ILogglyClient], loggly] call[System.out.println, parameter[literal["posting single event to Loggly asynchronously..."]]] call[loggly.log, parameter[literal["Hello!\nThis is a\nmulti-line event!\n"], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="callback succeeded")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=success, parameters=[], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="callback failed: "), operandr=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=failure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=error, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LogglyClient, sub_type=ReferenceType(arguments=None, dimensions=None, name=Callback, sub_type=None)))]] call[System.out.println, parameter[literal["posting bulk events to Loggly asynchronously..."]]] call[loggly.logBulk, parameter[call[Arrays.asList, parameter[literal["E1"], literal["E2"]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bulk callback succeeded")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=success, parameters=[], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bulk callback failed: "), operandr=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=failure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=error, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LogglyClient, sub_type=ReferenceType(arguments=None, dimensions=None, name=Callback, sub_type=None)))]] call[System.out.println, parameter[literal["posting single event to Loggly..."]]] local_variable[type[boolean], ok] call[System.out.println, parameter[TernaryExpression(condition=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="err"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ok"))]] call[System.out.println, parameter[literal["posting single JSON event to Loggly..."]]] local_variable[type[String], json] assign[member[.ok], call[loggly.log, parameter[member[.json]]]] call[System.out.println, parameter[TernaryExpression(condition=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="err"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ok"))]] call[System.out.println, parameter[literal["posting bulk events to Loggly..."]]] assign[member[.ok], call[loggly.logBulk, parameter[literal["This is a\nmulti-line event 1"], literal["Event 2"], literal["Event 3"]]]] call[System.out.println, parameter[TernaryExpression(condition=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="err"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ok"))]] call[System.out.println, parameter[literal["setting log tags to 'foo', 'bar', and 'baz'..."]]] call[loggly.setTags, parameter[literal["foo"], literal["bar,baz"]]] assign[member[.ok], call[loggly.log, parameter[literal["This should be tagged with 'foo', 'bar', and 'baz'"]]]] call[System.out.println, parameter[TernaryExpression(condition=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="err"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ok"))]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[...] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[==] Other[0] operator[||] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[TOKEN] operator[=] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[final] identifier[ILogglyClient] identifier[loggly] operator[=] Keyword[new] identifier[LogglyClient] operator[SEP] identifier[TOKEN] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[loggly] operator[SEP] identifier[log] operator[SEP] literal[String] , Keyword[new] identifier[LogglyClient] operator[SEP] identifier[Callback] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[success] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[public] Keyword[void] identifier[failure] operator[SEP] identifier[String] identifier[error] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[error] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[loggly] operator[SEP] identifier[logBulk] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] literal[String] , literal[String] operator[SEP] , Keyword[new] identifier[LogglyClient] operator[SEP] identifier[Callback] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[success] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[public] Keyword[void] identifier[failure] operator[SEP] identifier[String] identifier[error] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[error] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[ok] operator[=] identifier[loggly] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[ok] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[json] operator[=] literal[String] operator[SEP] identifier[ok] operator[=] identifier[loggly] operator[SEP] identifier[log] operator[SEP] identifier[json] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[ok] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ok] operator[=] identifier[loggly] operator[SEP] identifier[logBulk] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[ok] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[loggly] operator[SEP] identifier[setTags] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[ok] operator[=] identifier[loggly] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[ok] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] }
public static SerializationContext getSerializationContext(RemoteCacheManager remoteCacheManager) { Marshaller marshaller = remoteCacheManager.getMarshaller(); if (marshaller instanceof ProtoStreamMarshaller) { return ((ProtoStreamMarshaller) marshaller).getSerializationContext(); } throw new HotRodClientException("The cache manager must be configured with a ProtoStreamMarshaller"); }
class class_name[name] begin[{] method[getSerializationContext, return_type[type[SerializationContext]], modifier[public static], parameter[remoteCacheManager]] begin[{] local_variable[type[Marshaller], marshaller] if[binary_operation[member[.marshaller], instanceof, type[ProtoStreamMarshaller]]] begin[{] return[Cast(expression=MemberReference(member=marshaller, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ProtoStreamMarshaller, sub_type=None))] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The cache manager must be configured with a ProtoStreamMarshaller")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HotRodClientException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[SerializationContext] identifier[getSerializationContext] operator[SEP] identifier[RemoteCacheManager] identifier[remoteCacheManager] operator[SEP] { identifier[Marshaller] identifier[marshaller] operator[=] identifier[remoteCacheManager] operator[SEP] identifier[getMarshaller] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[marshaller] Keyword[instanceof] identifier[ProtoStreamMarshaller] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[ProtoStreamMarshaller] operator[SEP] identifier[marshaller] operator[SEP] operator[SEP] identifier[getSerializationContext] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[HotRodClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public Set<Node> querySelectorAll(String selectors) throws NodeSelectorException { Assert.notNull(selectors, "selectors is null!"); List<List<Selector>> groups; try { Scanner scanner = new Scanner(selectors); groups = scanner.scan(); } catch (ScannerException e) { throw new NodeSelectorException(e); } Set<Node> results = new LinkedHashSet<Node>(); for (List<Selector> parts : groups) { Set<Node> result = check(parts); if (!result.isEmpty()) { results.addAll(result); } } return results; }
class class_name[name] begin[{] method[querySelectorAll, return_type[type[Set]], modifier[public], parameter[selectors]] begin[{] call[Assert.notNull, parameter[member[.selectors], literal["selectors is null!"]]] local_variable[type[List], groups] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=selectors, 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=Scanner, sub_type=None)), name=scanner)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Scanner, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=scan, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeSelectorException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ScannerException']))], finally_block=None, label=None, resources=None) local_variable[type[Set], results] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=check, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=result, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parts)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Selector, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) return[member[.results]] end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[Node] operator[>] identifier[querySelectorAll] operator[SEP] identifier[String] identifier[selectors] operator[SEP] Keyword[throws] identifier[NodeSelectorException] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[selectors] , literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[Selector] operator[>] operator[>] identifier[groups] operator[SEP] Keyword[try] { identifier[Scanner] identifier[scanner] operator[=] Keyword[new] identifier[Scanner] operator[SEP] identifier[selectors] operator[SEP] operator[SEP] identifier[groups] operator[=] identifier[scanner] operator[SEP] identifier[scan] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ScannerException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[NodeSelectorException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[Node] operator[>] identifier[results] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[Node] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[Selector] operator[>] identifier[parts] operator[:] identifier[groups] operator[SEP] { identifier[Set] operator[<] identifier[Node] operator[>] identifier[result] operator[=] identifier[check] operator[SEP] identifier[parts] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[result] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[results] operator[SEP] identifier[addAll] operator[SEP] identifier[result] operator[SEP] operator[SEP] } } Keyword[return] identifier[results] operator[SEP] }
public static Attachment writeAttachment(byte[] attachment, String title, String type) throws IOException { String name = generateAttachmentName(); String extension = getExtensionByMimeType(type); String source = name + extension; File file = new File(getResultsDirectory(), source); synchronized (ATTACHMENTS_LOCK) { if (!file.exists()) { try (FileOutputStream fos = new FileOutputStream(file)) { fos.write(attachment); } } } return new Attachment().withTitle(title).withSource(source).withType(type); }
class class_name[name] begin[{] method[writeAttachment, return_type[type[Attachment]], modifier[public static], parameter[attachment, title, type]] begin[{] local_variable[type[String], name] local_variable[type[String], extension] local_variable[type[String], source] local_variable[type[File], file] SYNCHRONIZED[member[.ATTACHMENTS_LOCK]] BEGIN[{] if[call[file.exists, parameter[]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=attachment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=fos, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fos, type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)))]) else begin[{] None end[}] END[}] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withTitle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withSource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Attachment, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Attachment] identifier[writeAttachment] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[attachment] , identifier[String] identifier[title] , identifier[String] identifier[type] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[name] operator[=] identifier[generateAttachmentName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[extension] operator[=] identifier[getExtensionByMimeType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[String] identifier[source] operator[=] identifier[name] operator[+] identifier[extension] operator[SEP] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[getResultsDirectory] operator[SEP] operator[SEP] , identifier[source] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[ATTACHMENTS_LOCK] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] operator[SEP] identifier[FileOutputStream] identifier[fos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] { identifier[fos] operator[SEP] identifier[write] operator[SEP] identifier[attachment] operator[SEP] operator[SEP] } } } Keyword[return] Keyword[new] identifier[Attachment] operator[SEP] operator[SEP] operator[SEP] identifier[withTitle] operator[SEP] identifier[title] operator[SEP] operator[SEP] identifier[withSource] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[withType] operator[SEP] identifier[type] operator[SEP] operator[SEP] }
@Override public File decrypt(final File encrypted) throws Exception { if (decryptedFile == null) { final String filename = FilenameUtils.getBaseName(encrypted.getName()); decryptedFile = newDecryptedFile(encrypted.getParent(), filename + ".decrypted"); } final FileOutputStream decryptedOut = new FileOutputStream(decryptedFile); final CryptoCipherOutputStream cos = new CryptoCipherOutputStream(decryptedOut, getModel().getCipher()); final InputStream fileInputStream = new FileInputStream(encrypted); int c; while ((c = fileInputStream.read()) != -1) { cos.write(c); } fileInputStream.close(); cos.close(); return decryptedFile; }
class class_name[name] begin[{] method[decrypt, return_type[type[File]], modifier[public], parameter[encrypted]] begin[{] if[binary_operation[member[.decryptedFile], ==, literal[null]]] begin[{] local_variable[type[String], filename] assign[member[.decryptedFile], call[.newDecryptedFile, parameter[call[encrypted.getParent, parameter[]], binary_operation[member[.filename], +, literal[".decrypted"]]]]] else begin[{] None end[}] local_variable[type[FileOutputStream], decryptedOut] local_variable[type[CryptoCipherOutputStream], cos] local_variable[type[InputStream], fileInputStream] local_variable[type[int], c] while[binary_operation[assign[member[.c], call[fileInputStream.read, parameter[]]], !=, literal[1]]] begin[{] call[cos.write, parameter[member[.c]]] end[}] call[fileInputStream.close, parameter[]] call[cos.close, parameter[]] return[member[.decryptedFile]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[File] identifier[decrypt] operator[SEP] Keyword[final] identifier[File] identifier[encrypted] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[decryptedFile] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[String] identifier[filename] operator[=] identifier[FilenameUtils] operator[SEP] identifier[getBaseName] operator[SEP] identifier[encrypted] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[decryptedFile] operator[=] identifier[newDecryptedFile] operator[SEP] identifier[encrypted] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] , identifier[filename] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[FileOutputStream] identifier[decryptedOut] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[decryptedFile] operator[SEP] operator[SEP] Keyword[final] identifier[CryptoCipherOutputStream] identifier[cos] operator[=] Keyword[new] identifier[CryptoCipherOutputStream] operator[SEP] identifier[decryptedOut] , identifier[getModel] operator[SEP] operator[SEP] operator[SEP] identifier[getCipher] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[InputStream] identifier[fileInputStream] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[encrypted] operator[SEP] operator[SEP] Keyword[int] identifier[c] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[fileInputStream] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[cos] operator[SEP] identifier[write] operator[SEP] identifier[c] operator[SEP] operator[SEP] } identifier[fileInputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[cos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[decryptedFile] operator[SEP] }
public Map<String, String> parse(Map<String, String> style) { Map<String, String> mapRtn = new HashMap<String, String>(); String align = style.get(TEXT_ALIGN); if (!ArrayUtils.contains(new String[] {LEFT, CENTER, RIGHT, JUSTIFY}, align)) { align = LEFT; } mapRtn.put(TEXT_ALIGN, align); align = style.get(VETICAL_ALIGN); if (!ArrayUtils.contains(new String[] {TOP, MIDDLE, BOTTOM}, align)) { align = MIDDLE; } mapRtn.put(VETICAL_ALIGN, align); return mapRtn; }
class class_name[name] begin[{] method[parse, return_type[type[Map]], modifier[public], parameter[style]] begin[{] local_variable[type[Map], mapRtn] local_variable[type[String], align] if[call[ArrayUtils.contains, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=LEFT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CENTER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=RIGHT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=JUSTIFY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), member[.align]]]] begin[{] assign[member[.align], member[.LEFT]] else begin[{] None end[}] call[mapRtn.put, parameter[member[.TEXT_ALIGN], member[.align]]] assign[member[.align], call[style.get, parameter[member[.VETICAL_ALIGN]]]] if[call[ArrayUtils.contains, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=TOP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIDDLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=BOTTOM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), member[.align]]]] begin[{] assign[member[.align], member[.MIDDLE]] else begin[{] None end[}] call[mapRtn.put, parameter[member[.VETICAL_ALIGN], member[.align]]] return[member[.mapRtn]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parse] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[style] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[mapRtn] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[align] operator[=] identifier[style] operator[SEP] identifier[get] operator[SEP] identifier[TEXT_ALIGN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ArrayUtils] operator[SEP] identifier[contains] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[LEFT] , identifier[CENTER] , identifier[RIGHT] , identifier[JUSTIFY] } , identifier[align] operator[SEP] operator[SEP] { identifier[align] operator[=] identifier[LEFT] operator[SEP] } identifier[mapRtn] operator[SEP] identifier[put] operator[SEP] identifier[TEXT_ALIGN] , identifier[align] operator[SEP] operator[SEP] identifier[align] operator[=] identifier[style] operator[SEP] identifier[get] operator[SEP] identifier[VETICAL_ALIGN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ArrayUtils] operator[SEP] identifier[contains] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[TOP] , identifier[MIDDLE] , identifier[BOTTOM] } , identifier[align] operator[SEP] operator[SEP] { identifier[align] operator[=] identifier[MIDDLE] operator[SEP] } identifier[mapRtn] operator[SEP] identifier[put] operator[SEP] identifier[VETICAL_ALIGN] , identifier[align] operator[SEP] operator[SEP] Keyword[return] identifier[mapRtn] operator[SEP] }
private CmsUUID maybeReplaceFormatter(CmsUUID formatterId) { if (m_customReplacements != null) { CmsUUID replacement = m_customReplacements.get(formatterId); if (replacement != null) { return replacement; } } return formatterId; }
class class_name[name] begin[{] method[maybeReplaceFormatter, return_type[type[CmsUUID]], modifier[private], parameter[formatterId]] begin[{] if[binary_operation[member[.m_customReplacements], !=, literal[null]]] begin[{] local_variable[type[CmsUUID], replacement] if[binary_operation[member[.replacement], !=, literal[null]]] begin[{] return[member[.replacement]] else begin[{] None end[}] else begin[{] None end[}] return[member[.formatterId]] end[}] END[}]
Keyword[private] identifier[CmsUUID] identifier[maybeReplaceFormatter] operator[SEP] identifier[CmsUUID] identifier[formatterId] operator[SEP] { Keyword[if] operator[SEP] identifier[m_customReplacements] operator[!=] Other[null] operator[SEP] { identifier[CmsUUID] identifier[replacement] operator[=] identifier[m_customReplacements] operator[SEP] identifier[get] operator[SEP] identifier[formatterId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[replacement] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[replacement] operator[SEP] } } Keyword[return] identifier[formatterId] operator[SEP] }
public ServiceFuture<List<P2SVpnServerConfigurationInner>> listByVirtualWanNextAsync(final String nextPageLink, final ServiceFuture<List<P2SVpnServerConfigurationInner>> serviceFuture, final ListOperationCallback<P2SVpnServerConfigurationInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByVirtualWanNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<P2SVpnServerConfigurationInner>>>>() { @Override public Observable<ServiceResponse<Page<P2SVpnServerConfigurationInner>>> call(String nextPageLink) { return listByVirtualWanNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
class class_name[name] begin[{] method[listByVirtualWanNextAsync, return_type[type[ServiceFuture]], modifier[public], parameter[nextPageLink, serviceFuture, serviceCallback]] begin[{] return[call[AzureServiceFuture.fromPageResponse, parameter[call[.listByVirtualWanNextSinglePageAsync, parameter[member[.nextPageLink]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listByVirtualWanNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=P2SVpnServerConfigurationInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=P2SVpnServerConfigurationInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None))], dimensions=None, name=Func1, sub_type=None)), member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[P2SVpnServerConfigurationInner] operator[>] operator[>] identifier[listByVirtualWanNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] , Keyword[final] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[P2SVpnServerConfigurationInner] operator[>] operator[>] identifier[serviceFuture] , Keyword[final] identifier[ListOperationCallback] operator[<] identifier[P2SVpnServerConfigurationInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[listByVirtualWanNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[P2SVpnServerConfigurationInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[P2SVpnServerConfigurationInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listByVirtualWanNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] } } , identifier[serviceCallback] operator[SEP] operator[SEP] }
protected Query[] buildPrefetchQueries(Collection owners, Collection children) { ClassDescriptor cld = getOwnerClassDescriptor(); Class topLevelClass = getBroker().getTopLevelClass(cld.getClassOfObject()); BrokerHelper helper = getBroker().serviceBrokerHelper(); Collection queries = new ArrayList(owners.size()); Collection idsSubset = new HashSet(owners.size()); Object[] fkValues; Object owner; Identity id; Iterator iter = owners.iterator(); while (iter.hasNext()) { owner = iter.next(); fkValues = helper.extractValueArray(helper.getKeyValues(cld, owner)); id = getBroker().serviceIdentity().buildIdentity(null, topLevelClass, fkValues); idsSubset.add(id); if (idsSubset.size() == pkLimit) { queries.add(buildPrefetchQuery(idsSubset)); idsSubset.clear(); } } if (idsSubset.size() > 0) { queries.add(buildPrefetchQuery(idsSubset)); } return (Query[]) queries.toArray(new Query[queries.size()]); }
class class_name[name] begin[{] method[buildPrefetchQueries, return_type[type[Query]], modifier[protected], parameter[owners, children]] begin[{] local_variable[type[ClassDescriptor], cld] local_variable[type[Class], topLevelClass] local_variable[type[BrokerHelper], helper] local_variable[type[Collection], queries] local_variable[type[Collection], idsSubset] local_variable[type[Object], fkValues] local_variable[type[Object], owner] local_variable[type[Identity], id] local_variable[type[Iterator], iter] while[call[iter.hasNext, parameter[]]] begin[{] assign[member[.owner], call[iter.next, parameter[]]] assign[member[.fkValues], call[helper.extractValueArray, parameter[call[helper.getKeyValues, parameter[member[.cld], member[.owner]]]]]] assign[member[.id], call[.getBroker, parameter[]]] call[idsSubset.add, parameter[member[.id]]] if[binary_operation[call[idsSubset.size, parameter[]], ==, member[.pkLimit]]] begin[{] call[queries.add, parameter[call[.buildPrefetchQuery, parameter[member[.idsSubset]]]]] call[idsSubset.clear, parameter[]] else begin[{] None end[}] end[}] if[binary_operation[call[idsSubset.size, parameter[]], >, literal[0]]] begin[{] call[queries.add, parameter[call[.buildPrefetchQuery, parameter[member[.idsSubset]]]]] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=queries, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Query, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=queries, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=Query, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[Query] operator[SEP] operator[SEP] identifier[buildPrefetchQueries] operator[SEP] identifier[Collection] identifier[owners] , identifier[Collection] identifier[children] operator[SEP] { identifier[ClassDescriptor] identifier[cld] operator[=] identifier[getOwnerClassDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[topLevelClass] operator[=] identifier[getBroker] operator[SEP] operator[SEP] operator[SEP] identifier[getTopLevelClass] operator[SEP] identifier[cld] operator[SEP] identifier[getClassOfObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BrokerHelper] identifier[helper] operator[=] identifier[getBroker] operator[SEP] operator[SEP] operator[SEP] identifier[serviceBrokerHelper] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] identifier[queries] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] identifier[owners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] identifier[idsSubset] operator[=] Keyword[new] identifier[HashSet] operator[SEP] identifier[owners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[fkValues] operator[SEP] identifier[Object] identifier[owner] operator[SEP] identifier[Identity] identifier[id] operator[SEP] identifier[Iterator] identifier[iter] operator[=] identifier[owners] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[owner] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[fkValues] operator[=] identifier[helper] operator[SEP] identifier[extractValueArray] operator[SEP] identifier[helper] operator[SEP] identifier[getKeyValues] operator[SEP] identifier[cld] , identifier[owner] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[=] identifier[getBroker] operator[SEP] operator[SEP] operator[SEP] identifier[serviceIdentity] operator[SEP] operator[SEP] operator[SEP] identifier[buildIdentity] operator[SEP] Other[null] , identifier[topLevelClass] , identifier[fkValues] operator[SEP] operator[SEP] identifier[idsSubset] operator[SEP] identifier[add] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idsSubset] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[pkLimit] operator[SEP] { identifier[queries] operator[SEP] identifier[add] operator[SEP] identifier[buildPrefetchQuery] operator[SEP] identifier[idsSubset] operator[SEP] operator[SEP] operator[SEP] identifier[idsSubset] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[idsSubset] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[queries] operator[SEP] identifier[add] operator[SEP] identifier[buildPrefetchQuery] operator[SEP] identifier[idsSubset] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[Query] operator[SEP] operator[SEP] operator[SEP] identifier[queries] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Query] operator[SEP] identifier[queries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public EClass getIfcCompressorType() { if (ifcCompressorTypeEClass == null) { ifcCompressorTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(116); } return ifcCompressorTypeEClass; }
class class_name[name] begin[{] method[getIfcCompressorType, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcCompressorTypeEClass], ==, literal[null]]] begin[{] assign[member[.ifcCompressorTypeEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=116)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcCompressorTypeEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcCompressorType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcCompressorTypeEClass] operator[==] Other[null] operator[SEP] { identifier[ifcCompressorTypeEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[116] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcCompressorTypeEClass] operator[SEP] }
public Observable<Object> addTermAsync(String listId, String term, String language) { return addTermWithServiceResponseAsync(listId, term, language).map(new Func1<ServiceResponse<Object>, Object>() { @Override public Object call(ServiceResponse<Object> response) { return response.body(); } }); }
class class_name[name] begin[{] method[addTermAsync, return_type[type[Observable]], modifier[public], parameter[listId, term, language]] begin[{] return[call[.addTermWithServiceResponseAsync, parameter[member[.listId], member[.term], member[.language]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Object] operator[>] identifier[addTermAsync] operator[SEP] identifier[String] identifier[listId] , identifier[String] identifier[term] , identifier[String] identifier[language] operator[SEP] { Keyword[return] identifier[addTermWithServiceResponseAsync] operator[SEP] identifier[listId] , identifier[term] , identifier[language] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Object] operator[>] , identifier[Object] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Object] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@Handler public void onConfigurationUpdate(ConfigurationUpdate event) { event.values(componentPath()).ifPresent(values -> { Optional.ofNullable(values.get("bufferSize")).ifPresent( value -> setBufferSize(Integer.parseInt(value))); }); }
class class_name[name] begin[{] method[onConfigurationUpdate, return_type[void], modifier[public], parameter[event]] begin[{] call[event.values, parameter[call[.componentPath, parameter[]]]] end[}] END[}]
annotation[@] identifier[Handler] Keyword[public] Keyword[void] identifier[onConfigurationUpdate] operator[SEP] identifier[ConfigurationUpdate] identifier[event] operator[SEP] { identifier[event] operator[SEP] identifier[values] operator[SEP] identifier[componentPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[values] operator[->] { identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[values] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[value] operator[->] identifier[setBufferSize] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
public XFeatureCall createReferenceToThis() { final XExpression expr = getXExpression(); XtendTypeDeclaration type = EcoreUtil2.getContainerOfType(expr, XtendTypeDeclaration.class); JvmType jvmObject = getAssociatedElement(JvmType.class, type, expr.eResource()); final XFeatureCall thisFeature = XbaseFactory.eINSTANCE.createXFeatureCall(); thisFeature.setFeature(jvmObject); return thisFeature; }
class class_name[name] begin[{] method[createReferenceToThis, return_type[type[XFeatureCall]], modifier[public], parameter[]] begin[{] local_variable[type[XExpression], expr] local_variable[type[XtendTypeDeclaration], type] local_variable[type[JvmType], jvmObject] local_variable[type[XFeatureCall], thisFeature] call[thisFeature.setFeature, parameter[member[.jvmObject]]] return[member[.thisFeature]] end[}] END[}]
Keyword[public] identifier[XFeatureCall] identifier[createReferenceToThis] operator[SEP] operator[SEP] { Keyword[final] identifier[XExpression] identifier[expr] operator[=] identifier[getXExpression] operator[SEP] operator[SEP] operator[SEP] identifier[XtendTypeDeclaration] identifier[type] operator[=] identifier[EcoreUtil2] operator[SEP] identifier[getContainerOfType] operator[SEP] identifier[expr] , identifier[XtendTypeDeclaration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[JvmType] identifier[jvmObject] operator[=] identifier[getAssociatedElement] operator[SEP] identifier[JvmType] operator[SEP] Keyword[class] , identifier[type] , identifier[expr] operator[SEP] identifier[eResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[XFeatureCall] identifier[thisFeature] operator[=] identifier[XbaseFactory] operator[SEP] identifier[eINSTANCE] operator[SEP] identifier[createXFeatureCall] operator[SEP] operator[SEP] operator[SEP] identifier[thisFeature] operator[SEP] identifier[setFeature] operator[SEP] identifier[jvmObject] operator[SEP] operator[SEP] Keyword[return] identifier[thisFeature] operator[SEP] }
public void addGetTimeNano(long duration) { if (unsupportCacheGetTotalTime.get() <= Long.MAX_VALUE - duration) { unsupportCacheGetTotalTime.addAndGet(duration); } else { //counter full. Just reset. clear(); unsupportCacheGetTotalTime.set(duration); } }
class class_name[name] begin[{] method[addGetTimeNano, return_type[void], modifier[public], parameter[duration]] begin[{] if[binary_operation[call[unsupportCacheGetTotalTime.get, parameter[]], <=, binary_operation[member[Long.MAX_VALUE], -, member[.duration]]]] begin[{] call[unsupportCacheGetTotalTime.addAndGet, parameter[member[.duration]]] else begin[{] call[.clear, parameter[]] call[unsupportCacheGetTotalTime.set, parameter[member[.duration]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addGetTimeNano] operator[SEP] Keyword[long] identifier[duration] operator[SEP] { Keyword[if] operator[SEP] identifier[unsupportCacheGetTotalTime] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[<=] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[-] identifier[duration] operator[SEP] { identifier[unsupportCacheGetTotalTime] operator[SEP] identifier[addAndGet] operator[SEP] identifier[duration] operator[SEP] operator[SEP] } Keyword[else] { identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[unsupportCacheGetTotalTime] operator[SEP] identifier[set] operator[SEP] identifier[duration] operator[SEP] operator[SEP] } }
public static Dependencies load(final File file) { Utils4J.checkNotNull("file", file); Utils4J.checkValidFile(file); try { final InputStream inputStream = new BufferedInputStream(new FileInputStream(file)); try { return load(inputStream); } finally { inputStream.close(); } } catch (final IOException ex) { throw new RuntimeException(ex); } }
class class_name[name] begin[{] method[load, return_type[type[Dependencies]], modifier[public static], parameter[file]] begin[{] call[Utils4J.checkNotNull, parameter[literal["file"], member[.file]]] call[Utils4J.checkValidFile, parameter[member[.file]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None)), name=inputStream)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=inputStream, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Dependencies] identifier[load] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[SEP] { identifier[Utils4J] operator[SEP] identifier[checkNotNull] operator[SEP] literal[String] , identifier[file] operator[SEP] operator[SEP] identifier[Utils4J] operator[SEP] identifier[checkValidFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[InputStream] identifier[inputStream] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[load] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] } Keyword[finally] { identifier[inputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public void marshall(Deinterlacer deinterlacer, ProtocolMarshaller protocolMarshaller) { if (deinterlacer == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deinterlacer.getAlgorithm(), ALGORITHM_BINDING); protocolMarshaller.marshall(deinterlacer.getControl(), CONTROL_BINDING); protocolMarshaller.marshall(deinterlacer.getMode(), MODE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[deinterlacer, protocolMarshaller]] begin[{] if[binary_operation[member[.deinterlacer], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=deinterlacer, selectors=[], type_arguments=None), MemberReference(member=ALGORITHM_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getControl, postfix_operators=[], prefix_operators=[], qualifier=deinterlacer, selectors=[], type_arguments=None), MemberReference(member=CONTROL_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMode, postfix_operators=[], prefix_operators=[], qualifier=deinterlacer, selectors=[], type_arguments=None), MemberReference(member=MODE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[Deinterlacer] identifier[deinterlacer] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[deinterlacer] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deinterlacer] operator[SEP] identifier[getAlgorithm] operator[SEP] operator[SEP] , identifier[ALGORITHM_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deinterlacer] operator[SEP] identifier[getControl] operator[SEP] operator[SEP] , identifier[CONTROL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deinterlacer] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] , identifier[MODE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static byte[] getGuidAsByteArray(final String GUID) { final UUID uuid = UUID.fromString(GUID); final ByteBuffer buff = ByteBuffer.wrap(new byte[16]); buff.putLong(uuid.getMostSignificantBits()); buff.putLong(uuid.getLeastSignificantBits()); byte[] res = new byte[] { buff.get(3), buff.get(2), buff.get(1), buff.get(0), buff.get(5), buff.get(4), buff.get(7), buff.get(6), buff.get(8), buff.get(9), buff.get(10), buff.get(11), buff.get(12), buff.get(13), buff.get(14), buff.get(15), }; return res; }
class class_name[name] begin[{] method[getGuidAsByteArray, return_type[type[byte]], modifier[public static], parameter[GUID]] begin[{] local_variable[type[UUID], uuid] local_variable[type[ByteBuffer], buff] call[buff.putLong, parameter[call[uuid.getMostSignificantBits, parameter[]]]] call[buff.putLong, parameter[call[uuid.getLeastSignificantBits, parameter[]]]] local_variable[type[byte], res] return[member[.res]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[getGuidAsByteArray] operator[SEP] Keyword[final] identifier[String] identifier[GUID] operator[SEP] { Keyword[final] identifier[UUID] identifier[uuid] operator[=] identifier[UUID] operator[SEP] identifier[fromString] operator[SEP] identifier[GUID] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[buff] operator[=] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] Keyword[new] Keyword[byte] operator[SEP] Other[16] operator[SEP] operator[SEP] operator[SEP] identifier[buff] operator[SEP] identifier[putLong] operator[SEP] identifier[uuid] operator[SEP] identifier[getMostSignificantBits] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buff] operator[SEP] identifier[putLong] operator[SEP] identifier[uuid] operator[SEP] identifier[getLeastSignificantBits] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[res] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] { identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[3] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[2] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[5] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[4] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[7] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[6] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[8] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[9] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[10] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[11] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[12] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[13] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[14] operator[SEP] , identifier[buff] operator[SEP] identifier[get] operator[SEP] Other[15] operator[SEP] , } operator[SEP] Keyword[return] identifier[res] operator[SEP] }
@BetaApi public final Operation insertTargetHttpProxy( String project, TargetHttpProxy targetHttpProxyResource) { InsertTargetHttpProxyHttpRequest request = InsertTargetHttpProxyHttpRequest.newBuilder() .setProject(project) .setTargetHttpProxyResource(targetHttpProxyResource) .build(); return insertTargetHttpProxy(request); }
class class_name[name] begin[{] method[insertTargetHttpProxy, return_type[type[Operation]], modifier[final public], parameter[project, targetHttpProxyResource]] begin[{] local_variable[type[InsertTargetHttpProxyHttpRequest], request] return[call[.insertTargetHttpProxy, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[insertTargetHttpProxy] operator[SEP] identifier[String] identifier[project] , identifier[TargetHttpProxy] identifier[targetHttpProxyResource] operator[SEP] { identifier[InsertTargetHttpProxyHttpRequest] identifier[request] operator[=] identifier[InsertTargetHttpProxyHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setProject] operator[SEP] identifier[project] operator[SEP] operator[SEP] identifier[setTargetHttpProxyResource] operator[SEP] identifier[targetHttpProxyResource] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[insertTargetHttpProxy] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public final void mT__67() throws RecognitionException { try { int _type = T__67; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalPureXbase.g:65:7: ( 'while' ) // InternalPureXbase.g:65:9: 'while' { match("while"); } state.type = _type; state.channel = _channel; } finally { } }
class class_name[name] begin[{] method[mT__67, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=T__67, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="while")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[mT__67] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { Keyword[int] identifier[_type] operator[=] identifier[T__67] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP] } Keyword[finally] { } }
protected void count_and_yield(boolean moreExpected) throws SAXException { if(!moreExpected) eventcounter=0; if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } }
class class_name[name] begin[{] method[count_and_yield, return_type[void], modifier[protected], parameter[moreExpected]] begin[{] if[member[.moreExpected]] begin[{] assign[member[.eventcounter], literal[0]] else begin[{] None end[}] if[binary_operation[member[.eventcounter], <=, literal[0]]] begin[{] call[.co_yield, parameter[literal[true]]] assign[member[.eventcounter], member[.frequency]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[count_and_yield] operator[SEP] Keyword[boolean] identifier[moreExpected] operator[SEP] Keyword[throws] identifier[SAXException] { Keyword[if] operator[SEP] operator[!] identifier[moreExpected] operator[SEP] identifier[eventcounter] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[--] identifier[eventcounter] operator[<=] Other[0] operator[SEP] { identifier[co_yield] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[eventcounter] operator[=] identifier[frequency] operator[SEP] } }