code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public static void close (Reader in)
{
if (in != null) {
try {
in.close();
} catch (IOException ioe) {
log.warning("Error closing reader", "reader", in, "cause", ioe);
}
}
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public static], parameter[in]] begin[{]
if[binary_operation[member[.in], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error closing reader"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="reader"), MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cause"), MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warning, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[close] operator[SEP] identifier[Reader] identifier[in] operator[SEP] {
Keyword[if] operator[SEP] identifier[in] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] {
identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] , literal[String] , identifier[in] , literal[String] , identifier[ioe] operator[SEP] operator[SEP]
}
}
}
|
public Object handleParameterException(ParameterException pe, String[] args) {
printErrorMessage(String.format("args: %s%n%s", Arrays.toString(args), pe.getMessage()));
printHelpMessage(pe.getCommandLine());
return 1;
} | class class_name[name] begin[{]
method[handleParameterException, return_type[type[Object]], modifier[public], parameter[pe, args]] begin[{]
call[.printErrorMessage, parameter[call[String.format, parameter[literal["args: %s%n%s"], call[Arrays.toString, parameter[member[.args]]], call[pe.getMessage, parameter[]]]]]]
call[.printHelpMessage, parameter[call[pe.getCommandLine, parameter[]]]]
return[literal[1]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[handleParameterException] operator[SEP] identifier[ParameterException] identifier[pe] , identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] {
identifier[printErrorMessage] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[args] operator[SEP] , identifier[pe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[printHelpMessage] operator[SEP] identifier[pe] operator[SEP] identifier[getCommandLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[1] operator[SEP]
}
|
private double toPerPartitionMaxSize(int maxConfiguredSize, String mapName) {
int memberCount = clusterService.getSize(DATA_MEMBER_SELECTOR);
double translatedPartitionSize = (1D * maxConfiguredSize * memberCount / partitionCount);
if (translatedPartitionSize < 1) {
translatedPartitionSize = MIN_TRANSLATED_PARTITION_SIZE;
logMisconfiguredPerNodeMaxSize(mapName, memberCount);
}
return translatedPartitionSize;
} | class class_name[name] begin[{]
method[toPerPartitionMaxSize, return_type[type[double]], modifier[private], parameter[maxConfiguredSize, mapName]] begin[{]
local_variable[type[int], memberCount]
local_variable[type[double], translatedPartitionSize]
if[binary_operation[member[.translatedPartitionSize], <, literal[1]]] begin[{]
assign[member[.translatedPartitionSize], member[.MIN_TRANSLATED_PARTITION_SIZE]]
call[.logMisconfiguredPerNodeMaxSize, parameter[member[.mapName], member[.memberCount]]]
else begin[{]
None
end[}]
return[member[.translatedPartitionSize]]
end[}]
END[}] | Keyword[private] Keyword[double] identifier[toPerPartitionMaxSize] operator[SEP] Keyword[int] identifier[maxConfiguredSize] , identifier[String] identifier[mapName] operator[SEP] {
Keyword[int] identifier[memberCount] operator[=] identifier[clusterService] operator[SEP] identifier[getSize] operator[SEP] identifier[DATA_MEMBER_SELECTOR] operator[SEP] operator[SEP] Keyword[double] identifier[translatedPartitionSize] operator[=] operator[SEP] literal[Float] operator[*] identifier[maxConfiguredSize] operator[*] identifier[memberCount] operator[/] identifier[partitionCount] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[translatedPartitionSize] operator[<] Other[1] operator[SEP] {
identifier[translatedPartitionSize] operator[=] identifier[MIN_TRANSLATED_PARTITION_SIZE] operator[SEP] identifier[logMisconfiguredPerNodeMaxSize] operator[SEP] identifier[mapName] , identifier[memberCount] operator[SEP] operator[SEP]
}
Keyword[return] identifier[translatedPartitionSize] operator[SEP]
}
|
private static void configureDaylight(IAtomContainer container, int[][] graph, EdgeToBondMap bondMap,
boolean ringInfo) {
int nAtoms = container.getAtomCount();
int[] ringNumber = new int[nAtoms];
int[] ringSize = new int[nAtoms];
Arrays.fill(ringSize, nAtoms + 1);
if (ringInfo) {
// non-unique but used by daylight
for (int[] cycle : Cycles.sssr(container).paths()) {
int size = cycle.length - 1;
for (int i = 1; i < cycle.length; i++) {
int v = cycle[i];
if (size < ringSize[v]) ringSize[v] = size;
ringNumber[v]++;
bondMap.get(cycle[i], cycle[i - 1]).setFlag(CDKConstants.ISINRING, true);
}
}
} else {
// ring membership is super cheap
for (IBond bond : new RingSearch(container, graph).ringFragments().bonds()) {
bond.setFlag(CDKConstants.ISINRING, true);
}
}
for (int v = 0; v < nAtoms; v++) {
IAtom atom = container.getAtom(v);
int implHCount = checkNotNull(atom.getImplicitHydrogenCount(), "Implicit hydrogen count was not set.");
int totalHCount = implHCount;
int valence = implHCount;
int degree = 0;
int ringConnections = 0;
// traverse bonds
for (int w : graph[v]) {
IBond bond = bondMap.get(v, w);
IBond.Order order = bond.getOrder();
if (order == null || order == IBond.Order.UNSET)
throw new NullPointerException("Bond order was not set.");
valence += order.numeric();
degree++;
if (bond.getFlag(CDKConstants.ISINRING)) {
ringConnections++;
}
if (container.getAtom(w).getAtomicNumber() == 1) {
totalHCount++;
}
}
SMARTSAtomInvariants inv = new SMARTSAtomInvariants(container, valence, ringNumber[v],
ringSize[v] <= nAtoms ? Collections.singleton(ringSize[v]) : Collections.<Integer> emptySet(),
ringConnections, degree, degree + implHCount, totalHCount);
// if there was no properties a default size LinkedHashMap is created
// automatically
atom.setProperty(SMARTSAtomInvariants.KEY, inv);
}
} | class class_name[name] begin[{]
method[configureDaylight, return_type[void], modifier[private static], parameter[container, graph, bondMap, ringInfo]] begin[{]
local_variable[type[int], nAtoms]
local_variable[type[int], ringNumber]
local_variable[type[int], ringSize]
call[Arrays.fill, parameter[member[.ringSize], binary_operation[member[.nAtoms], +, literal[1]]]]
if[member[.ringInfo]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cycle, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=cycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=v)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ringSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ringSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), StatementExpression(expression=MemberReference(member=ringNumber, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=cycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=bondMap, selectors=[MethodInvocation(arguments=[MemberReference(member=ISINRING, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setFlag, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cycle, 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)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sssr, postfix_operators=[], prefix_operators=[], qualifier=Cycles, selectors=[MethodInvocation(arguments=[], member=paths, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cycle)], modifiers=set(), type=BasicType(dimensions=[None], name=int))), label=None)
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ISINRING, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setFlag, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=ClassCreator(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=graph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=ringFragments, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=bonds, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=RingSearch, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))), label=None)
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getImplicitHydrogenCount, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Implicit hydrogen count was not set.")], member=checkNotNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=implHCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=implHCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=totalHCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=implHCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=valence)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=degree)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ringConnections)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=bondMap, selectors=[], type_arguments=None), name=bond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), name=order)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=ReferenceType(arguments=None, dimensions=None, name=Order, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=order, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=order, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=UNSET, postfix_operators=[], prefix_operators=[], qualifier=IBond.Order, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bond order was not set.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=valence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=numeric, postfix_operators=[], prefix_operators=[], qualifier=order, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=degree, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ISINRING, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[])], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=ringConnections, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[MethodInvocation(arguments=[], member=getAtomicNumber, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=totalHCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=graph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=w)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ringNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ringSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=nAtoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), if_false=MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]), if_true=MethodInvocation(arguments=[MemberReference(member=ringSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=singleton, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)), MemberReference(member=ringConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=degree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=degree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=implHCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=totalHCount, 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=SMARTSAtomInvariants, sub_type=None)), name=inv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SMARTSAtomInvariants, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=KEY, postfix_operators=[], prefix_operators=[], qualifier=SMARTSAtomInvariants, selectors=[]), MemberReference(member=inv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nAtoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=v)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=v, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[configureDaylight] operator[SEP] identifier[IAtomContainer] identifier[container] , Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[graph] , identifier[EdgeToBondMap] identifier[bondMap] , Keyword[boolean] identifier[ringInfo] operator[SEP] {
Keyword[int] identifier[nAtoms] operator[=] identifier[container] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[ringNumber] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[nAtoms] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[ringSize] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[nAtoms] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[ringSize] , identifier[nAtoms] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ringInfo] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[cycle] operator[:] identifier[Cycles] operator[SEP] identifier[sssr] operator[SEP] identifier[container] operator[SEP] operator[SEP] identifier[paths] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[size] operator[=] identifier[cycle] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[cycle] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[v] operator[=] identifier[cycle] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[<] identifier[ringSize] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[ringSize] operator[SEP] identifier[v] operator[SEP] operator[=] identifier[size] operator[SEP] identifier[ringNumber] operator[SEP] identifier[v] operator[SEP] operator[++] operator[SEP] identifier[bondMap] operator[SEP] identifier[get] operator[SEP] identifier[cycle] operator[SEP] identifier[i] operator[SEP] , identifier[cycle] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[setFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[ISINRING] , literal[boolean] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[IBond] identifier[bond] operator[:] Keyword[new] identifier[RingSearch] operator[SEP] identifier[container] , identifier[graph] operator[SEP] operator[SEP] identifier[ringFragments] operator[SEP] operator[SEP] operator[SEP] identifier[bonds] operator[SEP] operator[SEP] operator[SEP] {
identifier[bond] operator[SEP] identifier[setFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[ISINRING] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[v] operator[=] Other[0] operator[SEP] identifier[v] operator[<] identifier[nAtoms] operator[SEP] identifier[v] operator[++] operator[SEP] {
identifier[IAtom] identifier[atom] operator[=] identifier[container] operator[SEP] identifier[getAtom] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[int] identifier[implHCount] operator[=] identifier[checkNotNull] operator[SEP] identifier[atom] operator[SEP] identifier[getImplicitHydrogenCount] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[totalHCount] operator[=] identifier[implHCount] operator[SEP] Keyword[int] identifier[valence] operator[=] identifier[implHCount] operator[SEP] Keyword[int] identifier[degree] operator[=] Other[0] operator[SEP] Keyword[int] identifier[ringConnections] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[w] operator[:] identifier[graph] operator[SEP] identifier[v] operator[SEP] operator[SEP] {
identifier[IBond] identifier[bond] operator[=] identifier[bondMap] operator[SEP] identifier[get] operator[SEP] identifier[v] , identifier[w] operator[SEP] operator[SEP] identifier[IBond] operator[SEP] identifier[Order] identifier[order] operator[=] identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[order] operator[==] Other[null] operator[||] identifier[order] operator[==] identifier[IBond] operator[SEP] identifier[Order] operator[SEP] identifier[UNSET] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[valence] operator[+=] identifier[order] operator[SEP] identifier[numeric] operator[SEP] operator[SEP] operator[SEP] identifier[degree] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[bond] operator[SEP] identifier[getFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[ISINRING] operator[SEP] operator[SEP] {
identifier[ringConnections] operator[++] operator[SEP]
}
Keyword[if] operator[SEP] identifier[container] operator[SEP] identifier[getAtom] operator[SEP] identifier[w] operator[SEP] operator[SEP] identifier[getAtomicNumber] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[totalHCount] operator[++] operator[SEP]
}
}
identifier[SMARTSAtomInvariants] identifier[inv] operator[=] Keyword[new] identifier[SMARTSAtomInvariants] operator[SEP] identifier[container] , identifier[valence] , identifier[ringNumber] operator[SEP] identifier[v] operator[SEP] , identifier[ringSize] operator[SEP] identifier[v] operator[SEP] operator[<=] identifier[nAtoms] operator[?] identifier[Collections] operator[SEP] identifier[singleton] operator[SEP] identifier[ringSize] operator[SEP] identifier[v] operator[SEP] operator[SEP] operator[:] identifier[Collections] operator[SEP] operator[<] identifier[Integer] operator[>] identifier[emptySet] operator[SEP] operator[SEP] , identifier[ringConnections] , identifier[degree] , identifier[degree] operator[+] identifier[implHCount] , identifier[totalHCount] operator[SEP] operator[SEP] identifier[atom] operator[SEP] identifier[setProperty] operator[SEP] identifier[SMARTSAtomInvariants] operator[SEP] identifier[KEY] , identifier[inv] operator[SEP] operator[SEP]
}
}
|
private void setSiteFilters(String filters) {
this.filterSites = new HashSet<>();
if (!"-".equals(filters)) {
Collections.addAll(this.filterSites, filters.split(","));
}
} | class class_name[name] begin[{]
method[setSiteFilters, return_type[void], modifier[private], parameter[filters]] begin[{]
assign[THIS[member[None.filterSites]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))]
if[literal["-"]] begin[{]
call[Collections.addAll, parameter[THIS[member[None.filterSites]], call[filters.split, parameter[literal[","]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[setSiteFilters] operator[SEP] identifier[String] identifier[filters] operator[SEP] {
Keyword[this] operator[SEP] identifier[filterSites] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[filters] operator[SEP] operator[SEP] {
identifier[Collections] operator[SEP] identifier[addAll] operator[SEP] Keyword[this] operator[SEP] identifier[filterSites] , identifier[filters] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void updateObservedReplicaTimestamps(VectorClock receivedVectorClock) {
for (; ; ) {
final VectorClock currentClock = this.observedClock;
if (currentClock != null && currentClock.isAfter(receivedVectorClock)) {
break;
}
if (OBSERVED_TIMESTAMPS_UPDATER.compareAndSet(this, currentClock, receivedVectorClock)) {
break;
}
}
} | class class_name[name] begin[{]
method[updateObservedReplicaTimestamps, return_type[void], modifier[private], parameter[receivedVectorClock]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=observedClock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), name=currentClock)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=VectorClock, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=currentClock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=receivedVectorClock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAfter, postfix_operators=[], prefix_operators=[], qualifier=currentClock, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=currentClock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=receivedVectorClock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareAndSet, postfix_operators=[], prefix_operators=[], qualifier=OBSERVED_TIMESTAMPS_UPDATER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=None, init=None, update=None), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateObservedReplicaTimestamps] operator[SEP] identifier[VectorClock] identifier[receivedVectorClock] operator[SEP] {
Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[VectorClock] identifier[currentClock] operator[=] Keyword[this] operator[SEP] identifier[observedClock] operator[SEP] Keyword[if] operator[SEP] identifier[currentClock] operator[!=] Other[null] operator[&&] identifier[currentClock] operator[SEP] identifier[isAfter] operator[SEP] identifier[receivedVectorClock] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[OBSERVED_TIMESTAMPS_UPDATER] operator[SEP] identifier[compareAndSet] operator[SEP] Keyword[this] , identifier[currentClock] , identifier[receivedVectorClock] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
}
}
|
public java.util.List<String> getCurrentShardLevelMetrics() {
if (currentShardLevelMetrics == null) {
currentShardLevelMetrics = new com.amazonaws.internal.SdkInternalList<String>();
}
return currentShardLevelMetrics;
} | class class_name[name] begin[{]
method[getCurrentShardLevelMetrics, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.currentShardLevelMetrics], ==, literal[null]]] begin[{]
assign[member[.currentShardLevelMetrics], 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=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.currentShardLevelMetrics]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getCurrentShardLevelMetrics] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentShardLevelMetrics] operator[==] Other[null] operator[SEP] {
identifier[currentShardLevelMetrics] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[currentShardLevelMetrics] operator[SEP]
}
|
public String getLastLine(String backText) {
BufferedReader breader = new BufferedReader(new StringReader(backText));
String last = "";
String line = null;
try {
while ((line = breader.readLine()) != null) {
// only if the line has text do we set last to it
if (line.length() > 0) {
last = line;
}
}
} catch (IOException e) {
DroolsEclipsePlugin.log(e);
}
// now that all the conditions for a single object are on the same line
// we need to check for the left parenthesis
if (last.indexOf("(") > -1) {
last = last.substring(last.lastIndexOf("(") + 1);
}
// if the string has a comma "," we get the substring starting from
// the index after the last comma
if (last.indexOf(",") > -1) {
last = last.substring(last.lastIndexOf(",") + 1);
}
// if the line ends with right parenthesis, we change it to zero length
// string
if (last.endsWith(")")) {
last = "";
}
return last;
} | class class_name[name] begin[{]
method[getLastLine, return_type[type[String]], modifier[public], parameter[backText]] begin[{]
local_variable[type[BufferedReader], breader]
local_variable[type[String], last]
local_variable[type[String], line]
TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=breader, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=DroolsEclipsePlugin, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
if[binary_operation[call[last.indexOf, parameter[literal["("]]], >, literal[1]]] begin[{]
assign[member[.last], call[last.substring, parameter[binary_operation[call[last.lastIndexOf, parameter[literal["("]]], +, literal[1]]]]]
else begin[{]
None
end[}]
if[binary_operation[call[last.indexOf, parameter[literal[","]]], >, literal[1]]] begin[{]
assign[member[.last], call[last.substring, parameter[binary_operation[call[last.lastIndexOf, parameter[literal[","]]], +, literal[1]]]]]
else begin[{]
None
end[}]
if[call[last.endsWith, parameter[literal[")"]]]] begin[{]
assign[member[.last], literal[""]]
else begin[{]
None
end[}]
return[member[.last]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getLastLine] operator[SEP] identifier[String] identifier[backText] operator[SEP] {
identifier[BufferedReader] identifier[breader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[backText] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[last] operator[=] literal[String] operator[SEP] identifier[String] identifier[line] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[breader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[last] operator[=] identifier[line] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[DroolsEclipsePlugin] operator[SEP] identifier[log] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[last] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[last] operator[=] identifier[last] operator[SEP] identifier[substring] operator[SEP] identifier[last] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[last] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[last] operator[=] identifier[last] operator[SEP] identifier[substring] operator[SEP] identifier[last] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[last] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[last] operator[=] literal[String] operator[SEP]
}
Keyword[return] identifier[last] operator[SEP]
}
|
@Nonnull
public static <T1, T2, T3> LToIntTriFunctionBuilder<T1, T2, T3> toIntTriFunction() {
return new LToIntTriFunctionBuilder();
} | class class_name[name] begin[{]
method[toIntTriFunction, return_type[type[LToIntTriFunctionBuilder]], modifier[public static], parameter[]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LToIntTriFunctionBuilder, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[LToIntTriFunctionBuilder] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[toIntTriFunction] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[LToIntTriFunctionBuilder] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Nd4jEnvironment getEnvironment() {
Properties envInfo = Nd4j.getExecutioner().getEnvironmentInformation();
Nd4jEnvironment ret = Nd4jEnvironment.builder().numCores(getIntOrZero(CPU_CORES_KEY, envInfo))
.ram(getLongOrZero(HOST_TOTAL_MEMORY_KEY, envInfo)).os(envInfo.get(OS_KEY).toString())
.blasVendor(envInfo.get(BLAS_VENDOR_KEY).toString())
.blasThreads(getLongOrZero(BLAS_THREADS_KEY, envInfo))
.ompThreads(getIntOrZero(OMP_THREADS_KEY, envInfo))
.numGpus(getIntOrZero(CUDA_NUM_GPUS_KEY, envInfo)).build();
if (envInfo.containsKey(CUDA_DEVICE_INFORMATION_KEY)) {
List<Map<String, Object>> deviceInfo = (List<Map<String, Object>>) envInfo.get(CUDA_DEVICE_INFORMATION_KEY);
List<Long> gpuRam = new ArrayList<>();
for (Map<String, Object> info : deviceInfo) {
gpuRam.add(Long.parseLong(info.get(Nd4jEnvironment.CUDA_TOTAL_MEMORY_KEY).toString()));
}
ret.setGpuRam(gpuRam);
}
return ret;
} | class class_name[name] begin[{]
method[getEnvironment, return_type[type[Nd4jEnvironment]], modifier[public static], parameter[]] begin[{]
local_variable[type[Properties], envInfo]
local_variable[type[Nd4jEnvironment], ret]
if[call[envInfo.containsKey, parameter[member[.CUDA_DEVICE_INFORMATION_KEY]]]] begin[{]
local_variable[type[List], deviceInfo]
local_variable[type[List], gpuRam]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=CUDA_TOTAL_MEMORY_KEY, postfix_operators=[], prefix_operators=[], qualifier=Nd4jEnvironment, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=gpuRam, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=deviceInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=info)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))), label=None)
call[ret.setGpuRam, parameter[member[.gpuRam]]]
else begin[{]
None
end[}]
return[member[.ret]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Nd4jEnvironment] identifier[getEnvironment] operator[SEP] operator[SEP] {
identifier[Properties] identifier[envInfo] operator[=] identifier[Nd4j] operator[SEP] identifier[getExecutioner] operator[SEP] operator[SEP] operator[SEP] identifier[getEnvironmentInformation] operator[SEP] operator[SEP] operator[SEP] identifier[Nd4jEnvironment] identifier[ret] operator[=] identifier[Nd4jEnvironment] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[numCores] operator[SEP] identifier[getIntOrZero] operator[SEP] identifier[CPU_CORES_KEY] , identifier[envInfo] operator[SEP] operator[SEP] operator[SEP] identifier[ram] operator[SEP] identifier[getLongOrZero] operator[SEP] identifier[HOST_TOTAL_MEMORY_KEY] , identifier[envInfo] operator[SEP] operator[SEP] operator[SEP] identifier[os] operator[SEP] identifier[envInfo] operator[SEP] identifier[get] operator[SEP] identifier[OS_KEY] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[blasVendor] operator[SEP] identifier[envInfo] operator[SEP] identifier[get] operator[SEP] identifier[BLAS_VENDOR_KEY] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[blasThreads] operator[SEP] identifier[getLongOrZero] operator[SEP] identifier[BLAS_THREADS_KEY] , identifier[envInfo] operator[SEP] operator[SEP] operator[SEP] identifier[ompThreads] operator[SEP] identifier[getIntOrZero] operator[SEP] identifier[OMP_THREADS_KEY] , identifier[envInfo] operator[SEP] operator[SEP] operator[SEP] identifier[numGpus] operator[SEP] identifier[getIntOrZero] operator[SEP] identifier[CUDA_NUM_GPUS_KEY] , identifier[envInfo] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[envInfo] operator[SEP] identifier[containsKey] operator[SEP] identifier[CUDA_DEVICE_INFORMATION_KEY] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[deviceInfo] operator[=] operator[SEP] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] identifier[envInfo] operator[SEP] identifier[get] operator[SEP] identifier[CUDA_DEVICE_INFORMATION_KEY] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Long] operator[>] identifier[gpuRam] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[info] operator[:] identifier[deviceInfo] operator[SEP] {
identifier[gpuRam] operator[SEP] identifier[add] operator[SEP] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[info] operator[SEP] identifier[get] operator[SEP] identifier[Nd4jEnvironment] operator[SEP] identifier[CUDA_TOTAL_MEMORY_KEY] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ret] operator[SEP] identifier[setGpuRam] operator[SEP] identifier[gpuRam] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ret] operator[SEP]
}
|
public static Embedded embedded(final String rel,
final HalRepresentation embeddedItem) {
return new Embedded(singletonMap(rel, embeddedItem));
} | class class_name[name] begin[{]
method[embedded, return_type[type[Embedded]], modifier[public static], parameter[rel, embeddedItem]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=rel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singletonMap, 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=Embedded, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Embedded] identifier[embedded] operator[SEP] Keyword[final] identifier[String] identifier[rel] , Keyword[final] identifier[HalRepresentation] identifier[embeddedItem] operator[SEP] {
Keyword[return] Keyword[new] identifier[Embedded] operator[SEP] identifier[singletonMap] operator[SEP] identifier[rel] , identifier[embeddedItem] operator[SEP] operator[SEP] operator[SEP]
}
|
private String computeServiceName() {
final String httpClientName = getHttpClientName();
String service = ServiceNameFactory.getServiceName(httpClientName);
if (service != null) {
return service; // only if it is so explicitly configured
}
// Otherwise, make use of convention over configuration
int j = httpClientName.indexOf("JavaClient");
if (j == -1) {
j = httpClientName.indexOf("Client");
if (j == -1) {
throw new IllegalStateException(
"Unrecognized suffix for the AWS http client class name " + httpClientName);
}
}
int i = httpClientName.indexOf(AMAZON);
int len;
if (i == -1) {
i = httpClientName.indexOf(AWS);
if (i == -1) {
throw new IllegalStateException(
"Unrecognized prefix for the AWS http client class name " + httpClientName);
}
len = AWS.length();
} else {
len = AMAZON.length();
}
if (i >= j) {
throw new IllegalStateException(
"Unrecognized AWS http client class name " + httpClientName);
}
String serviceName = httpClientName.substring(i + len, j);
return StringUtils.lowerCase(serviceName);
} | class class_name[name] begin[{]
method[computeServiceName, return_type[type[String]], modifier[private], parameter[]] begin[{]
local_variable[type[String], httpClientName]
local_variable[type[String], service]
if[binary_operation[member[.service], !=, literal[null]]] begin[{]
return[member[.service]]
else begin[{]
None
end[}]
local_variable[type[int], j]
if[binary_operation[member[.j], ==, literal[1]]] begin[{]
assign[member[.j], call[httpClientName.indexOf, parameter[literal["Client"]]]]
if[binary_operation[member[.j], ==, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized suffix for the AWS http client class name "), operandr=MemberReference(member=httpClientName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[int], i]
local_variable[type[int], len]
if[binary_operation[member[.i], ==, literal[1]]] begin[{]
assign[member[.i], call[httpClientName.indexOf, parameter[member[.AWS]]]]
if[binary_operation[member[.i], ==, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized prefix for the AWS http client class name "), operandr=MemberReference(member=httpClientName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.len], call[AWS.length, parameter[]]]
else begin[{]
assign[member[.len], call[AMAZON.length, parameter[]]]
end[}]
if[binary_operation[member[.i], >=, member[.j]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized AWS http client class name "), operandr=MemberReference(member=httpClientName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], serviceName]
return[call[StringUtils.lowerCase, parameter[member[.serviceName]]]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[computeServiceName] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[httpClientName] operator[=] identifier[getHttpClientName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[service] operator[=] identifier[ServiceNameFactory] operator[SEP] identifier[getServiceName] operator[SEP] identifier[httpClientName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[service] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[service] operator[SEP]
}
Keyword[int] identifier[j] operator[=] identifier[httpClientName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[j] operator[==] operator[-] Other[1] operator[SEP] {
identifier[j] operator[=] identifier[httpClientName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[j] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[httpClientName] operator[SEP] operator[SEP]
}
}
Keyword[int] identifier[i] operator[=] identifier[httpClientName] operator[SEP] identifier[indexOf] operator[SEP] identifier[AMAZON] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] operator[-] Other[1] operator[SEP] {
identifier[i] operator[=] identifier[httpClientName] operator[SEP] identifier[indexOf] operator[SEP] identifier[AWS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[httpClientName] operator[SEP] operator[SEP]
}
identifier[len] operator[=] identifier[AWS] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[len] operator[=] identifier[AMAZON] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[i] operator[>=] identifier[j] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[httpClientName] operator[SEP] operator[SEP]
}
identifier[String] identifier[serviceName] operator[=] identifier[httpClientName] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[+] identifier[len] , identifier[j] operator[SEP] operator[SEP] Keyword[return] identifier[StringUtils] operator[SEP] identifier[lowerCase] operator[SEP] identifier[serviceName] operator[SEP] operator[SEP]
}
|
private static <T> Constructor<T> lookupConstructor(Class<T> clazz, Object[] pArguments) throws NoSuchMethodException {
Class[] argTypes = extractArgumentTypes(pArguments);
return clazz.getConstructor(argTypes);
} | class class_name[name] begin[{]
method[lookupConstructor, return_type[type[Constructor]], modifier[private static], parameter[clazz, pArguments]] begin[{]
local_variable[type[Class], argTypes]
return[call[clazz.getConstructor, parameter[member[.argTypes]]]]
end[}]
END[}] | Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[Constructor] operator[<] identifier[T] operator[>] identifier[lookupConstructor] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] , identifier[Object] operator[SEP] operator[SEP] identifier[pArguments] operator[SEP] Keyword[throws] identifier[NoSuchMethodException] {
identifier[Class] operator[SEP] operator[SEP] identifier[argTypes] operator[=] identifier[extractArgumentTypes] operator[SEP] identifier[pArguments] operator[SEP] operator[SEP] Keyword[return] identifier[clazz] operator[SEP] identifier[getConstructor] operator[SEP] identifier[argTypes] operator[SEP] operator[SEP]
}
|
private <O> O getValue(Map<String, O> nameValueMap, String attributeName, O defaultValue) {
if(attributeName == null) {
throw new NullPointerException("name must not be null");
}
if(nameValueMap == null) {
return defaultValue;
}
O value = nameValueMap.get(attributeName);
if(value == null) {
return defaultValue;
}
return value;
} | class class_name[name] begin[{]
method[getValue, return_type[type[O]], modifier[private], parameter[nameValueMap, attributeName, defaultValue]] begin[{]
if[binary_operation[member[.attributeName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name must not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.nameValueMap], ==, literal[null]]] begin[{]
return[member[.defaultValue]]
else begin[{]
None
end[}]
local_variable[type[O], value]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
return[member[.defaultValue]]
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[private] operator[<] identifier[O] operator[>] identifier[O] identifier[getValue] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[O] operator[>] identifier[nameValueMap] , identifier[String] identifier[attributeName] , identifier[O] identifier[defaultValue] operator[SEP] {
Keyword[if] operator[SEP] identifier[attributeName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[nameValueMap] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[defaultValue] operator[SEP]
}
identifier[O] identifier[value] operator[=] identifier[nameValueMap] operator[SEP] identifier[get] operator[SEP] identifier[attributeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[defaultValue] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
|
public void marshall(CreateDirectConnectGatewayAssociationProposalRequest createDirectConnectGatewayAssociationProposalRequest,
ProtocolMarshaller protocolMarshaller) {
if (createDirectConnectGatewayAssociationProposalRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createDirectConnectGatewayAssociationProposalRequest.getDirectConnectGatewayId(), DIRECTCONNECTGATEWAYID_BINDING);
protocolMarshaller.marshall(createDirectConnectGatewayAssociationProposalRequest.getDirectConnectGatewayOwnerAccount(),
DIRECTCONNECTGATEWAYOWNERACCOUNT_BINDING);
protocolMarshaller.marshall(createDirectConnectGatewayAssociationProposalRequest.getGatewayId(), GATEWAYID_BINDING);
protocolMarshaller.marshall(createDirectConnectGatewayAssociationProposalRequest.getAddAllowedPrefixesToDirectConnectGateway(),
ADDALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_BINDING);
protocolMarshaller.marshall(createDirectConnectGatewayAssociationProposalRequest.getRemoveAllowedPrefixesToDirectConnectGateway(),
REMOVEALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_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[createDirectConnectGatewayAssociationProposalRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.createDirectConnectGatewayAssociationProposalRequest], ==, 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=getDirectConnectGatewayId, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationProposalRequest, selectors=[], type_arguments=None), MemberReference(member=DIRECTCONNECTGATEWAYID_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=getDirectConnectGatewayOwnerAccount, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationProposalRequest, selectors=[], type_arguments=None), MemberReference(member=DIRECTCONNECTGATEWAYOWNERACCOUNT_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=getGatewayId, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationProposalRequest, selectors=[], type_arguments=None), MemberReference(member=GATEWAYID_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=getAddAllowedPrefixesToDirectConnectGateway, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationProposalRequest, selectors=[], type_arguments=None), MemberReference(member=ADDALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_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=getRemoveAllowedPrefixesToDirectConnectGateway, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationProposalRequest, selectors=[], type_arguments=None), MemberReference(member=REMOVEALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_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[CreateDirectConnectGatewayAssociationProposalRequest] identifier[createDirectConnectGatewayAssociationProposalRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[createDirectConnectGatewayAssociationProposalRequest] 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[createDirectConnectGatewayAssociationProposalRequest] operator[SEP] identifier[getDirectConnectGatewayId] operator[SEP] operator[SEP] , identifier[DIRECTCONNECTGATEWAYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayAssociationProposalRequest] operator[SEP] identifier[getDirectConnectGatewayOwnerAccount] operator[SEP] operator[SEP] , identifier[DIRECTCONNECTGATEWAYOWNERACCOUNT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayAssociationProposalRequest] operator[SEP] identifier[getGatewayId] operator[SEP] operator[SEP] , identifier[GATEWAYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayAssociationProposalRequest] operator[SEP] identifier[getAddAllowedPrefixesToDirectConnectGateway] operator[SEP] operator[SEP] , identifier[ADDALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayAssociationProposalRequest] operator[SEP] identifier[getRemoveAllowedPrefixesToDirectConnectGateway] operator[SEP] operator[SEP] , identifier[REMOVEALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_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]
}
}
|
protected List<Class< ? extends ScopedAssociation>> getAvailableScopedAssociationClasses() {
ArrayList<Class< ? extends ScopedAssociation>> scopeTypes = new ArrayList<Class< ? extends ScopedAssociation>>();
scopeTypes.add(ConversationScopedAssociation.class);
scopeTypes.add(RequestScopedAssociation.class);
return scopeTypes;
} | class class_name[name] begin[{]
method[getAvailableScopedAssociationClasses, return_type[type[List]], modifier[protected], parameter[]] begin[{]
local_variable[type[ArrayList], scopeTypes]
call[scopeTypes.add, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConversationScopedAssociation, sub_type=None))]]
call[scopeTypes.add, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RequestScopedAssociation, sub_type=None))]]
return[member[.scopeTypes]]
end[}]
END[}] | Keyword[protected] identifier[List] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ScopedAssociation] operator[>] operator[>] identifier[getAvailableScopedAssociationClasses] operator[SEP] operator[SEP] {
identifier[ArrayList] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ScopedAssociation] operator[>] operator[>] identifier[scopeTypes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ScopedAssociation] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[scopeTypes] operator[SEP] identifier[add] operator[SEP] identifier[ConversationScopedAssociation] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[scopeTypes] operator[SEP] identifier[add] operator[SEP] identifier[RequestScopedAssociation] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[scopeTypes] operator[SEP]
}
|
private final Session getSession (final String targetName) throws NoSuchSessionException {
final Session session = sessions.get(targetName);
if (session != null) {
return session;
} else {
throw new NoSuchSessionException("Session " + targetName + " not found!");
}
} | class class_name[name] begin[{]
method[getSession, return_type[type[Session]], modifier[final private], parameter[targetName]] begin[{]
local_variable[type[Session], session]
if[binary_operation[member[.session], !=, literal[null]]] begin[{]
return[member[.session]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Session "), operandr=MemberReference(member=targetName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not found!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchSessionException, sub_type=None)), label=None)
end[}]
end[}]
END[}] | Keyword[private] Keyword[final] identifier[Session] identifier[getSession] operator[SEP] Keyword[final] identifier[String] identifier[targetName] operator[SEP] Keyword[throws] identifier[NoSuchSessionException] {
Keyword[final] identifier[Session] identifier[session] operator[=] identifier[sessions] operator[SEP] identifier[get] operator[SEP] identifier[targetName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[session] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[session] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[NoSuchSessionException] operator[SEP] literal[String] operator[+] identifier[targetName] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
public void setDurationBeforeEnd(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
setStartMillis(FieldUtils.safeAdd(getEndMillis(), -durationMillis));
} | class class_name[name] begin[{]
method[setDurationBeforeEnd, return_type[void], modifier[public], parameter[duration]] begin[{]
local_variable[type[long], durationMillis]
call[.setStartMillis, parameter[call[FieldUtils.safeAdd, parameter[call[.getEndMillis, parameter[]], member[.durationMillis]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDurationBeforeEnd] operator[SEP] identifier[ReadableDuration] identifier[duration] operator[SEP] {
Keyword[long] identifier[durationMillis] operator[=] identifier[DateTimeUtils] operator[SEP] identifier[getDurationMillis] operator[SEP] identifier[duration] operator[SEP] operator[SEP] identifier[setStartMillis] operator[SEP] identifier[FieldUtils] operator[SEP] identifier[safeAdd] operator[SEP] identifier[getEndMillis] operator[SEP] operator[SEP] , operator[-] identifier[durationMillis] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Set<Field> getInstanceFields(Class<?> clazz, Filter<Field> filter) {
return getFields(clazz,
new And<Field>(
filter != null ? filter : new True<Field>(),
new Not<Field>(
new IsStatic<Field>()
),
new Not<Field>(
new IsOverridden<Field>()
)
)
);
} | class class_name[name] begin[{]
method[getInstanceFields, return_type[type[Set]], modifier[public static], parameter[clazz, filter]] begin[{]
return[call[.getFields, parameter[member[.clazz], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))], dimensions=None, name=True, sub_type=None)), if_true=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))], dimensions=None, name=IsStatic, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))], dimensions=None, name=Not, sub_type=None)), ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))], dimensions=None, name=IsOverridden, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))], dimensions=None, name=Not, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))], dimensions=None, name=And, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Field] operator[>] identifier[getInstanceFields] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Filter] operator[<] identifier[Field] operator[>] identifier[filter] operator[SEP] {
Keyword[return] identifier[getFields] operator[SEP] identifier[clazz] , Keyword[new] identifier[And] operator[<] identifier[Field] operator[>] operator[SEP] identifier[filter] operator[!=] Other[null] operator[?] identifier[filter] operator[:] Keyword[new] identifier[True] operator[<] identifier[Field] operator[>] operator[SEP] operator[SEP] , Keyword[new] identifier[Not] operator[<] identifier[Field] operator[>] operator[SEP] Keyword[new] identifier[IsStatic] operator[<] identifier[Field] operator[>] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[Not] operator[<] identifier[Field] operator[>] operator[SEP] Keyword[new] identifier[IsOverridden] operator[<] identifier[Field] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void exports(Media media, Collection<Media> levels, Media sheetsMedia, Media groupsMedia)
{
Check.notNull(media);
Check.notNull(levels);
Check.notNull(sheetsMedia);
Check.notNull(groupsMedia);
final TransitionsExtractor extractor = new TransitionsExtractorImpl();
final Map<Transition, Collection<TileRef>> transitions = extractor.getTransitions(levels,
sheetsMedia,
groupsMedia);
exports(media, transitions);
} | class class_name[name] begin[{]
method[exports, return_type[void], modifier[public static], parameter[media, levels, sheetsMedia, groupsMedia]] begin[{]
call[Check.notNull, parameter[member[.media]]]
call[Check.notNull, parameter[member[.levels]]]
call[Check.notNull, parameter[member[.sheetsMedia]]]
call[Check.notNull, parameter[member[.groupsMedia]]]
local_variable[type[TransitionsExtractor], extractor]
local_variable[type[Map], transitions]
call[.exports, parameter[member[.media], member[.transitions]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[exports] operator[SEP] identifier[Media] identifier[media] , identifier[Collection] operator[<] identifier[Media] operator[>] identifier[levels] , identifier[Media] identifier[sheetsMedia] , identifier[Media] identifier[groupsMedia] operator[SEP] {
identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[media] operator[SEP] operator[SEP] identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[levels] operator[SEP] operator[SEP] identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[sheetsMedia] operator[SEP] operator[SEP] identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[groupsMedia] operator[SEP] operator[SEP] Keyword[final] identifier[TransitionsExtractor] identifier[extractor] operator[=] Keyword[new] identifier[TransitionsExtractorImpl] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[Transition] , identifier[Collection] operator[<] identifier[TileRef] operator[>] operator[>] identifier[transitions] operator[=] identifier[extractor] operator[SEP] identifier[getTransitions] operator[SEP] identifier[levels] , identifier[sheetsMedia] , identifier[groupsMedia] operator[SEP] operator[SEP] identifier[exports] operator[SEP] identifier[media] , identifier[transitions] operator[SEP] operator[SEP]
}
|
public void setPath(String p){
path = p ;
if ( ! (path.endsWith(fileSeparator) ) )
path = path + fileSeparator;
} | class class_name[name] begin[{]
method[setPath, return_type[void], modifier[public], parameter[p]] begin[{]
assign[member[.path], member[.p]]
if[call[path.endsWith, parameter[member[.fileSeparator]]]] begin[{]
assign[member[.path], binary_operation[member[.path], +, member[.fileSeparator]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setPath] operator[SEP] identifier[String] identifier[p] operator[SEP] {
identifier[path] operator[=] identifier[p] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[path] operator[SEP] identifier[endsWith] operator[SEP] identifier[fileSeparator] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[path] operator[+] identifier[fileSeparator] operator[SEP]
}
|
public OutlierResult run(Relation<Model> models, Relation<NumberVector> vecs, Relation<?> labels) {
WritableDoubleDataStore scores = DataStoreUtil.makeDoubleStorage(models.getDBIDs(), DataStoreFactory.HINT_HOT);
HashSet<GeneratorSingleCluster> generators = new HashSet<>();
for(DBIDIter iditer = models.iterDBIDs(); iditer.valid(); iditer.advance()) {
Model model = models.get(iditer);
if(model instanceof GeneratorSingleCluster) {
generators.add((GeneratorSingleCluster) model);
}
}
if(generators.isEmpty()) {
LOG.warning("No generator models found for dataset - all points will be considered outliers.");
}
for(GeneratorSingleCluster gen : generators) {
for(int i = 0; i < gen.getDim(); i++) {
Distribution dist = gen.getDistribution(i);
if(!(dist instanceof NormalDistribution)) {
throw new AbortException("TrivialGeneratedOutlier currently only supports normal distributions, got: " + dist);
}
}
}
for(DBIDIter iditer = models.iterDBIDs(); iditer.valid(); iditer.advance()) {
double score = 1.;
double[] v = vecs.get(iditer).toArray();
for(GeneratorSingleCluster gen : generators) {
double[] tv = v;
// Transform backwards
if(gen.getTransformation() != null) {
tv = gen.getTransformation().applyInverse(v);
}
final int dim = tv.length;
double lensq = 0.0;
int norm = 0;
for(int i = 0; i < dim; i++) {
Distribution dist = gen.getDistribution(i);
if(dist instanceof NormalDistribution) {
NormalDistribution d = (NormalDistribution) dist;
double delta = (tv[i] - d.getMean()) / d.getStddev();
lensq += delta * delta;
norm += 1;
}
else {
throw new AbortException("TrivialGeneratedOutlier currently only supports normal distributions, got: " + dist);
}
}
if(norm > 0.) {
// The squared distances are ChiSquared distributed
score = Math.min(score, ChiSquaredDistribution.cdf(lensq, norm));
}
else {
score = 0.;
}
}
if(expect < 1) {
score = expect * score / (1 - score + expect);
}
scores.putDouble(iditer, score);
}
DoubleRelation scoreres = new MaterializedDoubleRelation("Model outlier scores", "model-outlier", scores, models.getDBIDs());
OutlierScoreMeta meta = new ProbabilisticOutlierScore(0., 1.);
return new OutlierResult(meta, scoreres);
} | class class_name[name] begin[{]
method[run, return_type[type[OutlierResult]], modifier[public], parameter[models, vecs, labels]] begin[{]
local_variable[type[WritableDoubleDataStore], scores]
local_variable[type[HashSet], generators]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=iditer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=models, selectors=[], type_arguments=None), name=model)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Model, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=GeneratorSingleCluster, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=GeneratorSingleCluster, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=generators, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=iditer, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterDBIDs, postfix_operators=[], prefix_operators=[], qualifier=models, selectors=[], type_arguments=None), name=iditer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=iditer, selectors=[], type_arguments=None)]), label=None)
if[call[generators.isEmpty, parameter[]]] begin[{]
call[LOG.warning, parameter[literal["No generator models found for dataset - all points will be considered outliers."]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDistribution, postfix_operators=[], prefix_operators=[], qualifier=gen, selectors=[], type_arguments=None), name=dist)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Distribution, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=NormalDistribution, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TrivialGeneratedOutlier currently only supports normal distributions, got: "), operandr=MemberReference(member=dist, 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=AbortException, sub_type=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getDim, postfix_operators=[], prefix_operators=[], qualifier=gen, 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)]), control=EnhancedForControl(iterable=MemberReference(member=generators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=gen)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GeneratorSingleCluster, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.), name=score)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=iditer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=vecs, selectors=[MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=v)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=tv)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTransformation, postfix_operators=[], prefix_operators=[], qualifier=gen, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTransformation, postfix_operators=[], prefix_operators=[], qualifier=gen, selectors=[MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=applyInverse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tv, selectors=[]), name=dim)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), name=lensq)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=norm)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDistribution, postfix_operators=[], prefix_operators=[], qualifier=gen, selectors=[], type_arguments=None), name=dist)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Distribution, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=NormalDistribution, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TrivialGeneratedOutlier currently only supports normal distributions, got: "), operandr=MemberReference(member=dist, 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=AbortException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=NormalDistribution, sub_type=None)), name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NormalDistribution, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MethodInvocation(arguments=[], member=getMean, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None), operator=-), operandr=MethodInvocation(arguments=[], member=getStddev, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None), operator=/), name=delta)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lensq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=norm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=norm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, 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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=lensq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=norm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cdf, postfix_operators=[], prefix_operators=[], qualifier=ChiSquaredDistribution, selectors=[], type_arguments=None)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=generators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=gen)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GeneratorSingleCluster, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=expect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=expect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=expect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operator=/)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iditer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putDouble, postfix_operators=[], prefix_operators=[], qualifier=scores, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=iditer, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterDBIDs, postfix_operators=[], prefix_operators=[], qualifier=models, selectors=[], type_arguments=None), name=iditer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=iditer, selectors=[], type_arguments=None)]), label=None)
local_variable[type[DoubleRelation], scoreres]
local_variable[type[OutlierScoreMeta], meta]
return[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scoreres, 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=OutlierResult, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[OutlierResult] identifier[run] operator[SEP] identifier[Relation] operator[<] identifier[Model] operator[>] identifier[models] , identifier[Relation] operator[<] identifier[NumberVector] operator[>] identifier[vecs] , identifier[Relation] operator[<] operator[?] operator[>] identifier[labels] operator[SEP] {
identifier[WritableDoubleDataStore] identifier[scores] operator[=] identifier[DataStoreUtil] operator[SEP] identifier[makeDoubleStorage] operator[SEP] identifier[models] operator[SEP] identifier[getDBIDs] operator[SEP] operator[SEP] , identifier[DataStoreFactory] operator[SEP] identifier[HINT_HOT] operator[SEP] operator[SEP] identifier[HashSet] operator[<] identifier[GeneratorSingleCluster] operator[>] identifier[generators] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DBIDIter] identifier[iditer] operator[=] identifier[models] operator[SEP] identifier[iterDBIDs] operator[SEP] operator[SEP] operator[SEP] identifier[iditer] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[iditer] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] {
identifier[Model] identifier[model] operator[=] identifier[models] operator[SEP] identifier[get] operator[SEP] identifier[iditer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[model] Keyword[instanceof] identifier[GeneratorSingleCluster] operator[SEP] {
identifier[generators] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[GeneratorSingleCluster] operator[SEP] identifier[model] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[generators] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[GeneratorSingleCluster] identifier[gen] operator[:] identifier[generators] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[gen] operator[SEP] identifier[getDim] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Distribution] identifier[dist] operator[=] identifier[gen] operator[SEP] identifier[getDistribution] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[dist] Keyword[instanceof] identifier[NormalDistribution] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AbortException] operator[SEP] literal[String] operator[+] identifier[dist] operator[SEP] operator[SEP]
}
}
}
Keyword[for] operator[SEP] identifier[DBIDIter] identifier[iditer] operator[=] identifier[models] operator[SEP] identifier[iterDBIDs] operator[SEP] operator[SEP] operator[SEP] identifier[iditer] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[iditer] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] {
Keyword[double] identifier[score] operator[=] literal[Float] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[v] operator[=] identifier[vecs] operator[SEP] identifier[get] operator[SEP] identifier[iditer] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[GeneratorSingleCluster] identifier[gen] operator[:] identifier[generators] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] identifier[tv] operator[=] identifier[v] operator[SEP] Keyword[if] operator[SEP] identifier[gen] operator[SEP] identifier[getTransformation] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[tv] operator[=] identifier[gen] operator[SEP] identifier[getTransformation] operator[SEP] operator[SEP] operator[SEP] identifier[applyInverse] operator[SEP] identifier[v] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[int] identifier[dim] operator[=] identifier[tv] operator[SEP] identifier[length] operator[SEP] Keyword[double] identifier[lensq] operator[=] literal[Float] operator[SEP] Keyword[int] identifier[norm] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dim] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Distribution] identifier[dist] operator[=] identifier[gen] operator[SEP] identifier[getDistribution] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] Keyword[instanceof] identifier[NormalDistribution] operator[SEP] {
identifier[NormalDistribution] identifier[d] operator[=] operator[SEP] identifier[NormalDistribution] operator[SEP] identifier[dist] operator[SEP] Keyword[double] identifier[delta] operator[=] operator[SEP] identifier[tv] operator[SEP] identifier[i] operator[SEP] operator[-] identifier[d] operator[SEP] identifier[getMean] operator[SEP] operator[SEP] operator[SEP] operator[/] identifier[d] operator[SEP] identifier[getStddev] operator[SEP] operator[SEP] operator[SEP] identifier[lensq] operator[+=] identifier[delta] operator[*] identifier[delta] operator[SEP] identifier[norm] operator[+=] Other[1] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[AbortException] operator[SEP] literal[String] operator[+] identifier[dist] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[norm] operator[>] literal[Float] operator[SEP] {
identifier[score] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[score] , identifier[ChiSquaredDistribution] operator[SEP] identifier[cdf] operator[SEP] identifier[lensq] , identifier[norm] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[score] operator[=] literal[Float] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[expect] operator[<] Other[1] operator[SEP] {
identifier[score] operator[=] identifier[expect] operator[*] identifier[score] operator[/] operator[SEP] Other[1] operator[-] identifier[score] operator[+] identifier[expect] operator[SEP] operator[SEP]
}
identifier[scores] operator[SEP] identifier[putDouble] operator[SEP] identifier[iditer] , identifier[score] operator[SEP] operator[SEP]
}
identifier[DoubleRelation] identifier[scoreres] operator[=] Keyword[new] identifier[MaterializedDoubleRelation] operator[SEP] literal[String] , literal[String] , identifier[scores] , identifier[models] operator[SEP] identifier[getDBIDs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[OutlierScoreMeta] identifier[meta] operator[=] Keyword[new] identifier[ProbabilisticOutlierScore] operator[SEP] literal[Float] , literal[Float] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[OutlierResult] operator[SEP] identifier[meta] , identifier[scoreres] operator[SEP] operator[SEP]
}
|
public static void apply(Face type, TextView... textViews){
if(textViews.length == 0) return;
for (int i = 0; i < textViews.length; i++) {
apply(textViews[i], type);
}
} | class class_name[name] begin[{]
method[apply, return_type[void], modifier[public static], parameter[type, textViews]] begin[{]
if[binary_operation[member[textViews.length], ==, literal[0]]] begin[{]
return[None]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=textViews, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=textViews, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[apply] operator[SEP] identifier[Face] identifier[type] , identifier[TextView] operator[...] identifier[textViews] operator[SEP] {
Keyword[if] operator[SEP] identifier[textViews] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[textViews] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[apply] operator[SEP] identifier[textViews] operator[SEP] identifier[i] operator[SEP] , identifier[type] operator[SEP] operator[SEP]
}
}
|
private static void buildJSONString(StringBuilder sb, Object o, ObjectInspector oi) throws IOException {
switch (oi.getCategory()) {
case PRIMITIVE: {
PrimitiveObjectInspector poi = (PrimitiveObjectInspector) oi;
if (o == null) {
sb.append("null");
} else {
switch (poi.getPrimitiveCategory()) {
case BOOLEAN: {
boolean b = ((BooleanObjectInspector) poi).get(o);
sb.append(b ? "true" : "false");
break;
}
case BYTE: {
sb.append(((ByteObjectInspector) poi).get(o));
break;
}
case SHORT: {
sb.append(((ShortObjectInspector) poi).get(o));
break;
}
case INT: {
sb.append(((IntObjectInspector) poi).get(o));
break;
}
case LONG: {
sb.append(((LongObjectInspector) poi).get(o));
break;
}
case FLOAT: {
sb.append(((FloatObjectInspector) poi).get(o));
break;
}
case DOUBLE: {
sb.append(((DoubleObjectInspector) poi).get(o));
break;
}
case STRING: {
String s =
SerDeUtils.escapeString(((StringObjectInspector) poi).getPrimitiveJavaObject(o));
appendWithQuotes(sb, s);
break;
}
case BINARY: {
throw new IOException("JsonSerDe does not support BINARY type");
}
case DATE:
Date d = ((DateObjectInspector)poi).getPrimitiveJavaObject(o);
appendWithQuotes(sb, d.toString());
break;
case TIMESTAMP: {
Timestamp t = ((TimestampObjectInspector) poi).getPrimitiveJavaObject(o);
appendWithQuotes(sb, t.toString());
break;
}
case DECIMAL:
sb.append(((HiveDecimalObjectInspector)poi).getPrimitiveJavaObject(o));
break;
case VARCHAR: {
String s = SerDeUtils.escapeString(
((HiveVarcharObjectInspector) poi).getPrimitiveJavaObject(o).toString());
appendWithQuotes(sb, s);
break;
}
case CHAR: {
//this should use HiveChar.getPaddedValue() but it's protected; currently (v0.13)
// HiveChar.toString() returns getPaddedValue()
String s = SerDeUtils.escapeString(
((HiveCharObjectInspector) poi).getPrimitiveJavaObject(o).toString());
appendWithQuotes(sb, s);
break;
}
default:
throw new RuntimeException("Unknown primitive type: " + poi.getPrimitiveCategory());
}
}
break;
}
case LIST: {
ListObjectInspector loi = (ListObjectInspector) oi;
ObjectInspector listElementObjectInspector = loi
.getListElementObjectInspector();
List<?> olist = loi.getList(o);
if (olist == null) {
sb.append("null");
} else {
sb.append(SerDeUtils.LBRACKET);
for (int i = 0; i < olist.size(); i++) {
if (i > 0) {
sb.append(SerDeUtils.COMMA);
}
buildJSONString(sb, olist.get(i), listElementObjectInspector);
}
sb.append(SerDeUtils.RBRACKET);
}
break;
}
case MAP: {
MapObjectInspector moi = (MapObjectInspector) oi;
ObjectInspector mapKeyObjectInspector = moi.getMapKeyObjectInspector();
ObjectInspector mapValueObjectInspector = moi
.getMapValueObjectInspector();
Map<?, ?> omap = moi.getMap(o);
if (omap == null) {
sb.append("null");
} else {
sb.append(SerDeUtils.LBRACE);
boolean first = true;
for (Object entry : omap.entrySet()) {
if (first) {
first = false;
} else {
sb.append(SerDeUtils.COMMA);
}
Map.Entry<?, ?> e = (Map.Entry<?, ?>) entry;
StringBuilder keyBuilder = new StringBuilder();
buildJSONString(keyBuilder, e.getKey(), mapKeyObjectInspector);
String keyString = keyBuilder.toString().trim();
if((!keyString.isEmpty()) && (keyString.charAt(0) != SerDeUtils.QUOTE)) {
appendWithQuotes(sb, keyString);
}
else {
sb.append(keyString);
}
sb.append(SerDeUtils.COLON);
buildJSONString(sb, e.getValue(), mapValueObjectInspector);
}
sb.append(SerDeUtils.RBRACE);
}
break;
}
case STRUCT: {
StructObjectInspector soi = (StructObjectInspector) oi;
List<? extends StructField> structFields = soi.getAllStructFieldRefs();
if (o == null) {
sb.append("null");
} else {
sb.append(SerDeUtils.LBRACE);
for (int i = 0; i < structFields.size(); i++) {
if (i > 0) {
sb.append(SerDeUtils.COMMA);
}
appendWithQuotes(sb, structFields.get(i).getFieldName());
sb.append(SerDeUtils.COLON);
buildJSONString(sb, soi.getStructFieldData(o, structFields.get(i)),
structFields.get(i).getFieldObjectInspector());
}
sb.append(SerDeUtils.RBRACE);
}
break;
}
case UNION: {
UnionObjectInspector uoi = (UnionObjectInspector) oi;
if (o == null) {
sb.append("null");
} else {
sb.append(SerDeUtils.LBRACE);
sb.append(uoi.getTag(o));
sb.append(SerDeUtils.COLON);
buildJSONString(sb, uoi.getField(o),
uoi.getObjectInspectors().get(uoi.getTag(o)));
sb.append(SerDeUtils.RBRACE);
}
break;
}
default:
throw new RuntimeException("Unknown type in ObjectInspector!");
}
} | class class_name[name] begin[{]
method[buildJSONString, return_type[void], modifier[private static], parameter[sb, o, oi]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['PRIMITIVE'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=oi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PrimitiveObjectInspector, sub_type=None)), name=poi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PrimitiveObjectInspector, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=['BOOLEAN'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BooleanObjectInspector, sub_type=None)), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="false"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="true"))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['BYTE'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ByteObjectInspector, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['SHORT'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ShortObjectInspector, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['INT'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntObjectInspector, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['LONG'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LongObjectInspector, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['FLOAT'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FloatObjectInspector, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['DOUBLE'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DoubleObjectInspector, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['STRING'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StringObjectInspector, sub_type=None))], member=escapeString, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendWithQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['BINARY'], statements=[BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JsonSerDe does not support BINARY type")], 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)])]), SwitchStatementCase(case=['DATE'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DateObjectInspector, sub_type=None)), name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None)], member=appendWithQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['TIMESTAMP'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TimestampObjectInspector, sub_type=None)), name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Timestamp, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=appendWithQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['DECIMAL'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HiveDecimalObjectInspector, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['VARCHAR'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HiveVarcharObjectInspector, sub_type=None))], member=escapeString, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendWithQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['CHAR'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=poi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HiveCharObjectInspector, sub_type=None))], member=escapeString, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendWithQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown primitive type: "), operandr=MethodInvocation(arguments=[], member=getPrimitiveCategory, postfix_operators=[], prefix_operators=[], qualifier=poi, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getPrimitiveCategory, postfix_operators=[], prefix_operators=[], qualifier=poi, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['LIST'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=oi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ListObjectInspector, sub_type=None)), name=loi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ListObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getListElementObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=loi, selectors=[], type_arguments=None), name=listElementObjectInspector)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getList, postfix_operators=[], prefix_operators=[], qualifier=loi, selectors=[], type_arguments=None), name=olist)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=olist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LBRACKET, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=olist, selectors=[], type_arguments=None), MemberReference(member=listElementObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildJSONString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=olist, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RBRACKET, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['MAP'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=oi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MapObjectInspector, sub_type=None)), name=moi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MapObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMapKeyObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=moi, selectors=[], type_arguments=None), name=mapKeyObjectInspector)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMapValueObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=moi, selectors=[], type_arguments=None), name=mapValueObjectInspector)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMap, postfix_operators=[], prefix_operators=[], qualifier=moi, selectors=[], type_arguments=None), name=omap)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Map, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=omap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LBRACE, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=first)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Entry, sub_type=None))), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Entry, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=keyBuilder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keyBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=mapKeyObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildJSONString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=keyBuilder, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=keyString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=keyString, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=keyString, selectors=[], type_arguments=None), operandr=MemberReference(member=QUOTE, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[]), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keyString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendWithQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=mapValueObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildJSONString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=omap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RBRACE, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['STRUCT'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=oi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StructObjectInspector, sub_type=None)), name=soi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StructObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAllStructFieldRefs, postfix_operators=[], prefix_operators=[], qualifier=soi, selectors=[], type_arguments=None), name=structFields)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=StructField, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LBRACE, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=structFields, selectors=[MethodInvocation(arguments=[], member=getFieldName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=appendWithQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=structFields, selectors=[], type_arguments=None)], member=getStructFieldData, postfix_operators=[], prefix_operators=[], qualifier=soi, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=structFields, selectors=[MethodInvocation(arguments=[], member=getFieldObjectInspector, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=buildJSONString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=structFields, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RBRACE, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['UNION'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=oi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=UnionObjectInspector, sub_type=None)), name=uoi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UnionObjectInspector, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LBRACE, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=uoi, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=uoi, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getObjectInspectors, postfix_operators=[], prefix_operators=[], qualifier=uoi, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=uoi, selectors=[], type_arguments=None)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=buildJSONString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RBRACE, postfix_operators=[], prefix_operators=[], qualifier=SerDeUtils, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown type in ObjectInspector!")], 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=MethodInvocation(arguments=[], member=getCategory, postfix_operators=[], prefix_operators=[], qualifier=oi, selectors=[], type_arguments=None), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[buildJSONString] operator[SEP] identifier[StringBuilder] identifier[sb] , identifier[Object] identifier[o] , identifier[ObjectInspector] identifier[oi] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[switch] operator[SEP] identifier[oi] operator[SEP] identifier[getCategory] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[PRIMITIVE] operator[:] {
identifier[PrimitiveObjectInspector] identifier[poi] operator[=] operator[SEP] identifier[PrimitiveObjectInspector] operator[SEP] identifier[oi] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[==] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[switch] operator[SEP] identifier[poi] operator[SEP] identifier[getPrimitiveCategory] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[BOOLEAN] operator[:] {
Keyword[boolean] identifier[b] operator[=] operator[SEP] operator[SEP] identifier[BooleanObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[b] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[BYTE] operator[:] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[ByteObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[SHORT] operator[:] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[ShortObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[INT] operator[:] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[IntObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[LONG] operator[:] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[LongObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[FLOAT] operator[:] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[FloatObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[DOUBLE] operator[:] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[DoubleObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[STRING] operator[:] {
identifier[String] identifier[s] operator[=] identifier[SerDeUtils] operator[SEP] identifier[escapeString] operator[SEP] operator[SEP] operator[SEP] identifier[StringObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] identifier[appendWithQuotes] operator[SEP] identifier[sb] , identifier[s] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[BINARY] operator[:] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[case] identifier[DATE] operator[:] identifier[Date] identifier[d] operator[=] operator[SEP] operator[SEP] identifier[DateObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[appendWithQuotes] operator[SEP] identifier[sb] , identifier[d] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TIMESTAMP] operator[:] {
identifier[Timestamp] identifier[t] operator[=] operator[SEP] operator[SEP] identifier[TimestampObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[appendWithQuotes] operator[SEP] identifier[sb] , identifier[t] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[DECIMAL] operator[:] identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[HiveDecimalObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[VARCHAR] operator[:] {
identifier[String] identifier[s] operator[=] identifier[SerDeUtils] operator[SEP] identifier[escapeString] operator[SEP] operator[SEP] operator[SEP] identifier[HiveVarcharObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[appendWithQuotes] operator[SEP] identifier[sb] , identifier[s] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[CHAR] operator[:] {
identifier[String] identifier[s] operator[=] identifier[SerDeUtils] operator[SEP] identifier[escapeString] operator[SEP] operator[SEP] operator[SEP] identifier[HiveCharObjectInspector] operator[SEP] identifier[poi] operator[SEP] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[appendWithQuotes] operator[SEP] identifier[sb] , identifier[s] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[poi] operator[SEP] identifier[getPrimitiveCategory] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP]
}
Keyword[case] identifier[LIST] operator[:] {
identifier[ListObjectInspector] identifier[loi] operator[=] operator[SEP] identifier[ListObjectInspector] operator[SEP] identifier[oi] operator[SEP] identifier[ObjectInspector] identifier[listElementObjectInspector] operator[=] identifier[loi] operator[SEP] identifier[getListElementObjectInspector] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] operator[?] operator[>] identifier[olist] operator[=] identifier[loi] operator[SEP] identifier[getList] operator[SEP] identifier[o] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[olist] operator[==] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[LBRACKET] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[olist] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP]
}
identifier[buildJSONString] operator[SEP] identifier[sb] , identifier[olist] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[listElementObjectInspector] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[RBRACKET] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[case] identifier[MAP] operator[:] {
identifier[MapObjectInspector] identifier[moi] operator[=] operator[SEP] identifier[MapObjectInspector] operator[SEP] identifier[oi] operator[SEP] identifier[ObjectInspector] identifier[mapKeyObjectInspector] operator[=] identifier[moi] operator[SEP] identifier[getMapKeyObjectInspector] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectInspector] identifier[mapValueObjectInspector] operator[=] identifier[moi] operator[SEP] identifier[getMapValueObjectInspector] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[omap] operator[=] identifier[moi] operator[SEP] identifier[getMap] operator[SEP] identifier[o] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[omap] operator[==] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[LBRACE] operator[SEP] operator[SEP] Keyword[boolean] identifier[first] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[entry] operator[:] identifier[omap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[first] operator[SEP] {
identifier[first] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP]
}
identifier[Map] operator[SEP] identifier[Entry] operator[<] operator[?] , operator[?] operator[>] identifier[e] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[entry] operator[SEP] identifier[StringBuilder] identifier[keyBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildJSONString] operator[SEP] identifier[keyBuilder] , identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[mapKeyObjectInspector] operator[SEP] operator[SEP] identifier[String] identifier[keyString] operator[=] identifier[keyBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[!] identifier[keyString] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[keyString] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[!=] identifier[SerDeUtils] operator[SEP] identifier[QUOTE] operator[SEP] operator[SEP] {
identifier[appendWithQuotes] operator[SEP] identifier[sb] , identifier[keyString] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[keyString] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] identifier[buildJSONString] operator[SEP] identifier[sb] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[mapValueObjectInspector] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[RBRACE] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[case] identifier[STRUCT] operator[:] {
identifier[StructObjectInspector] identifier[soi] operator[=] operator[SEP] identifier[StructObjectInspector] operator[SEP] identifier[oi] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[StructField] operator[>] identifier[structFields] operator[=] identifier[soi] operator[SEP] identifier[getAllStructFieldRefs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[==] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[LBRACE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[structFields] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP]
}
identifier[appendWithQuotes] operator[SEP] identifier[sb] , identifier[structFields] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFieldName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] identifier[buildJSONString] operator[SEP] identifier[sb] , identifier[soi] operator[SEP] identifier[getStructFieldData] operator[SEP] identifier[o] , identifier[structFields] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] , identifier[structFields] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFieldObjectInspector] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[RBRACE] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[case] identifier[UNION] operator[:] {
identifier[UnionObjectInspector] identifier[uoi] operator[=] operator[SEP] identifier[UnionObjectInspector] operator[SEP] identifier[oi] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[==] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[LBRACE] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[uoi] operator[SEP] identifier[getTag] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] identifier[buildJSONString] operator[SEP] identifier[sb] , identifier[uoi] operator[SEP] identifier[getField] operator[SEP] identifier[o] operator[SEP] , identifier[uoi] operator[SEP] identifier[getObjectInspectors] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[uoi] operator[SEP] identifier[getTag] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[SerDeUtils] operator[SEP] identifier[RBRACE] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public static int cudaArrayGetInfo(cudaChannelFormatDesc desc, cudaExtent extent, int flags[], cudaArray array)
{
return checkResult(cudaArrayGetInfoNative(desc, extent, flags, array));
} | class class_name[name] begin[{]
method[cudaArrayGetInfo, return_type[type[int]], modifier[public static], parameter[desc, extent, flags, array]] begin[{]
return[call[.checkResult, parameter[call[.cudaArrayGetInfoNative, parameter[member[.desc], member[.extent], member[.flags], member[.array]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[cudaArrayGetInfo] operator[SEP] identifier[cudaChannelFormatDesc] identifier[desc] , identifier[cudaExtent] identifier[extent] , Keyword[int] identifier[flags] operator[SEP] operator[SEP] , identifier[cudaArray] identifier[array] operator[SEP] {
Keyword[return] identifier[checkResult] operator[SEP] identifier[cudaArrayGetInfoNative] operator[SEP] identifier[desc] , identifier[extent] , identifier[flags] , identifier[array] operator[SEP] operator[SEP] operator[SEP]
}
|
public void waitAndSwitchToNewBrowserWindow(int timeout) {
final Set<String> handles = SenBotContext.getSeleniumDriver().getWindowHandles();
mainWindowHandle.set(SenBotContext.getSeleniumDriver().getWindowHandles().iterator().next());
if (getWebDriver() instanceof InternetExplorerDriver) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
String newWindow = (new WebDriverWait(getWebDriver(), timeout)).until(new ExpectedCondition<String>() {
public String apply(WebDriver input) {
if (input.getWindowHandles().size() > 1) {
Iterator<String> iterator = input.getWindowHandles().iterator();
String found = iterator.next();
found = iterator.next();
return found;
}
return null;
}
});
assertTrue(!newWindow.equals(mainWindowHandle.get()));
assertTrue(!newWindow.isEmpty());
popupWindowHandle.set(newWindow);
SenBotContext.getSeleniumDriver().switchTo().window(newWindow);
} | class class_name[name] begin[{]
method[waitAndSwitchToNewBrowserWindow, return_type[void], modifier[public], parameter[timeout]] begin[{]
local_variable[type[Set], handles]
call[mainWindowHandle.set, parameter[call[SenBotContext.getSeleniumDriver, parameter[]]]]
if[binary_operation[call[.getWebDriver, parameter[]], instanceof, type[InternetExplorerDriver]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
local_variable[type[String], newWindow]
call[.assertTrue, parameter[call[newWindow.equals, parameter[call[mainWindowHandle.get, parameter[]]]]]]
call[.assertTrue, parameter[call[newWindow.isEmpty, parameter[]]]]
call[popupWindowHandle.set, parameter[member[.newWindow]]]
call[SenBotContext.getSeleniumDriver, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[waitAndSwitchToNewBrowserWindow] operator[SEP] Keyword[int] identifier[timeout] operator[SEP] {
Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[handles] operator[=] identifier[SenBotContext] operator[SEP] identifier[getSeleniumDriver] operator[SEP] operator[SEP] operator[SEP] identifier[getWindowHandles] operator[SEP] operator[SEP] operator[SEP] identifier[mainWindowHandle] operator[SEP] identifier[set] operator[SEP] identifier[SenBotContext] operator[SEP] identifier[getSeleniumDriver] operator[SEP] operator[SEP] operator[SEP] identifier[getWindowHandles] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getWebDriver] operator[SEP] operator[SEP] Keyword[instanceof] identifier[InternetExplorerDriver] operator[SEP] {
Keyword[try] {
identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[1000] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[String] identifier[newWindow] operator[=] operator[SEP] Keyword[new] identifier[WebDriverWait] operator[SEP] identifier[getWebDriver] operator[SEP] operator[SEP] , identifier[timeout] operator[SEP] operator[SEP] operator[SEP] identifier[until] operator[SEP] Keyword[new] identifier[ExpectedCondition] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] {
Keyword[public] identifier[String] identifier[apply] operator[SEP] identifier[WebDriver] identifier[input] operator[SEP] {
Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[getWindowHandles] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[Iterator] operator[<] identifier[String] operator[>] identifier[iterator] operator[=] identifier[input] operator[SEP] identifier[getWindowHandles] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[found] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[found] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[found] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[assertTrue] operator[SEP] operator[!] identifier[newWindow] operator[SEP] identifier[equals] operator[SEP] identifier[mainWindowHandle] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[assertTrue] operator[SEP] operator[!] identifier[newWindow] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[popupWindowHandle] operator[SEP] identifier[set] operator[SEP] identifier[newWindow] operator[SEP] operator[SEP] identifier[SenBotContext] operator[SEP] identifier[getSeleniumDriver] operator[SEP] operator[SEP] operator[SEP] identifier[switchTo] operator[SEP] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[newWindow] operator[SEP] operator[SEP]
}
|
public static void checkCharset(String accepts) throws IOException {
if (accepts == null) {
// ie7 does not send this header
return;
}
// I've seen both "utf-8" and "UTF-8" -> test case-insensitive
if (contains(accepts.toLowerCase(), Engine.ENCODING)) {
return;
}
if (contains(accepts, "*")) {
return;
}
throw new IOException(Engine.ENCODING + " encoding is not accepted: " + accepts);
} | class class_name[name] begin[{]
method[checkCharset, return_type[void], modifier[public static], parameter[accepts]] begin[{]
if[binary_operation[member[.accepts], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[.contains, parameter[call[accepts.toLowerCase, parameter[]], member[Engine.ENCODING]]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[.contains, parameter[member[.accepts], literal["*"]]]] begin[{]
return[None]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ENCODING, postfix_operators=[], prefix_operators=[], qualifier=Engine, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" encoding is not accepted: "), operator=+), operandr=MemberReference(member=accepts, 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)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[checkCharset] operator[SEP] identifier[String] identifier[accepts] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[accepts] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[contains] operator[SEP] identifier[accepts] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] , identifier[Engine] operator[SEP] identifier[ENCODING] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[contains] operator[SEP] identifier[accepts] , literal[String] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[Engine] operator[SEP] identifier[ENCODING] operator[+] literal[String] operator[+] identifier[accepts] operator[SEP] operator[SEP]
}
|
private void validateChildName(String childName) throws IllegalArgumentException, NullPointerException {
if (childName == null) {
throw new NullPointerException("null child name");
}
if (childName.isEmpty()) {
throw new IllegalArgumentException("empty child name");
}
} | class class_name[name] begin[{]
method[validateChildName, return_type[void], modifier[private], parameter[childName]] begin[{]
if[binary_operation[member[.childName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null child name")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[childName.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="empty child name")], 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[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[validateChildName] operator[SEP] identifier[String] identifier[childName] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] , identifier[NullPointerException] {
Keyword[if] operator[SEP] identifier[childName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[childName] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
protected static List<SpecNode> getAllSpecNodes(final ContentSpec contentSpec) {
final List<SpecNode> specNodes = new ArrayList<SpecNode>();
for (final Node childNode : contentSpec.getNodes()) {
if (childNode instanceof SpecNode) {
specNodes.add((SpecNode) childNode);
} else if (childNode instanceof KeyValueNode && ((KeyValueNode) childNode).getValue() instanceof SpecNode) {
specNodes.add((SpecNode) ((KeyValueNode) childNode).getValue());
}
if (childNode instanceof Level) {
specNodes.addAll(getAllSpecNodes((Level) childNode));
}
}
specNodes.addAll(getAllSpecNodes(contentSpec.getBaseLevel()));
return specNodes;
} | class class_name[name] begin[{]
method[getAllSpecNodes, return_type[type[List]], modifier[static protected], parameter[contentSpec]] begin[{]
local_variable[type[List], specNodes]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SpecNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=KeyValueNode, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=Cast(expression=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=KeyValueNode, sub_type=None)), operandr=ReferenceType(arguments=None, dimensions=[], name=SpecNode, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Cast(expression=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=KeyValueNode, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=SpecNode, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=specNodes, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SpecNode, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=specNodes, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Level, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Level, sub_type=None))], member=getAllSpecNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=specNodes, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getNodes, postfix_operators=[], prefix_operators=[], qualifier=contentSpec, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childNode)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None)
call[specNodes.addAll, parameter[call[.getAllSpecNodes, parameter[call[contentSpec.getBaseLevel, parameter[]]]]]]
return[member[.specNodes]]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[List] operator[<] identifier[SpecNode] operator[>] identifier[getAllSpecNodes] operator[SEP] Keyword[final] identifier[ContentSpec] identifier[contentSpec] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[SpecNode] operator[>] identifier[specNodes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[SpecNode] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Node] identifier[childNode] operator[:] identifier[contentSpec] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[childNode] Keyword[instanceof] identifier[SpecNode] operator[SEP] {
identifier[specNodes] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[SpecNode] operator[SEP] identifier[childNode] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[childNode] Keyword[instanceof] identifier[KeyValueNode] operator[&&] operator[SEP] operator[SEP] identifier[KeyValueNode] operator[SEP] identifier[childNode] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] Keyword[instanceof] identifier[SpecNode] operator[SEP] {
identifier[specNodes] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[SpecNode] operator[SEP] operator[SEP] operator[SEP] identifier[KeyValueNode] operator[SEP] identifier[childNode] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[childNode] Keyword[instanceof] identifier[Level] operator[SEP] {
identifier[specNodes] operator[SEP] identifier[addAll] operator[SEP] identifier[getAllSpecNodes] operator[SEP] operator[SEP] identifier[Level] operator[SEP] identifier[childNode] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[specNodes] operator[SEP] identifier[addAll] operator[SEP] identifier[getAllSpecNodes] operator[SEP] identifier[contentSpec] operator[SEP] identifier[getBaseLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[specNodes] operator[SEP]
}
|
public static StructuredType getAndCheckStructuredType(EntityDataModel entityDataModel, Class<?> javaType) {
return checkIsStructuredType(getAndCheckType(entityDataModel, javaType));
} | class class_name[name] begin[{]
method[getAndCheckStructuredType, return_type[type[StructuredType]], modifier[public static], parameter[entityDataModel, javaType]] begin[{]
return[call[.checkIsStructuredType, parameter[call[.getAndCheckType, parameter[member[.entityDataModel], member[.javaType]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[StructuredType] identifier[getAndCheckStructuredType] operator[SEP] identifier[EntityDataModel] identifier[entityDataModel] , identifier[Class] operator[<] operator[?] operator[>] identifier[javaType] operator[SEP] {
Keyword[return] identifier[checkIsStructuredType] operator[SEP] identifier[getAndCheckType] operator[SEP] identifier[entityDataModel] , identifier[javaType] operator[SEP] operator[SEP] operator[SEP]
}
|
public void exit() {
if (exiting()) {
logger.debug("Another thread is shutting down");
return;
}
final long start = System.currentTimeMillis();
//noinspection finally
File exitingSignal = getSignal("exiting");
try {
logger.info(banner("Unloading the main component {}", this.mainComponent));
FileUtils.touch(exitingSignal);
environment.unload(this.mainComponent);
logger.info(banner("Unloaded the main component {}", this.mainComponent));
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
} finally {
FileUtils.deleteQuietly(exitingSignal);
//启动一个额外的线程停止自身
new Thread("Stopper") {
@Override
public void run() {
logger.info(banner("System stops took {}", formatDurationHMS(System.currentTimeMillis() - start)));
System.exit(0);
}
}.start();
}
} | class class_name[name] begin[{]
method[exit, return_type[void], modifier[public], parameter[]] begin[{]
if[call[.exiting, parameter[]]] begin[{]
call[logger.debug, parameter[literal["Another thread is shutting down"]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[long], start]
local_variable[type[File], exitingSignal]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unloading the main component {}"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mainComponent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=banner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exitingSignal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=touch, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mainComponent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=unload, postfix_operators=[], prefix_operators=[], qualifier=environment, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unloaded the main component {}"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mainComponent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=banner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exitingSignal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteQuietly, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stopper")], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="System stops took {}"), MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=formatDurationHMS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=banner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=start, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Thread, sub_type=None)), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[exit] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[exiting] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[final] Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[exitingSignal] operator[=] identifier[getSignal] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[banner] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[mainComponent] operator[SEP] operator[SEP] operator[SEP] identifier[FileUtils] operator[SEP] identifier[touch] operator[SEP] identifier[exitingSignal] operator[SEP] operator[SEP] identifier[environment] operator[SEP] identifier[unload] operator[SEP] Keyword[this] operator[SEP] identifier[mainComponent] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[banner] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[mainComponent] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[FileUtils] operator[SEP] identifier[deleteQuietly] operator[SEP] identifier[exitingSignal] operator[SEP] operator[SEP] Keyword[new] identifier[Thread] operator[SEP] literal[String] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[banner] operator[SEP] literal[String] , identifier[formatDurationHMS] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
} operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Deprecated
private <T> java.security.Identity getCallerIdentity(EJBSecurityCollaborator<T> collaborator, EJSDeployedSupport s)
{
@SuppressWarnings("unchecked")
T uncheckedCookie = s == null ? null : (T) s.securityCookie;
return collaborator.getCallerIdentity(home.beanMetaData, s, uncheckedCookie);
} | class class_name[name] begin[{]
method[getCallerIdentity, return_type[type[java]], modifier[private], parameter[collaborator, s]] begin[{]
local_variable[type[T], uncheckedCookie]
return[call[collaborator.getCallerIdentity, parameter[member[home.beanMetaData], member[.s], member[.uncheckedCookie]]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[private] operator[<] identifier[T] operator[>] identifier[java] operator[SEP] identifier[security] operator[SEP] identifier[Identity] identifier[getCallerIdentity] operator[SEP] identifier[EJBSecurityCollaborator] operator[<] identifier[T] operator[>] identifier[collaborator] , identifier[EJSDeployedSupport] identifier[s] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[T] identifier[uncheckedCookie] operator[=] identifier[s] operator[==] Other[null] operator[?] Other[null] operator[:] operator[SEP] identifier[T] operator[SEP] identifier[s] operator[SEP] identifier[securityCookie] operator[SEP] Keyword[return] identifier[collaborator] operator[SEP] identifier[getCallerIdentity] operator[SEP] identifier[home] operator[SEP] identifier[beanMetaData] , identifier[s] , identifier[uncheckedCookie] operator[SEP] operator[SEP]
}
|
private void delay(long multiplier) {
try {
// Wait for the timeout to finish
Thread.sleep(TimeUnit.SECONDS.toMillis(RETRY_DELAY * multiplier));
} catch (InterruptedException ex) {
// Doesn't matter if we're interrupted
}
} | class class_name[name] begin[{]
method[delay, return_type[void], modifier[private], parameter[multiplier]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=RETRY_DELAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=multiplier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=toMillis, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit.SECONDS, selectors=[], type_arguments=None)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[delay] operator[SEP] Keyword[long] identifier[multiplier] operator[SEP] {
Keyword[try] {
identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] identifier[toMillis] operator[SEP] identifier[RETRY_DELAY] operator[*] identifier[multiplier] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ex] operator[SEP] {
}
}
|
@Override
public String getRevisionId() {
if (isReload(REVISION_ID_RELOAD)) {
setReload(REVISION_ID_RELOAD);
sa.setRevisionId(read().getRevisionId());
}
return sa.getRevisionId();
} | class class_name[name] begin[{]
method[getRevisionId, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[call[.isReload, parameter[member[.REVISION_ID_RELOAD]]]] begin[{]
call[.setReload, parameter[member[.REVISION_ID_RELOAD]]]
call[sa.setRevisionId, parameter[call[.read, parameter[]]]]
else begin[{]
None
end[}]
return[call[sa.getRevisionId, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getRevisionId] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isReload] operator[SEP] identifier[REVISION_ID_RELOAD] operator[SEP] operator[SEP] {
identifier[setReload] operator[SEP] identifier[REVISION_ID_RELOAD] operator[SEP] operator[SEP] identifier[sa] operator[SEP] identifier[setRevisionId] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sa] operator[SEP] identifier[getRevisionId] operator[SEP] operator[SEP] operator[SEP]
}
|
public static List<?> workbook2List(String xmlPath, Workbook wb) throws Exception {
//获取配置文件
ExcelConfig config = getEasyExcel(xmlPath);
return workbook2List(config, wb);
} | class class_name[name] begin[{]
method[workbook2List, return_type[type[List]], modifier[public static], parameter[xmlPath, wb]] begin[{]
local_variable[type[ExcelConfig], config]
return[call[.workbook2List, parameter[member[.config], member[.wb]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] operator[?] operator[>] identifier[workbook2List] operator[SEP] identifier[String] identifier[xmlPath] , identifier[Workbook] identifier[wb] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[ExcelConfig] identifier[config] operator[=] identifier[getEasyExcel] operator[SEP] identifier[xmlPath] operator[SEP] operator[SEP] Keyword[return] identifier[workbook2List] operator[SEP] identifier[config] , identifier[wb] operator[SEP] operator[SEP]
}
|
public ResultType setIndustry(Industry industry) {
LOG.debug("设置行业......");
BeanUtil.requireNonNull(industry, "行业对象为空");
String url = BASE_API_URL + "cgi-bin/template/api_set_industry?access_token=#";
BaseResponse response = executePost(url, industry.toJsonString());
return ResultType.get(response.getErrcode());
} | class class_name[name] begin[{]
method[setIndustry, return_type[type[ResultType]], modifier[public], parameter[industry]] begin[{]
call[LOG.debug, parameter[literal["设置行业......"]]]
call[BeanUtil.requireNonNull, parameter[member[.industry], literal["行业对象为空"]]]
local_variable[type[String], url]
local_variable[type[BaseResponse], response]
return[call[ResultType.get, parameter[call[response.getErrcode, parameter[]]]]]
end[}]
END[}] | Keyword[public] identifier[ResultType] identifier[setIndustry] operator[SEP] identifier[Industry] identifier[industry] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[BeanUtil] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[industry] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[BASE_API_URL] operator[+] literal[String] operator[SEP] identifier[BaseResponse] identifier[response] operator[=] identifier[executePost] operator[SEP] identifier[url] , identifier[industry] operator[SEP] identifier[toJsonString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ResultType] operator[SEP] identifier[get] operator[SEP] identifier[response] operator[SEP] identifier[getErrcode] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public ClassFile addInnerClass(String fullInnerClassName, String innerClassName,
String superClassName) {
if (fullInnerClassName == null) {
if (innerClassName == null) {
fullInnerClassName = mClassName + '$' + (++mAnonymousInnerClassCount);
} else {
fullInnerClassName = mClassName + '$' + innerClassName;
}
}
ClassFile inner = new ClassFile(fullInnerClassName, superClassName);
Modifiers modifiers = inner.getModifiers().toPrivate(true).toStatic(true);
inner.setModifiers(modifiers);
inner.mInnerClassName = innerClassName;
inner.mOuterClass = this;
if (mInnerClasses == null) {
mInnerClasses = new ArrayList<ClassFile>();
}
mInnerClasses.add(inner);
// Record the inner class in this, the outer class.
if (mInnerClassesAttr == null) {
addAttribute(new InnerClassesAttr(mCp));
}
// TODO: Anonymous inner classes and method scoped classes do not have
// an outer class listed.
mInnerClassesAttr.addInnerClass(fullInnerClassName, mClassName,
innerClassName, modifiers);
// Record the inner class in itself.
inner.addAttribute(new InnerClassesAttr(inner.getConstantPool()));
inner.mInnerClassesAttr.addInnerClass(fullInnerClassName, mClassName,
innerClassName, modifiers);
return inner;
} | class class_name[name] begin[{]
method[addInnerClass, return_type[type[ClassFile]], modifier[public], parameter[fullInnerClassName, innerClassName, superClassName]] begin[{]
if[binary_operation[member[.fullInnerClassName], ==, literal[null]]] begin[{]
if[binary_operation[member[.innerClassName], ==, literal[null]]] begin[{]
assign[member[.fullInnerClassName], binary_operation[binary_operation[member[.mClassName], +, literal['$']], +, member[.mAnonymousInnerClassCount]]]
else begin[{]
assign[member[.fullInnerClassName], binary_operation[binary_operation[member[.mClassName], +, literal['$']], +, member[.innerClassName]]]
end[}]
else begin[{]
None
end[}]
local_variable[type[ClassFile], inner]
local_variable[type[Modifiers], modifiers]
call[inner.setModifiers, parameter[member[.modifiers]]]
assign[member[inner.mInnerClassName], member[.innerClassName]]
assign[member[inner.mOuterClass], THIS[]]
if[binary_operation[member[.mInnerClasses], ==, literal[null]]] begin[{]
assign[member[.mInnerClasses], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassFile, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
call[mInnerClasses.add, parameter[member[.inner]]]
if[binary_operation[member[.mInnerClassesAttr], ==, literal[null]]] begin[{]
call[.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=mCp, 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=InnerClassesAttr, sub_type=None))]]
else begin[{]
None
end[}]
call[mInnerClassesAttr.addInnerClass, parameter[member[.fullInnerClassName], member[.mClassName], member[.innerClassName], member[.modifiers]]]
call[inner.addAttribute, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getConstantPool, postfix_operators=[], prefix_operators=[], qualifier=inner, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InnerClassesAttr, sub_type=None))]]
call[inner.mInnerClassesAttr.addInnerClass, parameter[member[.fullInnerClassName], member[.mClassName], member[.innerClassName], member[.modifiers]]]
return[member[.inner]]
end[}]
END[}] | Keyword[public] identifier[ClassFile] identifier[addInnerClass] operator[SEP] identifier[String] identifier[fullInnerClassName] , identifier[String] identifier[innerClassName] , identifier[String] identifier[superClassName] operator[SEP] {
Keyword[if] operator[SEP] identifier[fullInnerClassName] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[innerClassName] operator[==] Other[null] operator[SEP] {
identifier[fullInnerClassName] operator[=] identifier[mClassName] operator[+] literal[String] operator[+] operator[SEP] operator[++] identifier[mAnonymousInnerClassCount] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[fullInnerClassName] operator[=] identifier[mClassName] operator[+] literal[String] operator[+] identifier[innerClassName] operator[SEP]
}
}
identifier[ClassFile] identifier[inner] operator[=] Keyword[new] identifier[ClassFile] operator[SEP] identifier[fullInnerClassName] , identifier[superClassName] operator[SEP] operator[SEP] identifier[Modifiers] identifier[modifiers] operator[=] identifier[inner] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] identifier[toPrivate] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[toStatic] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[inner] operator[SEP] identifier[setModifiers] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] identifier[inner] operator[SEP] identifier[mInnerClassName] operator[=] identifier[innerClassName] operator[SEP] identifier[inner] operator[SEP] identifier[mOuterClass] operator[=] Keyword[this] operator[SEP] Keyword[if] operator[SEP] identifier[mInnerClasses] operator[==] Other[null] operator[SEP] {
identifier[mInnerClasses] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ClassFile] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
identifier[mInnerClasses] operator[SEP] identifier[add] operator[SEP] identifier[inner] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mInnerClassesAttr] operator[==] Other[null] operator[SEP] {
identifier[addAttribute] operator[SEP] Keyword[new] identifier[InnerClassesAttr] operator[SEP] identifier[mCp] operator[SEP] operator[SEP] operator[SEP]
}
identifier[mInnerClassesAttr] operator[SEP] identifier[addInnerClass] operator[SEP] identifier[fullInnerClassName] , identifier[mClassName] , identifier[innerClassName] , identifier[modifiers] operator[SEP] operator[SEP] identifier[inner] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[InnerClassesAttr] operator[SEP] identifier[inner] operator[SEP] identifier[getConstantPool] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[inner] operator[SEP] identifier[mInnerClassesAttr] operator[SEP] identifier[addInnerClass] operator[SEP] identifier[fullInnerClassName] , identifier[mClassName] , identifier[innerClassName] , identifier[modifiers] operator[SEP] operator[SEP] Keyword[return] identifier[inner] operator[SEP]
}
|
public T nextElement() {
T rc = null;
if (null == this.myIterator) {
rc = this.singleton;
this.singleton = null;
} else {
rc = this.myIterator.next();
}
return rc;
} | class class_name[name] begin[{]
method[nextElement, return_type[type[T]], modifier[public], parameter[]] begin[{]
local_variable[type[T], rc]
if[binary_operation[literal[null], ==, THIS[member[None.myIterator]]]] begin[{]
assign[member[.rc], THIS[member[None.singleton]]]
assign[THIS[member[None.singleton]], literal[null]]
else begin[{]
assign[member[.rc], THIS[member[None.myIterator]call[None.next, parameter[]]]]
end[}]
return[member[.rc]]
end[}]
END[}] | Keyword[public] identifier[T] identifier[nextElement] operator[SEP] operator[SEP] {
identifier[T] identifier[rc] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] Keyword[this] operator[SEP] identifier[myIterator] operator[SEP] {
identifier[rc] operator[=] Keyword[this] operator[SEP] identifier[singleton] operator[SEP] Keyword[this] operator[SEP] identifier[singleton] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
identifier[rc] operator[=] Keyword[this] operator[SEP] identifier[myIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[rc] operator[SEP]
}
|
public int update (Connection conn, T obj)
throws SQLException
{
return update(conn, obj, null);
} | class class_name[name] begin[{]
method[update, return_type[type[int]], modifier[public], parameter[conn, obj]] begin[{]
return[call[.update, parameter[member[.conn], member[.obj], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[update] operator[SEP] identifier[Connection] identifier[conn] , identifier[T] identifier[obj] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[return] identifier[update] operator[SEP] identifier[conn] , identifier[obj] , Other[null] operator[SEP] operator[SEP]
}
|
public static IConjunct negate( IConjunct conjunct)
{
AnyOf anyOf = new AnyOf();
for( Iterator<IDisjunct> disjuncts = conjunct.getDisjuncts();
disjuncts.hasNext();)
{
Conjunction conjunction = new Conjunction();
for( Iterator<IAssertion> assertions = disjuncts.next().getAssertions();
assertions.hasNext();)
{
conjunction.add( assertions.next().negate());
}
anyOf.add( simplify( conjunction));
}
return Cnf.convert( anyOf);
} | class class_name[name] begin[{]
method[negate, return_type[type[IConjunct]], modifier[public static], parameter[conjunct]] begin[{]
local_variable[type[AnyOf], anyOf]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Conjunction, sub_type=None)), name=conjunction)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Conjunction, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=assertions, selectors=[MethodInvocation(arguments=[], member=negate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=conjunction, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=assertions, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=disjuncts, selectors=[MethodInvocation(arguments=[], member=getAssertions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=assertions)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IAssertion, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=conjunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=simplify, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=anyOf, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=disjuncts, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getDisjuncts, postfix_operators=[], prefix_operators=[], qualifier=conjunct, selectors=[], type_arguments=None), name=disjuncts)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IDisjunct, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[call[Cnf.convert, parameter[member[.anyOf]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IConjunct] identifier[negate] operator[SEP] identifier[IConjunct] identifier[conjunct] operator[SEP] {
identifier[AnyOf] identifier[anyOf] operator[=] Keyword[new] identifier[AnyOf] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[IDisjunct] operator[>] identifier[disjuncts] operator[=] identifier[conjunct] operator[SEP] identifier[getDisjuncts] operator[SEP] operator[SEP] operator[SEP] identifier[disjuncts] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Conjunction] identifier[conjunction] operator[=] Keyword[new] identifier[Conjunction] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[IAssertion] operator[>] identifier[assertions] operator[=] identifier[disjuncts] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[getAssertions] operator[SEP] operator[SEP] operator[SEP] identifier[assertions] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[conjunction] operator[SEP] identifier[add] operator[SEP] identifier[assertions] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[negate] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[anyOf] operator[SEP] identifier[add] operator[SEP] identifier[simplify] operator[SEP] identifier[conjunction] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Cnf] operator[SEP] identifier[convert] operator[SEP] identifier[anyOf] operator[SEP] operator[SEP]
}
|
public static FeedLoadResult export (String feedId, String outFile, DataSource dataSource, boolean fromEditor) {
JdbcGtfsExporter exporter = new JdbcGtfsExporter(feedId, outFile, dataSource, fromEditor);
FeedLoadResult result = exporter.exportTables();
return result;
} | class class_name[name] begin[{]
method[export, return_type[type[FeedLoadResult]], modifier[public static], parameter[feedId, outFile, dataSource, fromEditor]] begin[{]
local_variable[type[JdbcGtfsExporter], exporter]
local_variable[type[FeedLoadResult], result]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[FeedLoadResult] identifier[export] operator[SEP] identifier[String] identifier[feedId] , identifier[String] identifier[outFile] , identifier[DataSource] identifier[dataSource] , Keyword[boolean] identifier[fromEditor] operator[SEP] {
identifier[JdbcGtfsExporter] identifier[exporter] operator[=] Keyword[new] identifier[JdbcGtfsExporter] operator[SEP] identifier[feedId] , identifier[outFile] , identifier[dataSource] , identifier[fromEditor] operator[SEP] operator[SEP] identifier[FeedLoadResult] identifier[result] operator[=] identifier[exporter] operator[SEP] identifier[exportTables] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public <T> List<T> readExcel2Objects(InputStream is, Class<T> clazz)
throws Excel4JException, IOException, InvalidFormatException {
return readExcel2Objects(is, clazz, 0, Integer.MAX_VALUE, 0);
} | class class_name[name] begin[{]
method[readExcel2Objects, return_type[type[List]], modifier[public], parameter[is, clazz]] begin[{]
return[call[.readExcel2Objects, parameter[member[.is], member[.clazz], literal[0], member[Integer.MAX_VALUE], literal[0]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[readExcel2Objects] operator[SEP] identifier[InputStream] identifier[is] , identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] Keyword[throws] identifier[Excel4JException] , identifier[IOException] , identifier[InvalidFormatException] {
Keyword[return] identifier[readExcel2Objects] operator[SEP] identifier[is] , identifier[clazz] , Other[0] , identifier[Integer] operator[SEP] identifier[MAX_VALUE] , Other[0] operator[SEP] operator[SEP]
}
|
public Command readPDUHeader(DataInputStream in)
throws InvalidCommandLengthException, IOException {
synchronized (in) {
return pduReader.readPDUHeader(in);
}
} | class class_name[name] begin[{]
method[readPDUHeader, return_type[type[Command]], modifier[public], parameter[in]] begin[{]
SYNCHRONIZED[member[.in]] BEGIN[{]
return[call[pduReader.readPDUHeader, parameter[member[.in]]]]
END[}]
end[}]
END[}] | Keyword[public] identifier[Command] identifier[readPDUHeader] operator[SEP] identifier[DataInputStream] identifier[in] operator[SEP] Keyword[throws] identifier[InvalidCommandLengthException] , identifier[IOException] {
Keyword[synchronized] operator[SEP] identifier[in] operator[SEP] {
Keyword[return] identifier[pduReader] operator[SEP] identifier[readPDUHeader] operator[SEP] identifier[in] operator[SEP] operator[SEP]
}
}
|
public static boolean hasWarnedDeprecation(String name) {
DeprecationContext deprecations = deprecationContext.get();
if(deprecations.getDeprecatedKeyMap().containsKey(name)) {
if(deprecations.getDeprecatedKeyMap().get(name).accessed.get()) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[hasWarnedDeprecation, return_type[type[boolean]], modifier[public static], parameter[name]] begin[{]
local_variable[type[DeprecationContext], deprecations]
if[call[deprecations.getDeprecatedKeyMap, parameter[]]] begin[{]
if[call[deprecations.getDeprecatedKeyMap, parameter[]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[hasWarnedDeprecation] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[DeprecationContext] identifier[deprecations] operator[=] identifier[deprecationContext] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deprecations] operator[SEP] identifier[getDeprecatedKeyMap] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[deprecations] operator[SEP] identifier[getDeprecatedKeyMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[accessed] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private D createAndRegisterDeclaration(Map<String, Object> metadata) {
D declaration;
if (klass.equals(ImportDeclaration.class)) {
declaration = (D) ImportDeclarationBuilder.fromMetadata(metadata).build();
} else if (klass.equals(ExportDeclaration.class)) {
declaration = (D) ExportDeclarationBuilder.fromMetadata(metadata).build();
} else {
throw new IllegalStateException("");
}
declarationRegistrationManager.registerDeclaration(declaration);
return declaration;
} | class class_name[name] begin[{]
method[createAndRegisterDeclaration, return_type[type[D]], modifier[private], parameter[metadata]] begin[{]
local_variable[type[D], declaration]
if[call[klass.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ImportDeclaration, sub_type=None))]]] begin[{]
assign[member[.declaration], Cast(expression=MethodInvocation(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromMetadata, postfix_operators=[], prefix_operators=[], qualifier=ImportDeclarationBuilder, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None))]
else begin[{]
if[call[klass.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExportDeclaration, sub_type=None))]]] begin[{]
assign[member[.declaration], Cast(expression=MethodInvocation(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromMetadata, postfix_operators=[], prefix_operators=[], qualifier=ExportDeclarationBuilder, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None))]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], 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[}]
call[declarationRegistrationManager.registerDeclaration, parameter[member[.declaration]]]
return[member[.declaration]]
end[}]
END[}] | Keyword[private] identifier[D] identifier[createAndRegisterDeclaration] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[metadata] operator[SEP] {
identifier[D] identifier[declaration] operator[SEP] Keyword[if] operator[SEP] identifier[klass] operator[SEP] identifier[equals] operator[SEP] identifier[ImportDeclaration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[declaration] operator[=] operator[SEP] identifier[D] operator[SEP] identifier[ImportDeclarationBuilder] operator[SEP] identifier[fromMetadata] operator[SEP] identifier[metadata] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[klass] operator[SEP] identifier[equals] operator[SEP] identifier[ExportDeclaration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[declaration] operator[=] operator[SEP] identifier[D] operator[SEP] identifier[ExportDeclarationBuilder] operator[SEP] identifier[fromMetadata] operator[SEP] identifier[metadata] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[declarationRegistrationManager] operator[SEP] identifier[registerDeclaration] operator[SEP] identifier[declaration] operator[SEP] operator[SEP] Keyword[return] identifier[declaration] operator[SEP]
}
|
public ItemImpl getItemByIdentifier(String identifier, boolean pool) throws RepositoryException
{
return getItemByIdentifier(identifier, pool, true);
} | class class_name[name] begin[{]
method[getItemByIdentifier, return_type[type[ItemImpl]], modifier[public], parameter[identifier, pool]] begin[{]
return[call[.getItemByIdentifier, parameter[member[.identifier], member[.pool], literal[true]]]]
end[}]
END[}] | Keyword[public] identifier[ItemImpl] identifier[getItemByIdentifier] operator[SEP] identifier[String] identifier[identifier] , Keyword[boolean] identifier[pool] operator[SEP] Keyword[throws] identifier[RepositoryException] {
Keyword[return] identifier[getItemByIdentifier] operator[SEP] identifier[identifier] , identifier[pool] , literal[boolean] operator[SEP] operator[SEP]
}
|
private static String createRowSeperator(List<Integer> maxColumnSizes) {
StringBuilder rowSeparator = new StringBuilder("+");
for (int maxColumnSize : maxColumnSizes) {
rowSeparator.append(Strings.repeat("-", maxColumnSize + 2)).append("+");
}
return rowSeparator.append("\n").toString();
} | class class_name[name] begin[{]
method[createRowSeperator, return_type[type[String]], modifier[private static], parameter[maxColumnSizes]] begin[{]
local_variable[type[StringBuilder], rowSeparator]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), BinaryOperation(operandl=MemberReference(member=maxColumnSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=repeat, postfix_operators=[], prefix_operators=[], qualifier=Strings, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=rowSeparator, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=maxColumnSizes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=maxColumnSize)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None)
return[call[rowSeparator.append, parameter[literal["\n"]]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[createRowSeperator] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[maxColumnSizes] operator[SEP] {
identifier[StringBuilder] identifier[rowSeparator] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[maxColumnSize] operator[:] identifier[maxColumnSizes] operator[SEP] {
identifier[rowSeparator] operator[SEP] identifier[append] operator[SEP] identifier[Strings] operator[SEP] identifier[repeat] operator[SEP] literal[String] , identifier[maxColumnSize] operator[+] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[rowSeparator] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public CircuitGroupBlockingAckMessage createCGBA() {
CircuitGroupBlockingAckMessageImpl cgba = new CircuitGroupBlockingAckMessageImpl(_CGBA_HOLDER.mandatoryCodes,
_CGBA_HOLDER.mandatoryVariableCodes, _CGBA_HOLDER.optionalCodes, _CGBA_HOLDER.mandatoryCodeToIndex,
_CGBA_HOLDER.mandatoryVariableCodeToIndex, _CGBA_HOLDER.optionalCodeToIndex);
return cgba;
} | class class_name[name] begin[{]
method[createCGBA, return_type[type[CircuitGroupBlockingAckMessage]], modifier[public], parameter[]] begin[{]
local_variable[type[CircuitGroupBlockingAckMessageImpl], cgba]
return[member[.cgba]]
end[}]
END[}] | Keyword[public] identifier[CircuitGroupBlockingAckMessage] identifier[createCGBA] operator[SEP] operator[SEP] {
identifier[CircuitGroupBlockingAckMessageImpl] identifier[cgba] operator[=] Keyword[new] identifier[CircuitGroupBlockingAckMessageImpl] operator[SEP] identifier[_CGBA_HOLDER] operator[SEP] identifier[mandatoryCodes] , identifier[_CGBA_HOLDER] operator[SEP] identifier[mandatoryVariableCodes] , identifier[_CGBA_HOLDER] operator[SEP] identifier[optionalCodes] , identifier[_CGBA_HOLDER] operator[SEP] identifier[mandatoryCodeToIndex] , identifier[_CGBA_HOLDER] operator[SEP] identifier[mandatoryVariableCodeToIndex] , identifier[_CGBA_HOLDER] operator[SEP] identifier[optionalCodeToIndex] operator[SEP] operator[SEP] Keyword[return] identifier[cgba] operator[SEP]
}
|
@Override
void _parseMappings(String aStr, String aSourceRoot) {
this.__generatedMappings = new ArrayList<>();
this.__originalMappings = new ArrayList<>();
for (int i = 0; i < this._sections.size(); i++) {
ParsedSection section = this._sections.get(i);
List<ParsedMapping> sectionMappings = section.consumer._generatedMappings();
for (int j = 0; j < sectionMappings.size(); j++) {
ParsedMapping mapping = sectionMappings.get(j);
String source = section.consumer._sources.at(mapping.source);
if (section.consumer.sourceRoot != null) {
source = Util.join(section.consumer.sourceRoot, source);
}
this._sources.add(source);
Integer source_ = this._sources.indexOf(source);
String name = section.consumer._names.at(mapping.name);
this._names.add(name);
Integer name_ = this._names.indexOf(name);
// The mappings coming from the consumer for the section have
// generated positions relative to the start of the section, so we
// need to offset them to be relative to the start of the concatenated
// generated file.
ParsedMapping adjustedMapping = new ParsedMapping(mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
mapping.generatedColumn + ((section.generatedOffset.generatedLine == mapping.generatedLine)
? section.generatedOffset.generatedColumn - 1 : 0),
mapping.originalLine, mapping.originalColumn, source_, name_);
this.__generatedMappings.add(adjustedMapping);
if (adjustedMapping.originalLine != null) {
this.__originalMappings.add(adjustedMapping);
}
}
}
Collections.sort(this.__generatedMappings, Util::compareByGeneratedPositionsDeflated);
Collections.sort(this.__originalMappings, Util::compareByOriginalPositions);
} | class class_name[name] begin[{]
method[_parseMappings, return_type[void], modifier[default], parameter[aStr, aSourceRoot]] begin[{]
assign[THIS[member[None.__generatedMappings]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
assign[THIS[member[None.__originalMappings]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=_sections, 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)]), name=section)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParsedSection, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=_generatedMappings, postfix_operators=[], prefix_operators=[], qualifier=section.consumer, selectors=[], type_arguments=None), name=sectionMappings)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ParsedMapping, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=sectionMappings, selectors=[], type_arguments=None), name=mapping)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParsedMapping, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=mapping, selectors=[])], member=at, postfix_operators=[], prefix_operators=[], qualifier=section.consumer._sources, selectors=[], type_arguments=None), name=source)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sourceRoot, postfix_operators=[], prefix_operators=[], qualifier=section.consumer, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=sourceRoot, postfix_operators=[], prefix_operators=[], qualifier=section.consumer, selectors=[]), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=_sources, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, 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=[MemberReference(member=_sources, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=source_)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=mapping, selectors=[])], member=at, postfix_operators=[], prefix_operators=[], qualifier=section.consumer._names, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=_names, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, 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=[MemberReference(member=_names, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=name_)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=generatedLine, postfix_operators=[], prefix_operators=[], qualifier=mapping, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=generatedLine, postfix_operators=[], prefix_operators=[], qualifier=section.generatedOffset, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=+), BinaryOperation(operandl=MemberReference(member=generatedColumn, postfix_operators=[], prefix_operators=[], qualifier=mapping, selectors=[]), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=generatedLine, postfix_operators=[], prefix_operators=[], qualifier=section.generatedOffset, selectors=[]), operandr=MemberReference(member=generatedLine, postfix_operators=[], prefix_operators=[], qualifier=mapping, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=BinaryOperation(operandl=MemberReference(member=generatedColumn, postfix_operators=[], prefix_operators=[], qualifier=section.generatedOffset, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), operator=+), MemberReference(member=originalLine, postfix_operators=[], prefix_operators=[], qualifier=mapping, selectors=[]), MemberReference(member=originalColumn, postfix_operators=[], prefix_operators=[], qualifier=mapping, selectors=[]), MemberReference(member=source_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name_, 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=ParsedMapping, sub_type=None)), name=adjustedMapping)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParsedMapping, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=__generatedMappings, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=adjustedMapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=originalLine, postfix_operators=[], prefix_operators=[], qualifier=adjustedMapping, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=__originalMappings, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=adjustedMapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sectionMappings, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), 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=_sections, 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)
call[Collections.sort, parameter[THIS[member[None.__generatedMappings]], MethodReference(expression=MemberReference(member=Util, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=compareByGeneratedPositionsDeflated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]
call[Collections.sort, parameter[THIS[member[None.__originalMappings]], MethodReference(expression=MemberReference(member=Util, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=compareByOriginalPositions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[void] identifier[_parseMappings] operator[SEP] identifier[String] identifier[aStr] , identifier[String] identifier[aSourceRoot] operator[SEP] {
Keyword[this] operator[SEP] identifier[__generatedMappings] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[__originalMappings] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] 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[_sections] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[ParsedSection] identifier[section] operator[=] Keyword[this] operator[SEP] identifier[_sections] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ParsedMapping] operator[>] identifier[sectionMappings] operator[=] identifier[section] operator[SEP] identifier[consumer] operator[SEP] identifier[_generatedMappings] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[sectionMappings] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[ParsedMapping] identifier[mapping] operator[=] identifier[sectionMappings] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[String] identifier[source] operator[=] identifier[section] operator[SEP] identifier[consumer] operator[SEP] identifier[_sources] operator[SEP] identifier[at] operator[SEP] identifier[mapping] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[section] operator[SEP] identifier[consumer] operator[SEP] identifier[sourceRoot] operator[!=] Other[null] operator[SEP] {
identifier[source] operator[=] identifier[Util] operator[SEP] identifier[join] operator[SEP] identifier[section] operator[SEP] identifier[consumer] operator[SEP] identifier[sourceRoot] , identifier[source] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[_sources] operator[SEP] identifier[add] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[Integer] identifier[source_] operator[=] Keyword[this] operator[SEP] identifier[_sources] operator[SEP] identifier[indexOf] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[section] operator[SEP] identifier[consumer] operator[SEP] identifier[_names] operator[SEP] identifier[at] operator[SEP] identifier[mapping] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[_names] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Integer] identifier[name_] operator[=] Keyword[this] operator[SEP] identifier[_names] operator[SEP] identifier[indexOf] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[ParsedMapping] identifier[adjustedMapping] operator[=] Keyword[new] identifier[ParsedMapping] operator[SEP] identifier[mapping] operator[SEP] identifier[generatedLine] operator[+] operator[SEP] identifier[section] operator[SEP] identifier[generatedOffset] operator[SEP] identifier[generatedLine] operator[-] Other[1] operator[SEP] , identifier[mapping] operator[SEP] identifier[generatedColumn] operator[+] operator[SEP] operator[SEP] identifier[section] operator[SEP] identifier[generatedOffset] operator[SEP] identifier[generatedLine] operator[==] identifier[mapping] operator[SEP] identifier[generatedLine] operator[SEP] operator[?] identifier[section] operator[SEP] identifier[generatedOffset] operator[SEP] identifier[generatedColumn] operator[-] Other[1] operator[:] Other[0] operator[SEP] , identifier[mapping] operator[SEP] identifier[originalLine] , identifier[mapping] operator[SEP] identifier[originalColumn] , identifier[source_] , identifier[name_] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[__generatedMappings] operator[SEP] identifier[add] operator[SEP] identifier[adjustedMapping] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[adjustedMapping] operator[SEP] identifier[originalLine] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[__originalMappings] operator[SEP] identifier[add] operator[SEP] identifier[adjustedMapping] operator[SEP] operator[SEP]
}
}
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] Keyword[this] operator[SEP] identifier[__generatedMappings] , identifier[Util] operator[::] identifier[compareByGeneratedPositionsDeflated] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] Keyword[this] operator[SEP] identifier[__originalMappings] , identifier[Util] operator[::] identifier[compareByOriginalPositions] operator[SEP] operator[SEP]
}
|
public static <C extends Comparable<?>> Range<C> encloseAll(Iterable<C> values) {
checkNotNull(values);
if (values instanceof ContiguousSet) {
return ((ContiguousSet<C>) values).range();
}
Iterator<C> valueIterator = values.iterator();
C min = checkNotNull(valueIterator.next());
C max = min;
while (valueIterator.hasNext()) {
C value = checkNotNull(valueIterator.next());
min = Ordering.natural().min(min, value);
max = Ordering.natural().max(max, value);
}
return closed(min, max);
} | class class_name[name] begin[{]
method[encloseAll, return_type[type[Range]], modifier[public static], parameter[values]] begin[{]
call[.checkNotNull, parameter[member[.values]]]
if[binary_operation[member[.values], instanceof, type[ContiguousSet]]] begin[{]
return[Cast(expression=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))], dimensions=[], name=ContiguousSet, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[Iterator], valueIterator]
local_variable[type[C], min]
local_variable[type[C], max]
while[call[valueIterator.hasNext, parameter[]]] begin[{]
local_variable[type[C], value]
assign[member[.min], call[Ordering.natural, parameter[]]]
assign[member[.max], call[Ordering.natural, parameter[]]]
end[}]
return[call[.closed, parameter[member[.min], member[.max]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[C] Keyword[extends] identifier[Comparable] operator[<] operator[?] operator[>] operator[>] identifier[Range] operator[<] identifier[C] operator[>] identifier[encloseAll] operator[SEP] identifier[Iterable] operator[<] identifier[C] operator[>] identifier[values] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[values] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] Keyword[instanceof] identifier[ContiguousSet] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[ContiguousSet] operator[<] identifier[C] operator[>] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[range] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Iterator] operator[<] identifier[C] operator[>] identifier[valueIterator] operator[=] identifier[values] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[C] identifier[min] operator[=] identifier[checkNotNull] operator[SEP] identifier[valueIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[C] identifier[max] operator[=] identifier[min] operator[SEP] Keyword[while] operator[SEP] identifier[valueIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[C] identifier[value] operator[=] identifier[checkNotNull] operator[SEP] identifier[valueIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[min] operator[=] identifier[Ordering] operator[SEP] identifier[natural] operator[SEP] operator[SEP] operator[SEP] identifier[min] operator[SEP] identifier[min] , identifier[value] operator[SEP] operator[SEP] identifier[max] operator[=] identifier[Ordering] operator[SEP] identifier[natural] operator[SEP] operator[SEP] operator[SEP] identifier[max] operator[SEP] identifier[max] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[return] identifier[closed] operator[SEP] identifier[min] , identifier[max] operator[SEP] operator[SEP]
}
|
private void startConsumerThread() {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
while (Boolean.TRUE) {
processQueue();
}
}
}, "ESMetricsConsumer"); //$NON-NLS-1$
thread.setDaemon(true);
thread.start();
} | class class_name[name] begin[{]
method[startConsumerThread, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[Thread], thread]
call[thread.setDaemon, parameter[literal[true]]]
call[thread.start, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[startConsumerThread] operator[SEP] operator[SEP] {
identifier[Thread] identifier[thread] operator[=] Keyword[new] identifier[Thread] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[while] operator[SEP] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] {
identifier[processQueue] operator[SEP] operator[SEP] operator[SEP]
}
}
} , literal[String] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[setDaemon] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Entry<K, V> lowerEntry(K key)
{
Entry<K, V> entry = entry(key, null);
return entrySet.lower(entry);
} | class class_name[name] begin[{]
method[lowerEntry, return_type[type[Entry]], modifier[public], parameter[key]] begin[{]
local_variable[type[Entry], entry]
return[call[entrySet.lower, parameter[member[.entry]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[lowerEntry] operator[SEP] identifier[K] identifier[key] operator[SEP] {
identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[=] identifier[entry] operator[SEP] identifier[key] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[entrySet] operator[SEP] identifier[lower] operator[SEP] identifier[entry] operator[SEP] operator[SEP]
}
|
public JsonNode callMethod(final JsiiObjectRef objRef, final String method, final ArrayNode args) {
ObjectNode req = makeRequest("invoke", objRef);
req.put("method", method);
req.set("args", args);
JsonNode resp = this.runtime.requestResponse(req);
return resp.get("result");
} | class class_name[name] begin[{]
method[callMethod, return_type[type[JsonNode]], modifier[public], parameter[objRef, method, args]] begin[{]
local_variable[type[ObjectNode], req]
call[req.put, parameter[literal["method"], member[.method]]]
call[req.set, parameter[literal["args"], member[.args]]]
local_variable[type[JsonNode], resp]
return[call[resp.get, parameter[literal["result"]]]]
end[}]
END[}] | Keyword[public] identifier[JsonNode] identifier[callMethod] operator[SEP] Keyword[final] identifier[JsiiObjectRef] identifier[objRef] , Keyword[final] identifier[String] identifier[method] , Keyword[final] identifier[ArrayNode] identifier[args] operator[SEP] {
identifier[ObjectNode] identifier[req] operator[=] identifier[makeRequest] operator[SEP] literal[String] , identifier[objRef] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[method] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[set] operator[SEP] literal[String] , identifier[args] operator[SEP] operator[SEP] identifier[JsonNode] identifier[resp] operator[=] Keyword[this] operator[SEP] identifier[runtime] operator[SEP] identifier[requestResponse] operator[SEP] identifier[req] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public CompletableFuture<Map<Long, Integer>> holderStatus() {
return getProxyClient().applyBy(name(), service -> service.holderStatus());
} | class class_name[name] begin[{]
method[holderStatus, return_type[type[CompletableFuture]], modifier[public], parameter[]] begin[{]
return[call[.getProxyClient, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[CompletableFuture] operator[<] identifier[Map] operator[<] identifier[Long] , identifier[Integer] operator[>] operator[>] identifier[holderStatus] operator[SEP] operator[SEP] {
Keyword[return] identifier[getProxyClient] operator[SEP] operator[SEP] operator[SEP] identifier[applyBy] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[service] operator[->] identifier[service] operator[SEP] identifier[holderStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private ImmutableMultimap<IRI, Datatype> computeDataTypeMap(ClassifiedTBox reasoner) {
// TODO: switch to guava > 2.1, and replace by Streams.stream(iterable)
return StreamSupport.stream(reasoner.dataRangesDAG().spliterator(), false)
.flatMap(n -> getPartialPredicateToDatatypeMap(n, reasoner).entrySet().stream())
.collect(ImmutableCollectors.toMultimap(
e -> e.getKey(),
Map.Entry::getValue));
} | class class_name[name] begin[{]
method[computeDataTypeMap, return_type[type[ImmutableMultimap]], modifier[private], parameter[reasoner]] begin[{]
return[call[StreamSupport.stream, parameter[call[reasoner.dataRangesDAG, parameter[]], literal[false]]]]
end[}]
END[}] | Keyword[private] identifier[ImmutableMultimap] operator[<] identifier[IRI] , identifier[Datatype] operator[>] identifier[computeDataTypeMap] operator[SEP] identifier[ClassifiedTBox] identifier[reasoner] operator[SEP] {
Keyword[return] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[reasoner] operator[SEP] identifier[dataRangesDAG] operator[SEP] operator[SEP] operator[SEP] identifier[spliterator] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[n] operator[->] identifier[getPartialPredicateToDatatypeMap] operator[SEP] identifier[n] , identifier[reasoner] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[ImmutableCollectors] operator[SEP] identifier[toMultimap] operator[SEP] identifier[e] operator[->] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[Map] operator[SEP] identifier[Entry] operator[::] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean parseValue(JsonPullParser parser, OnJsonObjectAddListener listener, String key,
T obj) throws IOException, JsonFormatException {
JsonPropertyCoder<T, ?> dec = map.get(key);
if (dec == null) {
return false;
} else {
dec.decode(parser, obj);
}
return true;
} | class class_name[name] begin[{]
method[parseValue, return_type[type[boolean]], modifier[public], parameter[parser, listener, key, obj]] begin[{]
local_variable[type[JsonPropertyCoder], dec]
if[binary_operation[member[.dec], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
call[dec.decode, parameter[member[.parser], member[.obj]]]
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[parseValue] operator[SEP] identifier[JsonPullParser] identifier[parser] , identifier[OnJsonObjectAddListener] identifier[listener] , identifier[String] identifier[key] , identifier[T] identifier[obj] operator[SEP] Keyword[throws] identifier[IOException] , identifier[JsonFormatException] {
identifier[JsonPropertyCoder] operator[<] identifier[T] , operator[?] operator[>] identifier[dec] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dec] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[dec] operator[SEP] identifier[decode] operator[SEP] identifier[parser] , identifier[obj] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static void normal(Vector3fc v0, Vector3fc v1, Vector3fc v2, Vector3f dest) {
normal(v0.x(), v0.y(), v0.z(), v1.x(), v1.y(), v1.z(), v2.x(), v2.y(), v2.z(), dest);
} | class class_name[name] begin[{]
method[normal, return_type[void], modifier[public static], parameter[v0, v1, v2, dest]] begin[{]
call[.normal, parameter[call[v0.x, parameter[]], call[v0.y, parameter[]], call[v0.z, parameter[]], call[v1.x, parameter[]], call[v1.y, parameter[]], call[v1.z, parameter[]], call[v2.x, parameter[]], call[v2.y, parameter[]], call[v2.z, parameter[]], member[.dest]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[normal] operator[SEP] identifier[Vector3fc] identifier[v0] , identifier[Vector3fc] identifier[v1] , identifier[Vector3fc] identifier[v2] , identifier[Vector3f] identifier[dest] operator[SEP] {
identifier[normal] operator[SEP] identifier[v0] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[v0] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[v0] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[v1] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[v1] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[v1] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[v2] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[v2] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[v2] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[dest] operator[SEP] operator[SEP]
}
|
public static PortletApplicationContext getPortletApplicationContext(PortletContext pc, String attrName) {
Assert.notNull(pc, "PortletContext must not be null");
Object attr = pc.getAttribute(attrName);
if (attr == null) {
return null;
}
if (attr instanceof RuntimeException) {
throw (RuntimeException) attr;
}
if (attr instanceof Error) {
throw (Error) attr;
}
if (attr instanceof Exception) {
throw new IllegalStateException((Exception) attr);
}
if (!(attr instanceof PortletApplicationContext)) {
throw new IllegalStateException("Context attribute is not of type PortletApplicationContext: " + attr.getClass() + " - " + attr);
}
return (PortletApplicationContext) attr;
} | class class_name[name] begin[{]
method[getPortletApplicationContext, return_type[type[PortletApplicationContext]], modifier[public static], parameter[pc, attrName]] begin[{]
call[Assert.notNull, parameter[member[.pc], literal["PortletContext must not be null"]]]
local_variable[type[Object], attr]
if[binary_operation[member[.attr], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.attr], instanceof, type[RuntimeException]]] begin[{]
ThrowStatement(expression=Cast(expression=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.attr], instanceof, type[Error]]] begin[{]
ThrowStatement(expression=Cast(expression=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.attr], instanceof, type[Exception]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Cast(expression=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Exception, sub_type=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)
else begin[{]
None
end[}]
if[binary_operation[member[.attr], instanceof, type[PortletApplicationContext]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Context attribute is not of type PortletApplicationContext: "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[Cast(expression=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PortletApplicationContext, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PortletApplicationContext] identifier[getPortletApplicationContext] operator[SEP] identifier[PortletContext] identifier[pc] , identifier[String] identifier[attrName] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[pc] , literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[attr] operator[=] identifier[pc] operator[SEP] identifier[getAttribute] operator[SEP] identifier[attrName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[attr] Keyword[instanceof] identifier[RuntimeException] operator[SEP] {
Keyword[throw] operator[SEP] identifier[RuntimeException] operator[SEP] identifier[attr] operator[SEP]
}
Keyword[if] operator[SEP] identifier[attr] Keyword[instanceof] identifier[Error] operator[SEP] {
Keyword[throw] operator[SEP] identifier[Error] operator[SEP] identifier[attr] operator[SEP]
}
Keyword[if] operator[SEP] identifier[attr] Keyword[instanceof] identifier[Exception] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] identifier[Exception] operator[SEP] identifier[attr] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[attr] Keyword[instanceof] identifier[PortletApplicationContext] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[attr] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[attr] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[PortletApplicationContext] operator[SEP] identifier[attr] operator[SEP]
}
|
@Get("/projects/{projectName}/repos/{repoName}/revision/{revision}")
@RequiresReadPermission
public Map<String, Integer> normalizeRevision(Repository repository, @Param("revision") String revision) {
final Revision normalizedRevision = repository.normalizeNow(new Revision(revision));
return ImmutableMap.of("revision", normalizedRevision.major());
} | class class_name[name] begin[{]
method[normalizeRevision, return_type[type[Map]], modifier[public], parameter[repository, revision]] begin[{]
local_variable[type[Revision], normalizedRevision]
return[call[ImmutableMap.of, parameter[literal["revision"], call[normalizedRevision.major, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[Get] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[RequiresReadPermission] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[normalizeRevision] operator[SEP] identifier[Repository] identifier[repository] , annotation[@] identifier[Param] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[revision] operator[SEP] {
Keyword[final] identifier[Revision] identifier[normalizedRevision] operator[=] identifier[repository] operator[SEP] identifier[normalizeNow] operator[SEP] Keyword[new] identifier[Revision] operator[SEP] identifier[revision] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ImmutableMap] operator[SEP] identifier[of] operator[SEP] literal[String] , identifier[normalizedRevision] operator[SEP] identifier[major] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void forceMouseOut() {
for (Widget w : m_buttonPanel) {
if (w instanceof CmsPushButton) {
((CmsPushButton)w).clearHoverState();
}
}
CmsDomUtil.ensureMouseOut(this);
removeStyleName(I_CmsLayoutBundle.INSTANCE.stateCss().cmsHovering());
} | class class_name[name] begin[{]
method[forceMouseOut, return_type[void], modifier[public], parameter[]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=CmsPushButton, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CmsPushButton, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=m_buttonPanel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=w)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None))), label=None)
call[CmsDomUtil.ensureMouseOut, parameter[THIS[]]]
call[.removeStyleName, parameter[call[I_CmsLayoutBundle.INSTANCE.stateCss, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[forceMouseOut] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Widget] identifier[w] operator[:] identifier[m_buttonPanel] operator[SEP] {
Keyword[if] operator[SEP] identifier[w] Keyword[instanceof] identifier[CmsPushButton] operator[SEP] {
operator[SEP] operator[SEP] identifier[CmsPushButton] operator[SEP] identifier[w] operator[SEP] operator[SEP] identifier[clearHoverState] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[CmsDomUtil] operator[SEP] identifier[ensureMouseOut] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[removeStyleName] operator[SEP] identifier[I_CmsLayoutBundle] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[stateCss] operator[SEP] operator[SEP] operator[SEP] identifier[cmsHovering] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void inflateView() {
parentView = createParentView();
view = createView();
view.setOnFocusChangeListener(createFocusChangeListener());
view.setBackgroundResource(R.drawable.validateable_view_background);
setLineColor(getAccentColor());
if (parentView != null) {
parentView.addView(view, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
addView(parentView, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
} else {
addView(view, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}
} | class class_name[name] begin[{]
method[inflateView, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.parentView], call[.createParentView, parameter[]]]
assign[member[.view], call[.createView, parameter[]]]
call[view.setOnFocusChangeListener, parameter[call[.createFocusChangeListener, parameter[]]]]
call[view.setBackgroundResource, parameter[member[R.drawable.validateable_view_background]]]
call[.setLineColor, parameter[call[.getAccentColor, parameter[]]]]
if[binary_operation[member[.parentView], !=, literal[null]]] begin[{]
call[parentView.addView, parameter[member[.view], member[LayoutParams.MATCH_PARENT], member[LayoutParams.WRAP_CONTENT]]]
call[.addView, parameter[member[.parentView], member[LayoutParams.MATCH_PARENT], member[LayoutParams.WRAP_CONTENT]]]
else begin[{]
call[.addView, parameter[member[.view], member[LayoutParams.MATCH_PARENT], member[LayoutParams.WRAP_CONTENT]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[inflateView] operator[SEP] operator[SEP] {
identifier[parentView] operator[=] identifier[createParentView] operator[SEP] operator[SEP] operator[SEP] identifier[view] operator[=] identifier[createView] operator[SEP] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[setOnFocusChangeListener] operator[SEP] identifier[createFocusChangeListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[setBackgroundResource] operator[SEP] identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[validateable_view_background] operator[SEP] operator[SEP] identifier[setLineColor] operator[SEP] identifier[getAccentColor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parentView] operator[!=] Other[null] operator[SEP] {
identifier[parentView] operator[SEP] identifier[addView] operator[SEP] identifier[view] , identifier[LayoutParams] operator[SEP] identifier[MATCH_PARENT] , identifier[LayoutParams] operator[SEP] identifier[WRAP_CONTENT] operator[SEP] operator[SEP] identifier[addView] operator[SEP] identifier[parentView] , identifier[LayoutParams] operator[SEP] identifier[MATCH_PARENT] , identifier[LayoutParams] operator[SEP] identifier[WRAP_CONTENT] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[addView] operator[SEP] identifier[view] , identifier[LayoutParams] operator[SEP] identifier[MATCH_PARENT] , identifier[LayoutParams] operator[SEP] identifier[WRAP_CONTENT] operator[SEP] operator[SEP]
}
}
|
public static void main(String... args) throws Exception {
if (System.getProperty("boot.module.loader") == null) {
System.setProperty("boot.module.loader", "org.wildfly.swarm.bootstrap.modules.BootModuleLoader");
}
Module bootstrap = Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("swarm.application"));
ServiceLoader<ContainerFactory> factory = bootstrap.loadService(ContainerFactory.class);
Iterator<ContainerFactory> factoryIter = factory.iterator();
if (!factoryIter.hasNext()) {
simpleMain(args);
} else {
factoryMain(factoryIter.next(), args);
}
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[args]] begin[{]
if[binary_operation[call[System.getProperty, parameter[literal["boot.module.loader"]]], ==, literal[null]]] begin[{]
call[System.setProperty, parameter[literal["boot.module.loader"], literal["org.wildfly.swarm.bootstrap.modules.BootModuleLoader"]]]
else begin[{]
None
end[}]
local_variable[type[Module], bootstrap]
local_variable[type[ServiceLoader], factory]
local_variable[type[Iterator], factoryIter]
if[call[factoryIter.hasNext, parameter[]]] begin[{]
call[.simpleMain, parameter[member[.args]]]
else begin[{]
call[.factoryMain, parameter[call[factoryIter.next, parameter[]], member[.args]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
identifier[Module] identifier[bootstrap] operator[=] identifier[Module] operator[SEP] identifier[getBootModuleLoader] operator[SEP] operator[SEP] operator[SEP] identifier[loadModule] operator[SEP] identifier[ModuleIdentifier] operator[SEP] identifier[create] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceLoader] operator[<] identifier[ContainerFactory] operator[>] identifier[factory] operator[=] identifier[bootstrap] operator[SEP] identifier[loadService] operator[SEP] identifier[ContainerFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[ContainerFactory] operator[>] identifier[factoryIter] operator[=] identifier[factory] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[factoryIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[simpleMain] operator[SEP] identifier[args] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[factoryMain] operator[SEP] identifier[factoryIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] , identifier[args] operator[SEP] operator[SEP]
}
}
|
public ByteBuffer get4x3Transposed(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.put4x3Transposed(this, index, buffer);
return buffer;
} | class class_name[name] begin[{]
method[get4x3Transposed, return_type[type[ByteBuffer]], modifier[public], parameter[index, buffer]] begin[{]
call[MemUtil.INSTANCE.put4x3Transposed, parameter[THIS[], member[.index], member[.buffer]]]
return[member[.buffer]]
end[}]
END[}] | Keyword[public] identifier[ByteBuffer] identifier[get4x3Transposed] operator[SEP] Keyword[int] identifier[index] , identifier[ByteBuffer] identifier[buffer] operator[SEP] {
identifier[MemUtil] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[put4x3Transposed] operator[SEP] Keyword[this] , identifier[index] , identifier[buffer] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP]
}
|
public void zremrangeByScore(final byte[] key, final byte[] start, final byte[] end) {
sendCommand(Command.ZREMRANGEBYSCORE, key, start, end);
} | class class_name[name] begin[{]
method[zremrangeByScore, return_type[void], modifier[public], parameter[key, start, end]] begin[{]
call[.sendCommand, parameter[member[Command.ZREMRANGEBYSCORE], member[.key], member[.start], member[.end]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[zremrangeByScore] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[key] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[start] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[end] operator[SEP] {
identifier[sendCommand] operator[SEP] identifier[Command] operator[SEP] identifier[ZREMRANGEBYSCORE] , identifier[key] , identifier[start] , identifier[end] operator[SEP] operator[SEP]
}
|
public Observable<ComapiResult<Void>> deleteConversation(@NonNull final String conversationId, final String eTag) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueDeleteConversation(conversationId, eTag);
} else if (TextUtils.isEmpty(token)) {
return Observable.error(getSessionStateErrorDescription());
} else {
return doDeleteConversation(token, conversationId, eTag);
}
} | class class_name[name] begin[{]
method[deleteConversation, return_type[type[Observable]], modifier[public], parameter[conversationId, eTag]] begin[{]
local_variable[type[String], token]
if[call[sessionController.isCreatingSession, parameter[]]] begin[{]
return[call[.getTaskQueue, parameter[]]]
else begin[{]
if[call[TextUtils.isEmpty, parameter[member[.token]]]] begin[{]
return[call[Observable.error, parameter[call[.getSessionStateErrorDescription, parameter[]]]]]
else begin[{]
return[call[.doDeleteConversation, parameter[member[.token], member[.conversationId], member[.eTag]]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ComapiResult] operator[<] identifier[Void] operator[>] operator[>] identifier[deleteConversation] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[String] identifier[conversationId] , Keyword[final] identifier[String] identifier[eTag] operator[SEP] {
Keyword[final] identifier[String] identifier[token] operator[=] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sessionController] operator[SEP] identifier[isCreatingSession] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[getTaskQueue] operator[SEP] operator[SEP] operator[SEP] identifier[queueDeleteConversation] operator[SEP] identifier[conversationId] , identifier[eTag] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[getSessionStateErrorDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[doDeleteConversation] operator[SEP] identifier[token] , identifier[conversationId] , identifier[eTag] operator[SEP] operator[SEP]
}
}
|
public static <T extends Tag, V> void register(Class<T> tag, Class<V> type, TagConverter<T, V> converter) throws ConverterRegisterException {
if(tagToConverter.containsKey(tag)) {
throw new ConverterRegisterException("Type conversion to tag " + tag.getName() + " is already registered.");
}
if(typeToConverter.containsKey(type)) {
throw new ConverterRegisterException("Tag conversion to type " + type.getName() + " is already registered.");
}
tagToConverter.put(tag, converter);
typeToConverter.put(type, converter);
} | class class_name[name] begin[{]
method[register, return_type[void], modifier[public static], parameter[tag, type, converter]] begin[{]
if[call[tagToConverter.containsKey, parameter[member[.tag]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Type conversion to tag "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tag, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is already registered."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConverterRegisterException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[typeToConverter.containsKey, parameter[member[.type]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tag conversion to type "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is already registered."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConverterRegisterException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[tagToConverter.put, parameter[member[.tag], member[.converter]]]
call[typeToConverter.put, parameter[member[.type], member[.converter]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Tag] , identifier[V] operator[>] Keyword[void] identifier[register] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[tag] , identifier[Class] operator[<] identifier[V] operator[>] identifier[type] , identifier[TagConverter] operator[<] identifier[T] , identifier[V] operator[>] identifier[converter] operator[SEP] Keyword[throws] identifier[ConverterRegisterException] {
Keyword[if] operator[SEP] identifier[tagToConverter] operator[SEP] identifier[containsKey] operator[SEP] identifier[tag] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConverterRegisterException] operator[SEP] literal[String] operator[+] identifier[tag] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[typeToConverter] operator[SEP] identifier[containsKey] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConverterRegisterException] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[tagToConverter] operator[SEP] identifier[put] operator[SEP] identifier[tag] , identifier[converter] operator[SEP] operator[SEP] identifier[typeToConverter] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[converter] operator[SEP] operator[SEP]
}
|
public void execute() {
try {
for (CommitStep step : this.steps) {
if (!step.isCompleted()) {
step.execute();
}
}
} catch (Throwable t) {
log.error("Commit failed for dataset " + this.datasetUrn, t);
throw Throwables.propagate(t);
}
} | class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[]] begin[{]
TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isCompleted, postfix_operators=[], prefix_operators=['!'], qualifier=step, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=execute, postfix_operators=[], prefix_operators=[], qualifier=step, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=steps, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=step)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommitStep, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Commit failed for dataset "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=datasetUrn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=propagate, postfix_operators=[], prefix_operators=[], qualifier=Throwables, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[for] operator[SEP] identifier[CommitStep] identifier[step] operator[:] Keyword[this] operator[SEP] identifier[steps] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[step] operator[SEP] identifier[isCompleted] operator[SEP] operator[SEP] operator[SEP] {
identifier[step] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[datasetUrn] , identifier[t] operator[SEP] operator[SEP] Keyword[throw] identifier[Throwables] operator[SEP] identifier[propagate] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
|
public D getDestination(D destination,final S source){
try {
return mapper.vVAllAllAll(destination, source);
}catch (Exception e) {
JmapperLog.error(e);
}
return null;
} | class class_name[name] begin[{]
method[getDestination, return_type[type[D]], modifier[public], parameter[destination, source]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vVAllAllAll, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=JmapperLog, 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)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[D] identifier[getDestination] operator[SEP] identifier[D] identifier[destination] , Keyword[final] identifier[S] identifier[source] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[mapper] operator[SEP] identifier[vVAllAllAll] operator[SEP] identifier[destination] , identifier[source] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[JmapperLog] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public LineSegment subSegment(double offset, double length) {
Point subSegmentStart = pointAlongLineSegment(offset);
Point subSegmentEnd = pointAlongLineSegment(offset + length);
return new LineSegment(subSegmentStart, subSegmentEnd);
} | class class_name[name] begin[{]
method[subSegment, return_type[type[LineSegment]], modifier[public], parameter[offset, length]] begin[{]
local_variable[type[Point], subSegmentStart]
local_variable[type[Point], subSegmentEnd]
return[ClassCreator(arguments=[MemberReference(member=subSegmentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subSegmentEnd, 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=LineSegment, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[LineSegment] identifier[subSegment] operator[SEP] Keyword[double] identifier[offset] , Keyword[double] identifier[length] operator[SEP] {
identifier[Point] identifier[subSegmentStart] operator[=] identifier[pointAlongLineSegment] operator[SEP] identifier[offset] operator[SEP] operator[SEP] identifier[Point] identifier[subSegmentEnd] operator[=] identifier[pointAlongLineSegment] operator[SEP] identifier[offset] operator[+] identifier[length] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[LineSegment] operator[SEP] identifier[subSegmentStart] , identifier[subSegmentEnd] operator[SEP] operator[SEP]
}
|
public static smtp_server add(nitro_service client, smtp_server resource) throws Exception
{
resource.validate("add");
return ((smtp_server[]) resource.perform_operation(client, "add"))[0];
} | class class_name[name] begin[{]
method[add, return_type[type[smtp_server]], modifier[public static], parameter[client, resource]] begin[{]
call[resource.validate, parameter[literal["add"]]]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="add")], member=perform_operation, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=smtp_server, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[smtp_server] identifier[add] operator[SEP] identifier[nitro_service] identifier[client] , identifier[smtp_server] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[smtp_server] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[perform_operation] operator[SEP] identifier[client] , literal[String] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
|
public void setRoot(int context, Object environment)
{
super.setRoot(context, environment);
if(m_axis > -1)
m_iterator = m_cdtm.getAxisIterator(m_axis);
m_iterator.setStartNode(m_context);
} | class class_name[name] begin[{]
method[setRoot, return_type[void], modifier[public], parameter[context, environment]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=environment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRoot, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[binary_operation[member[.m_axis], >, literal[1]]] begin[{]
assign[member[.m_iterator], call[m_cdtm.getAxisIterator, parameter[member[.m_axis]]]]
else begin[{]
None
end[}]
call[m_iterator.setStartNode, parameter[member[.m_context]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setRoot] operator[SEP] Keyword[int] identifier[context] , identifier[Object] identifier[environment] operator[SEP] {
Keyword[super] operator[SEP] identifier[setRoot] operator[SEP] identifier[context] , identifier[environment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_axis] operator[>] operator[-] Other[1] operator[SEP] identifier[m_iterator] operator[=] identifier[m_cdtm] operator[SEP] identifier[getAxisIterator] operator[SEP] identifier[m_axis] operator[SEP] operator[SEP] identifier[m_iterator] operator[SEP] identifier[setStartNode] operator[SEP] identifier[m_context] operator[SEP] operator[SEP]
}
|
public static void before(String label) {
TracyThreadContext ctx = threadContext.get();
if (isValidContext(ctx)) {
ctx.push(label);
}
} | class class_name[name] begin[{]
method[before, return_type[void], modifier[public static], parameter[label]] begin[{]
local_variable[type[TracyThreadContext], ctx]
if[call[.isValidContext, parameter[member[.ctx]]]] begin[{]
call[ctx.push, parameter[member[.label]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[before] operator[SEP] identifier[String] identifier[label] operator[SEP] {
identifier[TracyThreadContext] identifier[ctx] operator[=] identifier[threadContext] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isValidContext] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] {
identifier[ctx] operator[SEP] identifier[push] operator[SEP] identifier[label] operator[SEP] operator[SEP]
}
}
|
public static Path getWriterStagingDir(State state, int numBranches, int branchId, String attemptId) {
Preconditions.checkArgument(attemptId != null && !attemptId.isEmpty(), "AttemptId cannot be null or empty: " + attemptId);
return new Path(getWriterStagingDir(state, numBranches, branchId), attemptId);
} | class class_name[name] begin[{]
method[getWriterStagingDir, return_type[type[Path]], modifier[public static], parameter[state, numBranches, branchId, attemptId]] begin[{]
call[Preconditions.checkArgument, parameter[binary_operation[binary_operation[member[.attemptId], !=, literal[null]], &&, call[attemptId.isEmpty, parameter[]]], binary_operation[literal["AttemptId cannot be null or empty: "], +, member[.attemptId]]]]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numBranches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=branchId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWriterStagingDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=attemptId, 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=Path, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Path] identifier[getWriterStagingDir] operator[SEP] identifier[State] identifier[state] , Keyword[int] identifier[numBranches] , Keyword[int] identifier[branchId] , identifier[String] identifier[attemptId] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[attemptId] operator[!=] Other[null] operator[&&] operator[!] identifier[attemptId] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[attemptId] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Path] operator[SEP] identifier[getWriterStagingDir] operator[SEP] identifier[state] , identifier[numBranches] , identifier[branchId] operator[SEP] , identifier[attemptId] operator[SEP] operator[SEP]
}
|
public boolean hasFieldChangedInHierarchy(String name) {
// Find the field:
ReloadableType rtype = this;
FieldMember field = null;
// Did it exist on this type originally?
TypeDescriptor originalTypeDescriptor = rtype.getTypeDescriptor();
FieldMember originalField = originalTypeDescriptor.getField(name);
TypeDescriptor typedescriptor = rtype.getLatestTypeDescriptor();
field = typedescriptor.getField(name);
if (originalField != null && field == null) {
// Field got removed from this type, going to have to resort to indirection logic or we'll trip over the original version when
// letting the field instruction run
return true;
}
if (originalField != null && field != null) {
return !originalField.equals(field);
}
if (originalField == null && field != null) {
return true;
}
FieldWalkDiscoveryResult b = hasFieldChangedInHierarchy(name, rtype.getTypeDescriptor().getSupertypeName());
switch (b) {
case CHANGED_STOPNOW:
return true;
case UNCHANGED_STOPWALKINGNOW:
return false;
case DONTKNOW:
throw new IllegalStateException();
}
throw new IllegalStateException();
} | class class_name[name] begin[{]
method[hasFieldChangedInHierarchy, return_type[type[boolean]], modifier[public], parameter[name]] begin[{]
local_variable[type[ReloadableType], rtype]
local_variable[type[FieldMember], field]
local_variable[type[TypeDescriptor], originalTypeDescriptor]
local_variable[type[FieldMember], originalField]
local_variable[type[TypeDescriptor], typedescriptor]
assign[member[.field], call[typedescriptor.getField, parameter[member[.name]]]]
if[binary_operation[binary_operation[member[.originalField], !=, literal[null]], &&, binary_operation[member[.field], ==, literal[null]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.originalField], !=, literal[null]], &&, binary_operation[member[.field], !=, literal[null]]]] begin[{]
return[call[originalField.equals, parameter[member[.field]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.originalField], ==, literal[null]], &&, binary_operation[member[.field], !=, literal[null]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[FieldWalkDiscoveryResult], b]
SwitchStatement(cases=[SwitchStatementCase(case=['CHANGED_STOPNOW'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=['UNCHANGED_STOPWALKINGNOW'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]), SwitchStatementCase(case=['DONTKNOW'], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])], expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[hasFieldChangedInHierarchy] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[ReloadableType] identifier[rtype] operator[=] Keyword[this] operator[SEP] identifier[FieldMember] identifier[field] operator[=] Other[null] operator[SEP] identifier[TypeDescriptor] identifier[originalTypeDescriptor] operator[=] identifier[rtype] operator[SEP] identifier[getTypeDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[FieldMember] identifier[originalField] operator[=] identifier[originalTypeDescriptor] operator[SEP] identifier[getField] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[TypeDescriptor] identifier[typedescriptor] operator[=] identifier[rtype] operator[SEP] identifier[getLatestTypeDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[=] identifier[typedescriptor] operator[SEP] identifier[getField] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[originalField] operator[!=] Other[null] operator[&&] identifier[field] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[originalField] operator[!=] Other[null] operator[&&] identifier[field] operator[!=] Other[null] operator[SEP] {
Keyword[return] operator[!] identifier[originalField] operator[SEP] identifier[equals] operator[SEP] identifier[field] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[originalField] operator[==] Other[null] operator[&&] identifier[field] operator[!=] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[FieldWalkDiscoveryResult] identifier[b] operator[=] identifier[hasFieldChangedInHierarchy] operator[SEP] identifier[name] , identifier[rtype] operator[SEP] identifier[getTypeDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[getSupertypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[b] operator[SEP] {
Keyword[case] identifier[CHANGED_STOPNOW] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[case] identifier[UNCHANGED_STOPWALKINGNOW] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[case] identifier[DONTKNOW] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP]
}
|
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ServiceModuleLoader loader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) {
return; // Skip non web deployments
}
WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
assert warMetaData != null;
final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
if (module == null) {
throw UndertowLogger.ROOT_LOGGER.failedToResolveModule(deploymentUnit);
}
final ClassLoader classLoader = module.getClassLoader();
ScisMetaData scisMetaData = deploymentUnit.getAttachment(ScisMetaData.ATTACHMENT_KEY);
if (scisMetaData == null) {
scisMetaData = new ScisMetaData();
deploymentUnit.putAttachment(ScisMetaData.ATTACHMENT_KEY, scisMetaData);
}
Set<ServletContainerInitializer> scis = scisMetaData.getScis();
Set<Class<? extends ServletContainerInitializer>> sciClasses = new HashSet<>();
if (scis == null) {
scis = new LinkedHashSet<>();
scisMetaData.setScis(scis);
}
Map<ServletContainerInitializer, Set<Class<?>>> handlesTypes = scisMetaData.getHandlesTypes();
if (handlesTypes == null) {
handlesTypes = new HashMap<ServletContainerInitializer, Set<Class<?>>>();
scisMetaData.setHandlesTypes(handlesTypes);
}
// Find the SCIs from shared modules
for (ModuleDependency dependency : moduleSpecification.getAllDependencies()) {
// Should not include SCI if services is not included
if (!dependency.isImportServices()) {
continue;
}
try {
Module depModule = loader.loadModule(dependency.getIdentifier());
ServiceLoader<ServletContainerInitializer> serviceLoader = depModule.loadService(ServletContainerInitializer.class);
for (ServletContainerInitializer service : serviceLoader) {
if(sciClasses.add(service.getClass())) {
scis.add(service);
}
}
} catch (ModuleLoadException e) {
if (!dependency.isOptional()) {
throw UndertowLogger.ROOT_LOGGER.errorLoadingSCIFromModule(dependency.getIdentifier().toString(), e);
}
}
}
// Find local ServletContainerInitializer services
List<String> order = warMetaData.getOrder();
Map<String, VirtualFile> localScis = warMetaData.getScis();
if (order != null && localScis != null) {
for (String jar : order) {
VirtualFile sci = localScis.get(jar);
if (sci != null) {
scis.addAll(loadSci(classLoader, sci, jar, true, sciClasses));
}
}
}
//SCI's deployed in the war itself
if(localScis != null) {
VirtualFile warDeployedScis = localScis.get("classes");
if(warDeployedScis != null) {
scis.addAll(loadSci(classLoader, warDeployedScis, deploymentUnit.getName(), true, sciClasses));
}
}
// Process HandlesTypes for ServletContainerInitializer
Map<Class<?>, Set<ServletContainerInitializer>> typesMap = new HashMap<Class<?>, Set<ServletContainerInitializer>>();
for (ServletContainerInitializer service : scis) {
if (service.getClass().isAnnotationPresent(HandlesTypes.class)) {
HandlesTypes handlesTypesAnnotation = service.getClass().getAnnotation(HandlesTypes.class);
Class<?>[] typesArray = handlesTypesAnnotation.value();
if (typesArray != null) {
for (Class<?> type : typesArray) {
Set<ServletContainerInitializer> servicesSet = typesMap.get(type);
if (servicesSet == null) {
servicesSet = new HashSet<ServletContainerInitializer>();
typesMap.put(type, servicesSet);
}
servicesSet.add(service);
handlesTypes.put(service, new HashSet<Class<?>>());
}
}
}
}
Class<?>[] typesArray = typesMap.keySet().toArray(new Class<?>[0]);
final CompositeIndex index = deploymentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
if (index == null) {
throw UndertowLogger.ROOT_LOGGER.unableToResolveAnnotationIndex(deploymentUnit);
}
final CompositeIndex parent;
if(deploymentUnit.getParent() != null) {
parent = deploymentUnit.getParent().getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
} else {
parent = null;
}
//WFLY-4205, look in the parent as well as the war
CompositeIndex parentIndex = deploymentUnit.getParent() == null ? null : deploymentUnit.getParent().getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
// Find classes which extend, implement, or are annotated by HandlesTypes
for (Class<?> type : typesArray) {
DotName className = DotName.createSimple(type.getName());
Set<ClassInfo> classInfos = new HashSet<>();
classInfos.addAll(processHandlesType(className, type, index, parent));
if(parentIndex != null) {
classInfos.addAll(processHandlesType(className, type, parentIndex, parent));
}
Set<Class<?>> classes = loadClassInfoSet(classInfos, classLoader);
Set<ServletContainerInitializer> sciSet = typesMap.get(type);
for (ServletContainerInitializer sci : sciSet) {
handlesTypes.get(sci).addAll(classes);
}
}
} | class class_name[name] begin[{]
method[deploy, return_type[void], modifier[public], parameter[phaseContext]] begin[{]
local_variable[type[DeploymentUnit], deploymentUnit]
local_variable[type[ModuleSpecification], moduleSpecification]
local_variable[type[ServiceModuleLoader], loader]
if[call[DeploymentTypeMarker.isType, parameter[member[DeploymentType.WAR], member[.deploymentUnit]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[WarMetaData], warMetaData]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=warMetaData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
local_variable[type[Module], module]
if[binary_operation[member[.module], ==, literal[null]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=deploymentUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=failedToResolveModule, postfix_operators=[], prefix_operators=[], qualifier=UndertowLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
local_variable[type[ClassLoader], classLoader]
local_variable[type[ScisMetaData], scisMetaData]
if[binary_operation[member[.scisMetaData], ==, literal[null]]] begin[{]
assign[member[.scisMetaData], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ScisMetaData, sub_type=None))]
call[deploymentUnit.putAttachment, parameter[member[ScisMetaData.ATTACHMENT_KEY], member[.scisMetaData]]]
else begin[{]
None
end[}]
local_variable[type[Set], scis]
local_variable[type[Set], sciClasses]
if[binary_operation[member[.scis], ==, literal[null]]] begin[{]
assign[member[.scis], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashSet, sub_type=None))]
call[scisMetaData.setScis, parameter[member[.scis]]]
else begin[{]
None
end[}]
local_variable[type[Map], handlesTypes]
if[binary_operation[member[.handlesTypes], ==, literal[null]]] begin[{]
assign[member[.handlesTypes], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
call[scisMetaData.setHandlesTypes, parameter[member[.handlesTypes]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isImportServices, postfix_operators=[], prefix_operators=['!'], qualifier=dependency, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=dependency, selectors=[], type_arguments=None)], member=loadModule, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[], type_arguments=None), name=depModule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Module, 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=ServletContainerInitializer, sub_type=None))], member=loadService, postfix_operators=[], prefix_operators=[], qualifier=depModule, selectors=[], type_arguments=None), name=serviceLoader)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None))], dimensions=[], name=ServiceLoader, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=sciClasses, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=scis, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=serviceLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=service)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None))), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isOptional, postfix_operators=[], prefix_operators=['!'], qualifier=dependency, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=dependency, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorLoadingSCIFromModule, postfix_operators=[], prefix_operators=[], qualifier=UndertowLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ModuleLoadException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAllDependencies, postfix_operators=[], prefix_operators=[], qualifier=moduleSpecification, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dependency)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModuleDependency, sub_type=None))), label=None)
local_variable[type[List], order]
local_variable[type[Map], localScis]
if[binary_operation[binary_operation[member[.order], !=, literal[null]], &&, binary_operation[member[.localScis], !=, literal[null]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=jar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=localScis, selectors=[], type_arguments=None), name=sci)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VirtualFile, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sci, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sci, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=sciClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadSci, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=scis, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=order, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=jar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.localScis], !=, literal[null]]] begin[{]
local_variable[type[VirtualFile], warDeployedScis]
if[binary_operation[member[.warDeployedScis], !=, literal[null]]] begin[{]
call[scis.addAll, parameter[call[.loadSci, parameter[member[.classLoader], member[.warDeployedScis], call[deploymentUnit.getName, parameter[]], literal[true], member[.sciClasses]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[Map], typesMap]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HandlesTypes, sub_type=None))], member=isAnnotationPresent, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HandlesTypes, sub_type=None))], member=getAnnotation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=handlesTypesAnnotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HandlesTypes, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=handlesTypesAnnotation, selectors=[], type_arguments=None), name=typesArray)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[None], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=typesArray, 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=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=typesMap, selectors=[], type_arguments=None), name=servicesSet)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=servicesSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=servicesSet, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=servicesSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=typesMap, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=servicesSet, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=handlesTypes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=typesArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=scis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=service)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None))), label=None)
local_variable[type[Class], typesArray]
local_variable[type[CompositeIndex], index]
if[binary_operation[member[.index], ==, literal[null]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=deploymentUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unableToResolveAnnotationIndex, postfix_operators=[], prefix_operators=[], qualifier=UndertowLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
local_variable[type[CompositeIndex], parent]
if[binary_operation[call[deploymentUnit.getParent, parameter[]], !=, literal[null]]] begin[{]
assign[member[.parent], call[deploymentUnit.getParent, parameter[]]]
else begin[{]
assign[member[.parent], literal[null]]
end[}]
local_variable[type[CompositeIndex], parentIndex]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)], member=createSimple, postfix_operators=[], prefix_operators=[], qualifier=DotName, selectors=[], type_arguments=None), name=className)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DotName, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None)), name=classInfos)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassInfo, sub_type=None))], dimensions=[], name=Set, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processHandlesType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=classInfos, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parentIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processHandlesType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=classInfos, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=classInfos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClassInfoSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=classes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))], dimensions=[], name=Set, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=typesMap, selectors=[], type_arguments=None), name=sciSet)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sci, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=handlesTypes, selectors=[MethodInvocation(arguments=[MemberReference(member=classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sciSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sci)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServletContainerInitializer, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=typesArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[deploy] operator[SEP] Keyword[final] identifier[DeploymentPhaseContext] identifier[phaseContext] operator[SEP] Keyword[throws] identifier[DeploymentUnitProcessingException] {
Keyword[final] identifier[DeploymentUnit] identifier[deploymentUnit] operator[=] identifier[phaseContext] operator[SEP] identifier[getDeploymentUnit] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ModuleSpecification] identifier[moduleSpecification] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[MODULE_SPECIFICATION] operator[SEP] operator[SEP] Keyword[final] identifier[ServiceModuleLoader] identifier[loader] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[SERVICE_MODULE_LOADER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[DeploymentTypeMarker] operator[SEP] identifier[isType] operator[SEP] identifier[DeploymentType] operator[SEP] identifier[WAR] , identifier[deploymentUnit] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[WarMetaData] identifier[warMetaData] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[WarMetaData] operator[SEP] identifier[ATTACHMENT_KEY] operator[SEP] operator[SEP] Keyword[assert] identifier[warMetaData] operator[!=] Other[null] operator[SEP] Keyword[final] identifier[Module] identifier[module] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[MODULE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[module] operator[==] Other[null] operator[SEP] {
Keyword[throw] identifier[UndertowLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[failedToResolveModule] operator[SEP] identifier[deploymentUnit] operator[SEP] operator[SEP]
}
Keyword[final] identifier[ClassLoader] identifier[classLoader] operator[=] identifier[module] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[ScisMetaData] identifier[scisMetaData] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[ScisMetaData] operator[SEP] identifier[ATTACHMENT_KEY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scisMetaData] operator[==] Other[null] operator[SEP] {
identifier[scisMetaData] operator[=] Keyword[new] identifier[ScisMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[deploymentUnit] operator[SEP] identifier[putAttachment] operator[SEP] identifier[ScisMetaData] operator[SEP] identifier[ATTACHMENT_KEY] , identifier[scisMetaData] operator[SEP] operator[SEP]
}
identifier[Set] operator[<] identifier[ServletContainerInitializer] operator[>] identifier[scis] operator[=] identifier[scisMetaData] operator[SEP] identifier[getScis] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ServletContainerInitializer] operator[>] operator[>] identifier[sciClasses] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scis] operator[==] Other[null] operator[SEP] {
identifier[scis] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[scisMetaData] operator[SEP] identifier[setScis] operator[SEP] identifier[scis] operator[SEP] operator[SEP]
}
identifier[Map] operator[<] identifier[ServletContainerInitializer] , identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[>] identifier[handlesTypes] operator[=] identifier[scisMetaData] operator[SEP] identifier[getHandlesTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handlesTypes] operator[==] Other[null] operator[SEP] {
identifier[handlesTypes] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[ServletContainerInitializer] , identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[scisMetaData] operator[SEP] identifier[setHandlesTypes] operator[SEP] identifier[handlesTypes] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[ModuleDependency] identifier[dependency] operator[:] identifier[moduleSpecification] operator[SEP] identifier[getAllDependencies] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[dependency] operator[SEP] identifier[isImportServices] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[try] {
identifier[Module] identifier[depModule] operator[=] identifier[loader] operator[SEP] identifier[loadModule] operator[SEP] identifier[dependency] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceLoader] operator[<] identifier[ServletContainerInitializer] operator[>] identifier[serviceLoader] operator[=] identifier[depModule] operator[SEP] identifier[loadService] operator[SEP] identifier[ServletContainerInitializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ServletContainerInitializer] identifier[service] operator[:] identifier[serviceLoader] operator[SEP] {
Keyword[if] operator[SEP] identifier[sciClasses] operator[SEP] identifier[add] operator[SEP] identifier[service] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[scis] operator[SEP] identifier[add] operator[SEP] identifier[service] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[ModuleLoadException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[dependency] operator[SEP] identifier[isOptional] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] identifier[UndertowLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[errorLoadingSCIFromModule] operator[SEP] identifier[dependency] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
}
identifier[List] operator[<] identifier[String] operator[>] identifier[order] operator[=] identifier[warMetaData] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[VirtualFile] operator[>] identifier[localScis] operator[=] identifier[warMetaData] operator[SEP] identifier[getScis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[order] operator[!=] Other[null] operator[&&] identifier[localScis] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[jar] operator[:] identifier[order] operator[SEP] {
identifier[VirtualFile] identifier[sci] operator[=] identifier[localScis] operator[SEP] identifier[get] operator[SEP] identifier[jar] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sci] operator[!=] Other[null] operator[SEP] {
identifier[scis] operator[SEP] identifier[addAll] operator[SEP] identifier[loadSci] operator[SEP] identifier[classLoader] , identifier[sci] , identifier[jar] , literal[boolean] , identifier[sciClasses] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[localScis] operator[!=] Other[null] operator[SEP] {
identifier[VirtualFile] identifier[warDeployedScis] operator[=] identifier[localScis] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[warDeployedScis] operator[!=] Other[null] operator[SEP] {
identifier[scis] operator[SEP] identifier[addAll] operator[SEP] identifier[loadSci] operator[SEP] identifier[classLoader] , identifier[warDeployedScis] , identifier[deploymentUnit] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[boolean] , identifier[sciClasses] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[Map] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Set] operator[<] identifier[ServletContainerInitializer] operator[>] operator[>] identifier[typesMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Set] operator[<] identifier[ServletContainerInitializer] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ServletContainerInitializer] identifier[service] operator[:] identifier[scis] operator[SEP] {
Keyword[if] operator[SEP] identifier[service] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[HandlesTypes] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[HandlesTypes] identifier[handlesTypesAnnotation] operator[=] identifier[service] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[HandlesTypes] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[typesArray] operator[=] identifier[handlesTypesAnnotation] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typesArray] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[:] identifier[typesArray] operator[SEP] {
identifier[Set] operator[<] identifier[ServletContainerInitializer] operator[>] identifier[servicesSet] operator[=] identifier[typesMap] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[servicesSet] operator[==] Other[null] operator[SEP] {
identifier[servicesSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[ServletContainerInitializer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[typesMap] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[servicesSet] operator[SEP] operator[SEP]
}
identifier[servicesSet] operator[SEP] identifier[add] operator[SEP] identifier[service] operator[SEP] operator[SEP] identifier[handlesTypes] operator[SEP] identifier[put] operator[SEP] identifier[service] , Keyword[new] identifier[HashSet] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[typesArray] operator[=] identifier[typesMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[CompositeIndex] identifier[index] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[COMPOSITE_ANNOTATION_INDEX] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] Other[null] operator[SEP] {
Keyword[throw] identifier[UndertowLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[unableToResolveAnnotationIndex] operator[SEP] identifier[deploymentUnit] operator[SEP] operator[SEP]
}
Keyword[final] identifier[CompositeIndex] identifier[parent] operator[SEP] Keyword[if] operator[SEP] identifier[deploymentUnit] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[parent] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[COMPOSITE_ANNOTATION_INDEX] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[parent] operator[=] Other[null] operator[SEP]
}
identifier[CompositeIndex] identifier[parentIndex] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[deploymentUnit] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[COMPOSITE_ANNOTATION_INDEX] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[:] identifier[typesArray] operator[SEP] {
identifier[DotName] identifier[className] operator[=] identifier[DotName] operator[SEP] identifier[createSimple] operator[SEP] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ClassInfo] operator[>] identifier[classInfos] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[classInfos] operator[SEP] identifier[addAll] operator[SEP] identifier[processHandlesType] operator[SEP] identifier[className] , identifier[type] , identifier[index] , identifier[parent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parentIndex] operator[!=] Other[null] operator[SEP] {
identifier[classInfos] operator[SEP] identifier[addAll] operator[SEP] identifier[processHandlesType] operator[SEP] identifier[className] , identifier[type] , identifier[parentIndex] , identifier[parent] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[classes] operator[=] identifier[loadClassInfoSet] operator[SEP] identifier[classInfos] , identifier[classLoader] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ServletContainerInitializer] operator[>] identifier[sciSet] operator[=] identifier[typesMap] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ServletContainerInitializer] identifier[sci] operator[:] identifier[sciSet] operator[SEP] {
identifier[handlesTypes] operator[SEP] identifier[get] operator[SEP] identifier[sci] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[classes] operator[SEP] operator[SEP]
}
}
}
|
private boolean isIntExtension(int typeByte) {
return typeByte == MsgPack.FIX_EXT_1 || typeByte == MsgPack.FIX_EXT_2 || typeByte == MsgPack.FIX_EXT_4;
} | class class_name[name] begin[{]
method[isIntExtension, return_type[type[boolean]], modifier[private], parameter[typeByte]] begin[{]
return[binary_operation[binary_operation[binary_operation[member[.typeByte], ==, member[MsgPack.FIX_EXT_1]], ||, binary_operation[member[.typeByte], ==, member[MsgPack.FIX_EXT_2]]], ||, binary_operation[member[.typeByte], ==, member[MsgPack.FIX_EXT_4]]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isIntExtension] operator[SEP] Keyword[int] identifier[typeByte] operator[SEP] {
Keyword[return] identifier[typeByte] operator[==] identifier[MsgPack] operator[SEP] identifier[FIX_EXT_1] operator[||] identifier[typeByte] operator[==] identifier[MsgPack] operator[SEP] identifier[FIX_EXT_2] operator[||] identifier[typeByte] operator[==] identifier[MsgPack] operator[SEP] identifier[FIX_EXT_4] operator[SEP]
}
|
public static Expression logicalAnd(List<? extends Expression> expressions) {
return doShortCircuitingLogicalOperator(ImmutableList.copyOf(expressions), false);
} | class class_name[name] begin[{]
method[logicalAnd, return_type[type[Expression]], modifier[public static], parameter[expressions]] begin[{]
return[call[.doShortCircuitingLogicalOperator, parameter[call[ImmutableList.copyOf, parameter[member[.expressions]]], literal[false]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Expression] identifier[logicalAnd] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[Expression] operator[>] identifier[expressions] operator[SEP] {
Keyword[return] identifier[doShortCircuitingLogicalOperator] operator[SEP] identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[expressions] operator[SEP] , literal[boolean] operator[SEP] operator[SEP]
}
|
public void run() throws Exception {
if (ranges == null) {
throw new ModelsIllegalargumentException("No ranges have been defined for the parameter space.", this);
}
createSwarm();
double[] previous = null;
while( iterationStep <= maxIterations ) {
updateSwarm();
if (printStep()) {
System.out.println(prefix + " - ITER: " + iterationStep + " global best: " + globalBest + " - for positions: "
+ Arrays.toString(globalBestLocations));
}
if (function.hasConverged(globalBest, globalBestLocations, previous)) {
break;
}
previous = globalBestLocations.clone();
}
} | class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ranges], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No ranges have been defined for the parameter space."), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelsIllegalargumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.createSwarm, parameter[]]
local_variable[type[double], previous]
while[binary_operation[member[.iterationStep], <=, member[.maxIterations]]] begin[{]
call[.updateSwarm, parameter[]]
if[call[.printStep, parameter[]]] begin[{]
call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.prefix], +, literal[" - ITER: "]], +, member[.iterationStep]], +, literal[" global best: "]], +, member[.globalBest]], +, literal[" - for positions: "]], +, call[Arrays.toString, parameter[member[.globalBestLocations]]]]]]
else begin[{]
None
end[}]
if[call[function.hasConverged, parameter[member[.globalBest], member[.globalBestLocations], member[.previous]]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
assign[member[.previous], call[globalBestLocations.clone, parameter[]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[ranges] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ModelsIllegalargumentException] operator[SEP] literal[String] , Keyword[this] operator[SEP] operator[SEP]
}
identifier[createSwarm] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[previous] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[iterationStep] operator[<=] identifier[maxIterations] operator[SEP] {
identifier[updateSwarm] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[printStep] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[prefix] operator[+] literal[String] operator[+] identifier[iterationStep] operator[+] literal[String] operator[+] identifier[globalBest] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[globalBestLocations] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[function] operator[SEP] identifier[hasConverged] operator[SEP] identifier[globalBest] , identifier[globalBestLocations] , identifier[previous] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[previous] operator[=] identifier[globalBestLocations] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private byte[] getDigest(byte[] def, Configuration conf) {
try {
MessageDigest alg = MessageDigest.getInstance(conf.digestAlgorithm);
return alg.digest(def);
} catch (NoSuchAlgorithmException e) {
throw new UnexpectedException(e);
}
} | class class_name[name] begin[{]
method[getDigest, return_type[type[byte]], modifier[private], parameter[def, conf]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=digestAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None), name=alg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MessageDigest, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=digest, postfix_operators=[], prefix_operators=[], qualifier=alg, 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=UnexpectedException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[getDigest] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[def] , identifier[Configuration] identifier[conf] operator[SEP] {
Keyword[try] {
identifier[MessageDigest] identifier[alg] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] identifier[conf] operator[SEP] identifier[digestAlgorithm] operator[SEP] operator[SEP] Keyword[return] identifier[alg] operator[SEP] identifier[digest] operator[SEP] identifier[def] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnexpectedException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public List<AppKey> createNewAppKeysFromResults(Scan scan, long startTime,
long endTime, int maxCount) throws IOException {
ResultScanner scanner = null;
List<AppKey> newAppsKeys = new ArrayList<AppKey>();
Table versionsTable = null;
try {
Stopwatch timer = new Stopwatch().start();
int rowCount = 0;
long colCount = 0;
long resultSize = 0;
versionsTable = hbaseConnection
.getTable(TableName.valueOf(Constants.HISTORY_APP_VERSION_TABLE));
scanner = versionsTable.getScanner(scan);
for (Result result : scanner) {
if (result != null && !result.isEmpty()) {
rowCount++;
colCount += result.size();
// TODO dogpiledays resultSize += result.getWritableSize();
AppKey appKey = getNewAppKeyFromResult(result, startTime, endTime);
if (appKey != null) {
newAppsKeys.add(appKey);
}
if (newAppsKeys.size() >= maxCount) {
break;
}
}
}
timer.stop();
LOG.info(" Fetched from hbase " + rowCount + " rows, " + colCount
+ " columns, " + resultSize + " bytes ( " + resultSize / (1024 * 1024)
+ ") MB, in total time of " + timer);
} finally {
if (scanner != null) {
scanner.close();
}
if (versionsTable != null) {
versionsTable.close();
}
}
return newAppsKeys;
} | class class_name[name] begin[{]
method[createNewAppKeysFromResults, return_type[type[List]], modifier[public], parameter[scan, startTime, endTime, maxCount]] begin[{]
local_variable[type[ResultScanner], scanner]
local_variable[type[List], newAppsKeys]
local_variable[type[Table], versionsTable]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=start, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Stopwatch, sub_type=None)), name=timer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Stopwatch, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=rowCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=colCount)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=resultSize)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=versionsTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=HISTORY_APP_VERSION_TABLE, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=TableName, selectors=[], type_arguments=None)], member=getTable, postfix_operators=[], prefix_operators=[], qualifier=hbaseConnection, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=scanner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=scan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getScanner, postfix_operators=[], prefix_operators=[], qualifier=versionsTable, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=result, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=rowCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=colCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNewAppKeyFromResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=appKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AppKey, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=appKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=appKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newAppsKeys, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=newAppsKeys, selectors=[], type_arguments=None), operandr=MemberReference(member=maxCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=scanner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Result, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(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=" Fetched from hbase "), operandr=MemberReference(member=rowCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" rows, "), operator=+), operandr=MemberReference(member=colCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" columns, "), operator=+), operandr=MemberReference(member=resultSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" bytes ( "), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=resultSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*), operator=/), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") MB, in total time of "), operator=+), operandr=MemberReference(member=timer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=scanner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=versionsTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=versionsTable, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
return[member[.newAppsKeys]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[AppKey] operator[>] identifier[createNewAppKeysFromResults] operator[SEP] identifier[Scan] identifier[scan] , Keyword[long] identifier[startTime] , Keyword[long] identifier[endTime] , Keyword[int] identifier[maxCount] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ResultScanner] identifier[scanner] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[AppKey] operator[>] identifier[newAppsKeys] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[AppKey] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Table] identifier[versionsTable] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[Stopwatch] identifier[timer] operator[=] Keyword[new] identifier[Stopwatch] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rowCount] operator[=] Other[0] operator[SEP] Keyword[long] identifier[colCount] operator[=] Other[0] operator[SEP] Keyword[long] identifier[resultSize] operator[=] Other[0] operator[SEP] identifier[versionsTable] operator[=] identifier[hbaseConnection] operator[SEP] identifier[getTable] operator[SEP] identifier[TableName] operator[SEP] identifier[valueOf] operator[SEP] identifier[Constants] operator[SEP] identifier[HISTORY_APP_VERSION_TABLE] operator[SEP] operator[SEP] operator[SEP] identifier[scanner] operator[=] identifier[versionsTable] operator[SEP] identifier[getScanner] operator[SEP] identifier[scan] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Result] identifier[result] operator[:] identifier[scanner] operator[SEP] {
Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[&&] operator[!] identifier[result] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[rowCount] operator[++] operator[SEP] identifier[colCount] operator[+=] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[AppKey] identifier[appKey] operator[=] identifier[getNewAppKeyFromResult] operator[SEP] identifier[result] , identifier[startTime] , identifier[endTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[appKey] operator[!=] Other[null] operator[SEP] {
identifier[newAppsKeys] operator[SEP] identifier[add] operator[SEP] identifier[appKey] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[newAppsKeys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>=] identifier[maxCount] operator[SEP] {
Keyword[break] operator[SEP]
}
}
}
identifier[timer] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[rowCount] operator[+] literal[String] operator[+] identifier[colCount] operator[+] literal[String] operator[+] identifier[resultSize] operator[+] literal[String] operator[+] identifier[resultSize] operator[/] operator[SEP] Other[1024] operator[*] Other[1024] operator[SEP] operator[+] literal[String] operator[+] identifier[timer] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[scanner] operator[!=] Other[null] operator[SEP] {
identifier[scanner] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[versionsTable] operator[!=] Other[null] operator[SEP] {
identifier[versionsTable] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[newAppsKeys] operator[SEP]
}
|
@POST
@Path("refresh")
@Consumes(MediaType.APPLICATION_JSON)
public Response refreshAccessToken(RefreshTokenRequest refreshToken) {
// Perform all validation here to control the exact error message returned to comply with the Oauth2 standard
if (null == refreshToken.getRefresh_token() ||
null == refreshToken.getGrant_type()) {
throw new BadRequestRestException(ImmutableMap.of("error", "invalid_request"));
}
if (!REFRESH_TOKEN_GRANT_TYPE.equals(refreshToken.getGrant_type())) {
// Unsupported grant type
throw new BadRequestRestException(ImmutableMap.of("error", "unsupported_grant_type"));
}
DConnection connection = connectionDao.findByRefreshToken(refreshToken.getRefresh_token());
if (null == connection) {
throw new BadRequestRestException(ImmutableMap.of("error", "invalid_grant"));
}
// Invalidate the old cache key
connectionDao.invalidateCacheKey(connection.getAccessToken());
connection.setAccessToken(accessTokenGenerator.generate());
connection.setExpireTime(calculateExpirationDate(tokenExpiresIn));
connectionDao.putWithCacheKey(connection.getAccessToken(), connection);
return Response.ok(ImmutableMap.builder()
.put("access_token", connection.getAccessToken())
.put("refresh_token", connection.getRefreshToken())
.put("expires_in", tokenExpiresIn)
.build())
.cookie(createCookie(connection.getAccessToken(), tokenExpiresIn))
.build();
} | class class_name[name] begin[{]
method[refreshAccessToken, return_type[type[Response]], modifier[public], parameter[refreshToken]] begin[{]
if[binary_operation[binary_operation[literal[null], ==, call[refreshToken.getRefresh_token, parameter[]]], ||, binary_operation[literal[null], ==, call[refreshToken.getGrant_type, parameter[]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid_request")], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableMap, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestRestException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[REFRESH_TOKEN_GRANT_TYPE.equals, parameter[call[refreshToken.getGrant_type, parameter[]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unsupported_grant_type")], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableMap, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestRestException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[DConnection], connection]
if[binary_operation[literal[null], ==, member[.connection]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid_grant")], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableMap, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestRestException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[connectionDao.invalidateCacheKey, parameter[call[connection.getAccessToken, parameter[]]]]
call[connection.setAccessToken, parameter[call[accessTokenGenerator.generate, parameter[]]]]
call[connection.setExpireTime, parameter[call[.calculateExpirationDate, parameter[member[.tokenExpiresIn]]]]]
call[connectionDao.putWithCacheKey, parameter[call[connection.getAccessToken, parameter[]], member[.connection]]]
return[call[Response.ok, parameter[call[ImmutableMap.builder, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[POST] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Consumes] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] Keyword[public] identifier[Response] identifier[refreshAccessToken] operator[SEP] identifier[RefreshTokenRequest] identifier[refreshToken] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[refreshToken] operator[SEP] identifier[getRefresh_token] operator[SEP] operator[SEP] operator[||] Other[null] operator[==] identifier[refreshToken] operator[SEP] identifier[getGrant_type] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BadRequestRestException] operator[SEP] identifier[ImmutableMap] operator[SEP] identifier[of] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[REFRESH_TOKEN_GRANT_TYPE] operator[SEP] identifier[equals] operator[SEP] identifier[refreshToken] operator[SEP] identifier[getGrant_type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BadRequestRestException] operator[SEP] identifier[ImmutableMap] operator[SEP] identifier[of] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
identifier[DConnection] identifier[connection] operator[=] identifier[connectionDao] operator[SEP] identifier[findByRefreshToken] operator[SEP] identifier[refreshToken] operator[SEP] identifier[getRefresh_token] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[connection] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BadRequestRestException] operator[SEP] identifier[ImmutableMap] operator[SEP] identifier[of] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
identifier[connectionDao] operator[SEP] identifier[invalidateCacheKey] operator[SEP] identifier[connection] operator[SEP] identifier[getAccessToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[setAccessToken] operator[SEP] identifier[accessTokenGenerator] operator[SEP] identifier[generate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[setExpireTime] operator[SEP] identifier[calculateExpirationDate] operator[SEP] identifier[tokenExpiresIn] operator[SEP] operator[SEP] operator[SEP] identifier[connectionDao] operator[SEP] identifier[putWithCacheKey] operator[SEP] identifier[connection] operator[SEP] identifier[getAccessToken] operator[SEP] operator[SEP] , identifier[connection] operator[SEP] operator[SEP] Keyword[return] identifier[Response] operator[SEP] identifier[ok] operator[SEP] identifier[ImmutableMap] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[connection] operator[SEP] identifier[getAccessToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[connection] operator[SEP] identifier[getRefreshToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[tokenExpiresIn] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cookie] operator[SEP] identifier[createCookie] operator[SEP] identifier[connection] operator[SEP] identifier[getAccessToken] operator[SEP] operator[SEP] , identifier[tokenExpiresIn] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Server getServer(final Settings settings, final String serverId) {
if (settings == null || StringUtils.isEmpty(serverId)) {
return null;
}
return settings.getServer(serverId);
} | class class_name[name] begin[{]
method[getServer, return_type[type[Server]], modifier[public static], parameter[settings, serverId]] begin[{]
if[binary_operation[binary_operation[member[.settings], ==, literal[null]], ||, call[StringUtils.isEmpty, parameter[member[.serverId]]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[settings.getServer, parameter[member[.serverId]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Server] identifier[getServer] operator[SEP] Keyword[final] identifier[Settings] identifier[settings] , Keyword[final] identifier[String] identifier[serverId] operator[SEP] {
Keyword[if] operator[SEP] identifier[settings] operator[==] Other[null] operator[||] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[serverId] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] identifier[settings] operator[SEP] identifier[getServer] operator[SEP] identifier[serverId] operator[SEP] operator[SEP]
}
|
public void save() throws IOException {
if (id == null) {
this.id = client.postCreate(blog_name, detail());
} else {
client.postEdit(blog_name, id, detail());
}
} | class class_name[name] begin[{]
method[save, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.id], ==, literal[null]]] begin[{]
assign[THIS[member[None.id]], call[client.postCreate, parameter[member[.blog_name], call[.detail, parameter[]]]]]
else begin[{]
call[client.postEdit, parameter[member[.blog_name], member[.id], call[.detail, parameter[]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[save] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[id] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[id] operator[=] identifier[client] operator[SEP] identifier[postCreate] operator[SEP] identifier[blog_name] , identifier[detail] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[client] operator[SEP] identifier[postEdit] operator[SEP] identifier[blog_name] , identifier[id] , identifier[detail] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public double getLinkChezi( double coefficient, double exponent ) {
double chezi = coefficient * Math.pow(getLinkSlope(), exponent);
return chezi;
} | class class_name[name] begin[{]
method[getLinkChezi, return_type[type[double]], modifier[public], parameter[coefficient, exponent]] begin[{]
local_variable[type[double], chezi]
return[member[.chezi]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[getLinkChezi] operator[SEP] Keyword[double] identifier[coefficient] , Keyword[double] identifier[exponent] operator[SEP] {
Keyword[double] identifier[chezi] operator[=] identifier[coefficient] operator[*] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[getLinkSlope] operator[SEP] operator[SEP] , identifier[exponent] operator[SEP] operator[SEP] Keyword[return] identifier[chezi] operator[SEP]
}
|
private int doExport(String tableReference, List<String> spatialFieldNames, ResultSet rs, int recordCount, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
if (spatialFieldNames.isEmpty()) {
throw new SQLException(String.format("The table or the query %s does not contain a geometry field", tableReference));
}
int srid =0;
ShapeType shapeType = null;
try {
ResultSetMetaData resultSetMetaData = rs.getMetaData();
int geoFieldIndex = JDBCUtilities.getFieldIndex(resultSetMetaData, spatialFieldNames.get(0));
ArrayList<Integer> columnIndexes = new ArrayList<Integer>();
DbaseFileHeader header = DBFDriverFunction.dBaseHeaderFromMetaData(resultSetMetaData, columnIndexes);
columnIndexes.add(0, geoFieldIndex);
if (encoding != null) {
header.setEncoding(encoding);
}
header.setNumRecords(recordCount);
SHPDriver shpDriver = null;
Object[] row = new Object[header.getNumFields() + 1];
while (rs.next()) {
int i = 0;
for (Integer index : columnIndexes) {
row[i++] = rs.getObject(index);
}
if (shpDriver == null) {
// If there is not shape type constraint read the first geometry and use the same type
byte[] wkb = rs.getBytes(geoFieldIndex);
if (wkb != null) {
GeometryMetaData gm = GeometryMetaData.getMetaDataFromWKB(wkb);
if (srid == 0) {
srid = gm.SRID;
}
shapeType = getShapeTypeFromGeometryMetaData(gm);
}
if (shapeType != null) {
shpDriver = new SHPDriver();
shpDriver.setGeometryFieldIndex(0);
shpDriver.initDriver(fileName, shapeType, header);
} else {
throw new SQLException("Unsupported geometry type.");
}
}
if (shpDriver != null) {
shpDriver.insertRow(row);
}
progress.endStep();
}
if (shpDriver != null) {
shpDriver.close();
}
} finally {
rs.close();
}
return srid;
} | class class_name[name] begin[{]
method[doExport, return_type[type[int]], modifier[private], parameter[tableReference, spatialFieldNames, rs, recordCount, fileName, progress, encoding]] begin[{]
if[call[spatialFieldNames.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The table or the query %s does not contain a geometry field"), MemberReference(member=tableReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], srid]
local_variable[type[ShapeType], shapeType]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMetaData, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=resultSetMetaData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResultSetMetaData, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resultSetMetaData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=spatialFieldNames, selectors=[], type_arguments=None)], member=getFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=JDBCUtilities, selectors=[], type_arguments=None), name=geoFieldIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=columnIndexes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resultSetMetaData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnIndexes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dBaseHeaderFromMetaData, postfix_operators=[], prefix_operators=[], qualifier=DBFDriverFunction, selectors=[], type_arguments=None), name=header)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DbaseFileHeader, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=geoFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=columnIndexes, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEncoding, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=recordCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNumRecords, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=shpDriver)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SHPDriver, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNumFields, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=columnIndexes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=shpDriver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=geoFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=wkb)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=wkb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=wkb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMetaDataFromWKB, postfix_operators=[], prefix_operators=[], qualifier=GeometryMetaData, selectors=[], type_arguments=None), name=gm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GeometryMetaData, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=srid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=srid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=SRID, postfix_operators=[], prefix_operators=[], qualifier=gm, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=shapeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=gm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getShapeTypeFromGeometryMetaData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=shapeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported geometry type.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shpDriver, 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=SHPDriver, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setGeometryFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=shpDriver, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=shapeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initDriver, postfix_operators=[], prefix_operators=[], qualifier=shpDriver, selectors=[], type_arguments=None), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=shpDriver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insertRow, postfix_operators=[], prefix_operators=[], qualifier=shpDriver, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=endStep, postfix_operators=[], prefix_operators=[], qualifier=progress, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=shpDriver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=shpDriver, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[member[.srid]]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[doExport] operator[SEP] identifier[String] identifier[tableReference] , identifier[List] operator[<] identifier[String] operator[>] identifier[spatialFieldNames] , identifier[ResultSet] identifier[rs] , Keyword[int] identifier[recordCount] , identifier[File] identifier[fileName] , identifier[ProgressVisitor] identifier[progress] , identifier[String] identifier[encoding] operator[SEP] Keyword[throws] identifier[SQLException] , identifier[IOException] {
Keyword[if] operator[SEP] identifier[spatialFieldNames] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[tableReference] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[int] identifier[srid] operator[=] Other[0] operator[SEP] identifier[ShapeType] identifier[shapeType] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[ResultSetMetaData] identifier[resultSetMetaData] operator[=] identifier[rs] operator[SEP] identifier[getMetaData] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[geoFieldIndex] operator[=] identifier[JDBCUtilities] operator[SEP] identifier[getFieldIndex] operator[SEP] identifier[resultSetMetaData] , identifier[spatialFieldNames] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[columnIndexes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[DbaseFileHeader] identifier[header] operator[=] identifier[DBFDriverFunction] operator[SEP] identifier[dBaseHeaderFromMetaData] operator[SEP] identifier[resultSetMetaData] , identifier[columnIndexes] operator[SEP] operator[SEP] identifier[columnIndexes] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[geoFieldIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encoding] operator[!=] Other[null] operator[SEP] {
identifier[header] operator[SEP] identifier[setEncoding] operator[SEP] identifier[encoding] operator[SEP] operator[SEP]
}
identifier[header] operator[SEP] identifier[setNumRecords] operator[SEP] identifier[recordCount] operator[SEP] operator[SEP] identifier[SHPDriver] identifier[shpDriver] operator[=] Other[null] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[row] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[header] operator[SEP] identifier[getNumFields] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[index] operator[:] identifier[columnIndexes] operator[SEP] {
identifier[row] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[rs] operator[SEP] identifier[getObject] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[shpDriver] operator[==] Other[null] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[wkb] operator[=] identifier[rs] operator[SEP] identifier[getBytes] operator[SEP] identifier[geoFieldIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wkb] operator[!=] Other[null] operator[SEP] {
identifier[GeometryMetaData] identifier[gm] operator[=] identifier[GeometryMetaData] operator[SEP] identifier[getMetaDataFromWKB] operator[SEP] identifier[wkb] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[srid] operator[==] Other[0] operator[SEP] {
identifier[srid] operator[=] identifier[gm] operator[SEP] identifier[SRID] operator[SEP]
}
identifier[shapeType] operator[=] identifier[getShapeTypeFromGeometryMetaData] operator[SEP] identifier[gm] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[shapeType] operator[!=] Other[null] operator[SEP] {
identifier[shpDriver] operator[=] Keyword[new] identifier[SHPDriver] operator[SEP] operator[SEP] operator[SEP] identifier[shpDriver] operator[SEP] identifier[setGeometryFieldIndex] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[shpDriver] operator[SEP] identifier[initDriver] operator[SEP] identifier[fileName] , identifier[shapeType] , identifier[header] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[shpDriver] operator[!=] Other[null] operator[SEP] {
identifier[shpDriver] operator[SEP] identifier[insertRow] operator[SEP] identifier[row] operator[SEP] operator[SEP]
}
identifier[progress] operator[SEP] identifier[endStep] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[shpDriver] operator[!=] Other[null] operator[SEP] {
identifier[shpDriver] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[rs] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[srid] operator[SEP]
}
|
@Override
public void applyConfig(final ConfigSettings config)
{
Object o = config
.getConfigParameter(ConfigurationKeys.WIKIPEDIA_ENCODING);
if (o != null) {
encodingField.setText((String) o);
}
else {
encodingField.setText("");
}
o = config.getConfigParameter(ConfigurationKeys.MODE_SURROGATES);
if (o != null) {
controller.setSurrogates((SurrogateModes) o);
}
else {
controller.setSurrogates(SurrogateModes.DISCARD_REVISION);
}
} | class class_name[name] begin[{]
method[applyConfig, return_type[void], modifier[public], parameter[config]] begin[{]
local_variable[type[Object], o]
if[binary_operation[member[.o], !=, literal[null]]] begin[{]
call[encodingField.setText, parameter[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]
else begin[{]
call[encodingField.setText, parameter[literal[""]]]
end[}]
assign[member[.o], call[config.getConfigParameter, parameter[member[ConfigurationKeys.MODE_SURROGATES]]]]
if[binary_operation[member[.o], !=, literal[null]]] begin[{]
call[controller.setSurrogates, parameter[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SurrogateModes, sub_type=None))]]
else begin[{]
call[controller.setSurrogates, parameter[member[SurrogateModes.DISCARD_REVISION]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[applyConfig] operator[SEP] Keyword[final] identifier[ConfigSettings] identifier[config] operator[SEP] {
identifier[Object] identifier[o] operator[=] identifier[config] operator[SEP] identifier[getConfigParameter] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[WIKIPEDIA_ENCODING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[!=] Other[null] operator[SEP] {
identifier[encodingField] operator[SEP] identifier[setText] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[o] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[encodingField] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[o] operator[=] identifier[config] operator[SEP] identifier[getConfigParameter] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[MODE_SURROGATES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[!=] Other[null] operator[SEP] {
identifier[controller] operator[SEP] identifier[setSurrogates] operator[SEP] operator[SEP] identifier[SurrogateModes] operator[SEP] identifier[o] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[controller] operator[SEP] identifier[setSurrogates] operator[SEP] identifier[SurrogateModes] operator[SEP] identifier[DISCARD_REVISION] operator[SEP] operator[SEP]
}
}
|
public final BatchCreateOccurrencesResponse batchCreateOccurrences(
ProjectName parent, List<Occurrence> occurrences) {
BatchCreateOccurrencesRequest request =
BatchCreateOccurrencesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.addAllOccurrences(occurrences)
.build();
return batchCreateOccurrences(request);
} | class class_name[name] begin[{]
method[batchCreateOccurrences, return_type[type[BatchCreateOccurrencesResponse]], modifier[final public], parameter[parent, occurrences]] begin[{]
local_variable[type[BatchCreateOccurrencesRequest], request]
return[call[.batchCreateOccurrences, parameter[member[.request]]]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[BatchCreateOccurrencesResponse] identifier[batchCreateOccurrences] operator[SEP] identifier[ProjectName] identifier[parent] , identifier[List] operator[<] identifier[Occurrence] operator[>] identifier[occurrences] operator[SEP] {
identifier[BatchCreateOccurrencesRequest] identifier[request] operator[=] identifier[BatchCreateOccurrencesRequest] 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[addAllOccurrences] operator[SEP] identifier[occurrences] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[batchCreateOccurrences] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static void convertRowToBlock( int numRows , int numCols , int blockLength ,
double[] data, double[] tmp )
{
int minLength = Math.min( blockLength , numRows ) * numCols;
if( tmp.length < minLength ) {
throw new IllegalArgumentException("tmp must be at least "+minLength+" long ");
}
for( int i = 0; i < numRows; i += blockLength ) {
int blockHeight = Math.min( blockLength , numRows - i);
System.arraycopy(data,i*numCols,tmp,0,blockHeight*numCols);
for( int j = 0; j < numCols; j += blockLength ) {
int blockWidth = Math.min( blockLength , numCols - j);
int indexDst = i*numCols + blockHeight*j;
int indexSrcRow = j;
for( int k = 0; k < blockHeight; k++ ) {
System.arraycopy(tmp,indexSrcRow,data,indexDst,blockWidth);
indexDst += blockWidth;
indexSrcRow += numCols;
}
}
}
} | class class_name[name] begin[{]
method[convertRowToBlock, return_type[void], modifier[public static], parameter[numRows, numCols, blockLength, data, tmp]] begin[{]
local_variable[type[int], minLength]
if[binary_operation[member[tmp.length], <, member[.minLength]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="tmp must be at least "), operandr=MemberReference(member=minLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" long "), operator=+)], 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[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=blockLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=blockHeight)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MemberReference(member=blockHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=blockLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=blockWidth)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=blockHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), name=indexDst)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=indexSrcRow)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexSrcRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexDst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=blockWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indexDst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=blockWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indexSrcRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=blockHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=blockLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=blockLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[convertRowToBlock] operator[SEP] Keyword[int] identifier[numRows] , Keyword[int] identifier[numCols] , Keyword[int] identifier[blockLength] , Keyword[double] operator[SEP] operator[SEP] identifier[data] , Keyword[double] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] {
Keyword[int] identifier[minLength] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[blockLength] , identifier[numRows] operator[SEP] operator[*] identifier[numCols] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[SEP] identifier[length] operator[<] identifier[minLength] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[minLength] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numRows] operator[SEP] identifier[i] operator[+=] identifier[blockLength] operator[SEP] {
Keyword[int] identifier[blockHeight] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[blockLength] , identifier[numRows] operator[-] identifier[i] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] , identifier[i] operator[*] identifier[numCols] , identifier[tmp] , Other[0] , identifier[blockHeight] operator[*] identifier[numCols] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[numCols] operator[SEP] identifier[j] operator[+=] identifier[blockLength] operator[SEP] {
Keyword[int] identifier[blockWidth] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[blockLength] , identifier[numCols] operator[-] identifier[j] operator[SEP] operator[SEP] Keyword[int] identifier[indexDst] operator[=] identifier[i] operator[*] identifier[numCols] operator[+] identifier[blockHeight] operator[*] identifier[j] operator[SEP] Keyword[int] identifier[indexSrcRow] operator[=] identifier[j] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[blockHeight] operator[SEP] identifier[k] operator[++] operator[SEP] {
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[tmp] , identifier[indexSrcRow] , identifier[data] , identifier[indexDst] , identifier[blockWidth] operator[SEP] operator[SEP] identifier[indexDst] operator[+=] identifier[blockWidth] operator[SEP] identifier[indexSrcRow] operator[+=] identifier[numCols] operator[SEP]
}
}
}
}
|
public Matrix4f m20(float m20) {
this.m20 = m20;
properties &= ~PROPERTY_ORTHONORMAL;
if (m20 != 0.0f)
properties &= ~(PROPERTY_IDENTITY | PROPERTY_PERSPECTIVE | PROPERTY_TRANSLATION);
return this;
} | class class_name[name] begin[{]
method[m20, return_type[type[Matrix4f]], modifier[public], parameter[m20]] begin[{]
assign[THIS[member[None.m20]], member[.m20]]
assign[member[.properties], member[.PROPERTY_ORTHONORMAL]]
if[binary_operation[member[.m20], !=, literal[0.0f]]] begin[{]
assign[member[.properties], binary_operation[binary_operation[member[.PROPERTY_IDENTITY], |, member[.PROPERTY_PERSPECTIVE]], |, member[.PROPERTY_TRANSLATION]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Matrix4f] identifier[m20] operator[SEP] Keyword[float] identifier[m20] operator[SEP] {
Keyword[this] operator[SEP] identifier[m20] operator[=] identifier[m20] operator[SEP] identifier[properties] operator[&=] operator[~] identifier[PROPERTY_ORTHONORMAL] operator[SEP] Keyword[if] operator[SEP] identifier[m20] operator[!=] literal[Float] operator[SEP] identifier[properties] operator[&=] operator[~] operator[SEP] identifier[PROPERTY_IDENTITY] operator[|] identifier[PROPERTY_PERSPECTIVE] operator[|] identifier[PROPERTY_TRANSLATION] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public Set<TypedEdge<T>> getEdges(int vertex, Set<T> types) {
// NOTE: this is purely unoptimized code, so fix if it ever gets in a
// hotspot
Set<TypedEdge<T>> set = new HashSet<TypedEdge<T>>();
for (TypedEdge<T> e : new EdgesForVertex(vertex))
if (types.contains(e.edgeType()))
set.add(e);
return set;
} | class class_name[name] begin[{]
method[getEdges, return_type[type[Set]], modifier[public], parameter[vertex, types]] begin[{]
local_variable[type[Set], set]
ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=edgeType, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), label=None)), control=EnhancedForControl(iterable=ClassCreator(arguments=[MemberReference(member=vertex, 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=EdgesForVertex, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=TypedEdge, sub_type=None))), label=None)
return[member[.set]]
end[}]
END[}] | Keyword[public] identifier[Set] operator[<] identifier[TypedEdge] operator[<] identifier[T] operator[>] operator[>] identifier[getEdges] operator[SEP] Keyword[int] identifier[vertex] , identifier[Set] operator[<] identifier[T] operator[>] identifier[types] operator[SEP] {
identifier[Set] operator[<] identifier[TypedEdge] operator[<] identifier[T] operator[>] operator[>] identifier[set] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[TypedEdge] operator[<] identifier[T] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TypedEdge] operator[<] identifier[T] operator[>] identifier[e] operator[:] Keyword[new] identifier[EdgesForVertex] operator[SEP] identifier[vertex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[types] operator[SEP] identifier[contains] operator[SEP] identifier[e] operator[SEP] identifier[edgeType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[return] identifier[set] operator[SEP]
}
|
public void setEnabledCloudwatchLogsExports(java.util.Collection<String> enabledCloudwatchLogsExports) {
if (enabledCloudwatchLogsExports == null) {
this.enabledCloudwatchLogsExports = null;
return;
}
this.enabledCloudwatchLogsExports = new java.util.ArrayList<String>(enabledCloudwatchLogsExports);
} | class class_name[name] begin[{]
method[setEnabledCloudwatchLogsExports, return_type[void], modifier[public], parameter[enabledCloudwatchLogsExports]] begin[{]
if[binary_operation[member[.enabledCloudwatchLogsExports], ==, literal[null]]] begin[{]
assign[THIS[member[None.enabledCloudwatchLogsExports]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.enabledCloudwatchLogsExports]], ClassCreator(arguments=[MemberReference(member=enabledCloudwatchLogsExports, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setEnabledCloudwatchLogsExports] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[enabledCloudwatchLogsExports] operator[SEP] {
Keyword[if] operator[SEP] identifier[enabledCloudwatchLogsExports] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[enabledCloudwatchLogsExports] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[enabledCloudwatchLogsExports] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[enabledCloudwatchLogsExports] operator[SEP] operator[SEP]
}
|
public void info(String format, Object arg) {
formatAndLog(Log.INFO, format, arg);
} | class class_name[name] begin[{]
method[info, return_type[void], modifier[public], parameter[format, arg]] begin[{]
call[.formatAndLog, parameter[member[Log.INFO], member[.format], member[.arg]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[info] operator[SEP] identifier[String] identifier[format] , identifier[Object] identifier[arg] operator[SEP] {
identifier[formatAndLog] operator[SEP] identifier[Log] operator[SEP] identifier[INFO] , identifier[format] , identifier[arg] operator[SEP] operator[SEP]
}
|
protected Columns determineProjectedColumns( PlanNode optimizedPlan,
final ScanQueryContext context ) {
final PlanHints hints = context.getHints();
// Look for which columns to include in the results; this will be defined by the highest PROJECT node ...
PlanNode project = optimizedPlan;
if (project.getType() != Type.PROJECT) {
project = optimizedPlan.findAtOrBelow(Traversal.LEVEL_ORDER, Type.PROJECT);
}
if (project != null) {
List<Column> columns = project.getPropertyAsList(Property.PROJECT_COLUMNS, Column.class);
List<String> columnTypes = project.getPropertyAsList(Property.PROJECT_COLUMN_TYPES, String.class);
// Determine whether to include the full-text search scores in the results ...
boolean includeFullTextSearchScores = hints.hasFullTextSearch;
if (!includeFullTextSearchScores) {
for (PlanNode select : optimizedPlan.findAllAtOrBelow(Type.SELECT)) {
Constraint constraint = select.getProperty(Property.SELECT_CRITERIA, Constraint.class);
if (QueryUtil.includeFullTextScores(constraint)) {
includeFullTextSearchScores = true;
break;
}
}
}
// The projected columns may not include all of the selectors from the child of the PROJECT node.
// So, we need to figure out the selector indexes based upon the ResultColumn for the child ...
Columns childColumns = context.columnsFor(project.getFirstChild());
return new ResultColumns(columns, columnTypes, includeFullTextSearchScores, childColumns);
}
// Look for a SOURCE ...
if (optimizedPlan.getType() == Type.SOURCE) {
PlanNode source = optimizedPlan;
List<Schemata.Column> schemataColumns = source.getPropertyAsList(Property.SOURCE_COLUMNS, Schemata.Column.class);
List<Column> columns = new ArrayList<>(schemataColumns.size());
List<String> columnTypes = new ArrayList<>(schemataColumns.size());
SelectorName selector = source.getSelectors().iterator().next();
for (Schemata.Column schemataColumn : schemataColumns) {
Column column = new Column(selector, schemataColumn.getName(), schemataColumn.getName());
columns.add(column);
columnTypes.add(schemataColumn.getPropertyTypeName());
}
return new ResultColumns(columns, columnTypes, hints.hasFullTextSearch, null);
}
return ResultColumns.EMPTY;
} | class class_name[name] begin[{]
method[determineProjectedColumns, return_type[type[Columns]], modifier[protected], parameter[optimizedPlan, context]] begin[{]
local_variable[type[PlanHints], hints]
local_variable[type[PlanNode], project]
if[binary_operation[call[project.getType, parameter[]], !=, member[Type.PROJECT]]] begin[{]
assign[member[.project], call[optimizedPlan.findAtOrBelow, parameter[member[Traversal.LEVEL_ORDER], member[Type.PROJECT]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.project], !=, literal[null]]] begin[{]
local_variable[type[List], columns]
local_variable[type[List], columnTypes]
local_variable[type[boolean], includeFullTextSearchScores]
if[member[.includeFullTextSearchScores]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=SELECT_CRITERIA, postfix_operators=[], prefix_operators=[], qualifier=Property, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Constraint, sub_type=None))], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=select, selectors=[], type_arguments=None), name=constraint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Constraint, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=constraint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=includeFullTextScores, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=includeFullTextSearchScores, 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=[MemberReference(member=SELECT, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], member=findAllAtOrBelow, postfix_operators=[], prefix_operators=[], qualifier=optimizedPlan, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=select)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PlanNode, sub_type=None))), label=None)
else begin[{]
None
end[}]
local_variable[type[Columns], childColumns]
return[ClassCreator(arguments=[MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=includeFullTextSearchScores, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=childColumns, 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=ResultColumns, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[call[optimizedPlan.getType, parameter[]], ==, member[Type.SOURCE]]] begin[{]
local_variable[type[PlanNode], source]
local_variable[type[List], schemataColumns]
local_variable[type[List], columns]
local_variable[type[List], columnTypes]
local_variable[type[SelectorName], selector]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=schemataColumn, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=schemataColumn, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Column, sub_type=None)), name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Column, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyTypeName, postfix_operators=[], prefix_operators=[], qualifier=schemataColumn, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=columnTypes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=schemataColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=schemataColumn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Schemata, sub_type=ReferenceType(arguments=None, dimensions=None, name=Column, sub_type=None)))), label=None)
return[ClassCreator(arguments=[MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hasFullTextSearch, postfix_operators=[], prefix_operators=[], qualifier=hints, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResultColumns, sub_type=None))]
else begin[{]
None
end[}]
return[member[ResultColumns.EMPTY]]
end[}]
END[}] | Keyword[protected] identifier[Columns] identifier[determineProjectedColumns] operator[SEP] identifier[PlanNode] identifier[optimizedPlan] , Keyword[final] identifier[ScanQueryContext] identifier[context] operator[SEP] {
Keyword[final] identifier[PlanHints] identifier[hints] operator[=] identifier[context] operator[SEP] identifier[getHints] operator[SEP] operator[SEP] operator[SEP] identifier[PlanNode] identifier[project] operator[=] identifier[optimizedPlan] operator[SEP] Keyword[if] operator[SEP] identifier[project] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[!=] identifier[Type] operator[SEP] identifier[PROJECT] operator[SEP] {
identifier[project] operator[=] identifier[optimizedPlan] operator[SEP] identifier[findAtOrBelow] operator[SEP] identifier[Traversal] operator[SEP] identifier[LEVEL_ORDER] , identifier[Type] operator[SEP] identifier[PROJECT] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[project] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] identifier[Column] operator[>] identifier[columns] operator[=] identifier[project] operator[SEP] identifier[getPropertyAsList] operator[SEP] identifier[Property] operator[SEP] identifier[PROJECT_COLUMNS] , identifier[Column] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[columnTypes] operator[=] identifier[project] operator[SEP] identifier[getPropertyAsList] operator[SEP] identifier[Property] operator[SEP] identifier[PROJECT_COLUMN_TYPES] , identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[boolean] identifier[includeFullTextSearchScores] operator[=] identifier[hints] operator[SEP] identifier[hasFullTextSearch] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[includeFullTextSearchScores] operator[SEP] {
Keyword[for] operator[SEP] identifier[PlanNode] identifier[select] operator[:] identifier[optimizedPlan] operator[SEP] identifier[findAllAtOrBelow] operator[SEP] identifier[Type] operator[SEP] identifier[SELECT] operator[SEP] operator[SEP] {
identifier[Constraint] identifier[constraint] operator[=] identifier[select] operator[SEP] identifier[getProperty] operator[SEP] identifier[Property] operator[SEP] identifier[SELECT_CRITERIA] , identifier[Constraint] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[QueryUtil] operator[SEP] identifier[includeFullTextScores] operator[SEP] identifier[constraint] operator[SEP] operator[SEP] {
identifier[includeFullTextSearchScores] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
}
identifier[Columns] identifier[childColumns] operator[=] identifier[context] operator[SEP] identifier[columnsFor] operator[SEP] identifier[project] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ResultColumns] operator[SEP] identifier[columns] , identifier[columnTypes] , identifier[includeFullTextSearchScores] , identifier[childColumns] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[optimizedPlan] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Type] operator[SEP] identifier[SOURCE] operator[SEP] {
identifier[PlanNode] identifier[source] operator[=] identifier[optimizedPlan] operator[SEP] identifier[List] operator[<] identifier[Schemata] operator[SEP] identifier[Column] operator[>] identifier[schemataColumns] operator[=] identifier[source] operator[SEP] identifier[getPropertyAsList] operator[SEP] identifier[Property] operator[SEP] identifier[SOURCE_COLUMNS] , identifier[Schemata] operator[SEP] identifier[Column] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Column] operator[>] identifier[columns] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[schemataColumns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[columnTypes] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[schemataColumns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SelectorName] identifier[selector] operator[=] identifier[source] operator[SEP] identifier[getSelectors] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Schemata] operator[SEP] identifier[Column] identifier[schemataColumn] operator[:] identifier[schemataColumns] operator[SEP] {
identifier[Column] identifier[column] operator[=] Keyword[new] identifier[Column] operator[SEP] identifier[selector] , identifier[schemataColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[schemataColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[columns] operator[SEP] identifier[add] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[columnTypes] operator[SEP] identifier[add] operator[SEP] identifier[schemataColumn] operator[SEP] identifier[getPropertyTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[ResultColumns] operator[SEP] identifier[columns] , identifier[columnTypes] , identifier[hints] operator[SEP] identifier[hasFullTextSearch] , Other[null] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ResultColumns] operator[SEP] identifier[EMPTY] operator[SEP]
}
|
public static VariableReference getVariableReference(PageContext pc, String var) throws PageException {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) throw new InterpreterException("invalid variable declaration [" + var + "]");
if (list.size() == 1) {
return new VariableReference(pc.undefinedScope(), list.next());
}
int scope = scopeString2Int(pc.ignoreScopes(), list.next());
Object coll;
if (scope == Scope.SCOPE_UNDEFINED) {
coll = pc.touch(pc.undefinedScope(), KeyImpl.init(list.current()));
}
else {
coll = VariableInterpreter.scope(pc, scope, list.hasNext());
// coll=pc.scope(scope);
}
while (list.hasNextNext()) {
coll = pc.touch(coll, KeyImpl.init(list.next()));
}
if (!(coll instanceof Collection)) throw new InterpreterException("invalid variable [" + var + "]");
return new VariableReference((Collection) coll, list.next());
} | class class_name[name] begin[{]
method[getVariableReference, return_type[type[VariableReference]], modifier[public static], parameter[pc, var]] begin[{]
local_variable[type[StringList], list]
if[binary_operation[member[.list], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid variable declaration ["), operandr=MemberReference(member=var, 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=InterpreterException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[list.size, parameter[]], ==, literal[1]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=undefinedScope, postfix_operators=[], prefix_operators=[], qualifier=pc, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VariableReference, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[int], scope]
local_variable[type[Object], coll]
if[binary_operation[member[.scope], ==, member[Scope.SCOPE_UNDEFINED]]] begin[{]
assign[member[.coll], call[pc.touch, parameter[call[pc.undefinedScope, parameter[]], call[KeyImpl.init, parameter[call[list.current, parameter[]]]]]]]
else begin[{]
assign[member[.coll], call[VariableInterpreter.scope, parameter[member[.pc], member[.scope], call[list.hasNext, parameter[]]]]]
end[}]
while[call[list.hasNextNext, parameter[]]] begin[{]
assign[member[.coll], call[pc.touch, parameter[member[.coll], call[KeyImpl.init, parameter[call[list.next, parameter[]]]]]]]
end[}]
if[binary_operation[member[.coll], instanceof, type[Collection]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid variable ["), operandr=MemberReference(member=var, 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=InterpreterException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[ClassCreator(arguments=[Cast(expression=MemberReference(member=coll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None)), MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VariableReference, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[VariableReference] identifier[getVariableReference] operator[SEP] identifier[PageContext] identifier[pc] , identifier[String] identifier[var] operator[SEP] Keyword[throws] identifier[PageException] {
identifier[StringList] identifier[list] operator[=] identifier[parse] operator[SEP] identifier[pc] , Keyword[new] identifier[ParserString] operator[SEP] identifier[var] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[InterpreterException] operator[SEP] literal[String] operator[+] identifier[var] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[return] Keyword[new] identifier[VariableReference] operator[SEP] identifier[pc] operator[SEP] identifier[undefinedScope] operator[SEP] operator[SEP] , identifier[list] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[int] identifier[scope] operator[=] identifier[scopeString2Int] operator[SEP] identifier[pc] operator[SEP] identifier[ignoreScopes] operator[SEP] operator[SEP] , identifier[list] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[coll] operator[SEP] Keyword[if] operator[SEP] identifier[scope] operator[==] identifier[Scope] operator[SEP] identifier[SCOPE_UNDEFINED] operator[SEP] {
identifier[coll] operator[=] identifier[pc] operator[SEP] identifier[touch] operator[SEP] identifier[pc] operator[SEP] identifier[undefinedScope] operator[SEP] operator[SEP] , identifier[KeyImpl] operator[SEP] identifier[init] operator[SEP] identifier[list] operator[SEP] identifier[current] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[coll] operator[=] identifier[VariableInterpreter] operator[SEP] identifier[scope] operator[SEP] identifier[pc] , identifier[scope] , identifier[list] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[list] operator[SEP] identifier[hasNextNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[coll] operator[=] identifier[pc] operator[SEP] identifier[touch] operator[SEP] identifier[coll] , identifier[KeyImpl] operator[SEP] identifier[init] operator[SEP] identifier[list] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[coll] Keyword[instanceof] identifier[Collection] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InterpreterException] operator[SEP] literal[String] operator[+] identifier[var] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[VariableReference] operator[SEP] operator[SEP] identifier[Collection] operator[SEP] identifier[coll] , identifier[list] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void writeHeadersTo(final CacheResponse pResponse) {
String[] headers = getHeaderNames();
for (String header : headers) {
// HACK...
// Strip away internal headers
if (HTTPCache.HEADER_CACHED_TIME.equals(header)) {
continue;
}
// TODO: Replace Last-Modified with X-Cached-At? See CachedEntityImpl
String[] headerValues = getHeaderValues(header);
for (int i = 0; i < headerValues.length; i++) {
String headerValue = headerValues[i];
if (i == 0) {
pResponse.setHeader(header, headerValue);
}
else {
pResponse.addHeader(header, headerValue);
}
}
}
} | class class_name[name] begin[{]
method[writeHeadersTo, return_type[void], modifier[public], parameter[pResponse]] begin[{]
local_variable[type[String], headers]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=HTTPCache.HEADER_CACHED_TIME, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHeaderValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=headerValues)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=headerValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=headerValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=pResponse, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=pResponse, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=headerValues, 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)]), control=EnhancedForControl(iterable=MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=header)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[writeHeadersTo] operator[SEP] Keyword[final] identifier[CacheResponse] identifier[pResponse] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[headers] operator[=] identifier[getHeaderNames] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[header] operator[:] identifier[headers] operator[SEP] {
Keyword[if] operator[SEP] identifier[HTTPCache] operator[SEP] identifier[HEADER_CACHED_TIME] operator[SEP] identifier[equals] operator[SEP] identifier[header] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[headerValues] operator[=] identifier[getHeaderValues] operator[SEP] identifier[header] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[headerValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[headerValue] operator[=] identifier[headerValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] Other[0] operator[SEP] {
identifier[pResponse] operator[SEP] identifier[setHeader] operator[SEP] identifier[header] , identifier[headerValue] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[pResponse] operator[SEP] identifier[addHeader] operator[SEP] identifier[header] , identifier[headerValue] operator[SEP] operator[SEP]
}
}
}
}
|
public static Map<String,Object> getInitialProperties(javax.servlet.Servlet servlet, BasicServlet.SERVLET_TYPE servletType)
{
Map<String,Object> properties = new Hashtable<String,Object>();
Enumeration<?> enumeration = servlet.getServletConfig().getInitParameterNames();
while (enumeration.hasMoreElements())
{
String strParamName = (String)enumeration.nextElement();
String strValue = servlet.getServletConfig().getInitParameter(strParamName);
properties.put(strParamName, strValue);
}
properties.put(DBParams.SERVLET, DBConstants.TRUE); // Flag - yes this is a servlet
if (properties.get(DBParams.FREEIFDONE) == null)
properties.put(DBParams.FREEIFDONE, DBConstants.FALSE); // Don't free when only the last app is running.
if (properties.get(DBParams.LOCAL) == null)
properties.put(DBParams.LOCAL, DBParams.JDBC); // Servlets uses Jdbc by default
if (properties.get(DBParams.REMOTE) == null)
properties.put(DBParams.REMOTE, DBParams.JDBC);
if (properties.get(DBParams.TABLE) == null)
properties.put(DBParams.TABLE, DBParams.JDBC);
return properties;
} | class class_name[name] begin[{]
method[getInitialProperties, return_type[type[Map]], modifier[public static], parameter[servlet, servletType]] begin[{]
local_variable[type[Map], properties]
local_variable[type[Enumeration], enumeration]
while[call[enumeration.hasMoreElements, parameter[]]] begin[{]
local_variable[type[String], strParamName]
local_variable[type[String], strValue]
call[properties.put, parameter[member[.strParamName], member[.strValue]]]
end[}]
call[properties.put, parameter[member[DBParams.SERVLET], member[DBConstants.TRUE]]]
if[binary_operation[call[properties.get, parameter[member[DBParams.FREEIFDONE]]], ==, literal[null]]] begin[{]
call[properties.put, parameter[member[DBParams.FREEIFDONE], member[DBConstants.FALSE]]]
else begin[{]
None
end[}]
if[binary_operation[call[properties.get, parameter[member[DBParams.LOCAL]]], ==, literal[null]]] begin[{]
call[properties.put, parameter[member[DBParams.LOCAL], member[DBParams.JDBC]]]
else begin[{]
None
end[}]
if[binary_operation[call[properties.get, parameter[member[DBParams.REMOTE]]], ==, literal[null]]] begin[{]
call[properties.put, parameter[member[DBParams.REMOTE], member[DBParams.JDBC]]]
else begin[{]
None
end[}]
if[binary_operation[call[properties.get, parameter[member[DBParams.TABLE]]], ==, literal[null]]] begin[{]
call[properties.put, parameter[member[DBParams.TABLE], member[DBParams.JDBC]]]
else begin[{]
None
end[}]
return[member[.properties]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getInitialProperties] operator[SEP] identifier[javax] operator[SEP] identifier[servlet] operator[SEP] identifier[Servlet] identifier[servlet] , identifier[BasicServlet] operator[SEP] identifier[SERVLET_TYPE] identifier[servletType] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[=] Keyword[new] identifier[Hashtable] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Enumeration] operator[<] operator[?] operator[>] identifier[enumeration] operator[=] identifier[servlet] operator[SEP] identifier[getServletConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getInitParameterNames] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[enumeration] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[strParamName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[enumeration] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strValue] operator[=] identifier[servlet] operator[SEP] identifier[getServletConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[strParamName] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[strParamName] , identifier[strValue] operator[SEP] operator[SEP]
}
identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[DBParams] operator[SEP] identifier[SERVLET] , identifier[DBConstants] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[DBParams] operator[SEP] identifier[FREEIFDONE] operator[SEP] operator[==] Other[null] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[DBParams] operator[SEP] identifier[FREEIFDONE] , identifier[DBConstants] operator[SEP] identifier[FALSE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[DBParams] operator[SEP] identifier[LOCAL] operator[SEP] operator[==] Other[null] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[DBParams] operator[SEP] identifier[LOCAL] , identifier[DBParams] operator[SEP] identifier[JDBC] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[DBParams] operator[SEP] identifier[REMOTE] operator[SEP] operator[==] Other[null] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[DBParams] operator[SEP] identifier[REMOTE] , identifier[DBParams] operator[SEP] identifier[JDBC] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[DBParams] operator[SEP] identifier[TABLE] operator[SEP] operator[==] Other[null] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[DBParams] operator[SEP] identifier[TABLE] , identifier[DBParams] operator[SEP] identifier[JDBC] operator[SEP] operator[SEP] Keyword[return] identifier[properties] operator[SEP]
}
|
@Deprecated
@SuppressWarnings("WeakerAccess")
public com.google.bigtable.admin.v2.ProjectName getProjectName() {
return com.google.bigtable.admin.v2.ProjectName.of(projectId);
} | class class_name[name] begin[{]
method[getProjectName, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[call[com.google.bigtable.admin.v2.ProjectName.of, parameter[member[.projectId]]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[bigtable] operator[SEP] identifier[admin] operator[SEP] identifier[v2] operator[SEP] identifier[ProjectName] identifier[getProjectName] operator[SEP] operator[SEP] {
Keyword[return] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[bigtable] operator[SEP] identifier[admin] operator[SEP] identifier[v2] operator[SEP] identifier[ProjectName] operator[SEP] identifier[of] operator[SEP] identifier[projectId] operator[SEP] operator[SEP]
}
|
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<AnnotatedDataset, LabelOperationMetadata> labelVideoAsync(
LabelVideoRequest request) {
return labelVideoOperationCallable().futureCall(request);
} | class class_name[name] begin[{]
method[labelVideoAsync, return_type[type[OperationFuture]], modifier[final public], parameter[request]] begin[{]
return[call[.labelVideoOperationCallable, parameter[]]]
end[}]
END[}] | annotation[@] identifier[BetaApi] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[final] identifier[OperationFuture] operator[<] identifier[AnnotatedDataset] , identifier[LabelOperationMetadata] operator[>] identifier[labelVideoAsync] operator[SEP] identifier[LabelVideoRequest] identifier[request] operator[SEP] {
Keyword[return] identifier[labelVideoOperationCallable] operator[SEP] operator[SEP] operator[SEP] identifier[futureCall] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private boolean removeServantRoutingAffinity() {
if (ivServantRoutingAffinity) {
StatefulSessionKey sskey = (StatefulSessionKey) beanId.getPrimaryKey();
byte[] pKeyBytes = sskey.getBytes();
int retcode = container.ivStatefulBeanEnqDeq.SSBeanDeq(pKeyBytes, !home.beanMetaData.sessionActivateTran, true);
if (retcode != 0) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Could not DEQ session bean with key = " + sskey);
return false;
}
ivServantRoutingAffinity = false;
}
return true;
} | class class_name[name] begin[{]
method[removeServantRoutingAffinity, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
if[member[.ivServantRoutingAffinity]] begin[{]
local_variable[type[StatefulSessionKey], sskey]
local_variable[type[byte], pKeyBytes]
local_variable[type[int], retcode]
if[binary_operation[member[.retcode], !=, literal[0]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{]
call[Tr.event, parameter[member[.tc], binary_operation[literal["Could not DEQ session bean with key = "], +, member[.sskey]]]]
else begin[{]
None
end[}]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.ivServantRoutingAffinity], literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[removeServantRoutingAffinity] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ivServantRoutingAffinity] operator[SEP] {
identifier[StatefulSessionKey] identifier[sskey] operator[=] operator[SEP] identifier[StatefulSessionKey] operator[SEP] identifier[beanId] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[pKeyBytes] operator[=] identifier[sskey] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[retcode] operator[=] identifier[container] operator[SEP] identifier[ivStatefulBeanEnqDeq] operator[SEP] identifier[SSBeanDeq] operator[SEP] identifier[pKeyBytes] , operator[!] identifier[home] operator[SEP] identifier[beanMetaData] operator[SEP] identifier[sessionActivateTran] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[retcode] operator[!=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[sskey] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[ivServantRoutingAffinity] operator[=] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void error(String msg, Throwable t)
{
log(LogLevel.ERROR, msg, t);
} | class class_name[name] begin[{]
method[error, return_type[void], modifier[public], parameter[msg, t]] begin[{]
call[.log, parameter[member[LogLevel.ERROR], member[.msg], member[.t]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[error] operator[SEP] identifier[String] identifier[msg] , identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[LogLevel] operator[SEP] identifier[ERROR] , identifier[msg] , identifier[t] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.