code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public JsHandlerRegistration addGeometryIndexDeselectedHandler(final GeometryIndexDeselectedHandler handler) {
org.geomajas.plugin.editing.client.event.state.GeometryIndexDeselectedHandler h;
h = new org.geomajas.plugin.editing.client.event.state.GeometryIndexDeselectedHandler() {
public void onGeometryIndexDeselected(GeometryIndexDeselectedEvent event) {
org.geomajas.plugin.editing.jsapi.client.event.state.GeometryIndexDeselectedEvent e;
List<GeometryIndex> indices = event.getIndices();
e = new org.geomajas.plugin.editing.jsapi.client.event.state.GeometryIndexDeselectedEvent(
event.getGeometry(), indices.toArray(new GeometryIndex[indices.size()]));
handler.onGeometryIndexDeselected(e);
}
};
return new JsHandlerRegistration(new HandlerRegistration[] { delegate.addGeometryIndexDeselectedHandler(h) });
} | class class_name[name] begin[{]
method[addGeometryIndexDeselectedHandler, return_type[type[JsHandlerRegistration]], modifier[public], parameter[handler]] begin[{]
local_variable[type[org], h]
assign[member[.h], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=geomajas, sub_type=ReferenceType(arguments=None, dimensions=None, name=plugin, sub_type=ReferenceType(arguments=None, dimensions=None, name=editing, sub_type=ReferenceType(arguments=None, dimensions=None, name=jsapi, sub_type=ReferenceType(arguments=None, dimensions=None, name=client, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=state, sub_type=ReferenceType(arguments=None, dimensions=None, name=GeometryIndexDeselectedEvent, sub_type=None)))))))))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getIndices, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), name=indices)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=GeometryIndex, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getGeometry, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=indices, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeometryIndex, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=indices, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=geomajas, sub_type=ReferenceType(arguments=None, dimensions=None, name=plugin, sub_type=ReferenceType(arguments=None, dimensions=None, name=editing, sub_type=ReferenceType(arguments=None, dimensions=None, name=jsapi, sub_type=ReferenceType(arguments=None, dimensions=None, name=client, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=state, sub_type=ReferenceType(arguments=None, dimensions=None, name=GeometryIndexDeselectedEvent, sub_type=None))))))))))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onGeometryIndexDeselected, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onGeometryIndexDeselected, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=GeometryIndexDeselectedEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=geomajas, sub_type=ReferenceType(arguments=None, dimensions=None, name=plugin, sub_type=ReferenceType(arguments=None, dimensions=None, name=editing, sub_type=ReferenceType(arguments=None, dimensions=None, name=client, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=state, sub_type=ReferenceType(arguments=None, dimensions=None, name=GeometryIndexDeselectedHandler, sub_type=None)))))))))]
return[ClassCreator(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addGeometryIndexDeselectedHandler, postfix_operators=[], prefix_operators=[], qualifier=delegate, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HandlerRegistration, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsHandlerRegistration, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[JsHandlerRegistration] identifier[addGeometryIndexDeselectedHandler] operator[SEP] Keyword[final] identifier[GeometryIndexDeselectedHandler] identifier[handler] operator[SEP] {
identifier[org] operator[SEP] identifier[geomajas] operator[SEP] identifier[plugin] operator[SEP] identifier[editing] operator[SEP] identifier[client] operator[SEP] identifier[event] operator[SEP] identifier[state] operator[SEP] identifier[GeometryIndexDeselectedHandler] identifier[h] operator[SEP] identifier[h] operator[=] Keyword[new] identifier[org] operator[SEP] identifier[geomajas] operator[SEP] identifier[plugin] operator[SEP] identifier[editing] operator[SEP] identifier[client] operator[SEP] identifier[event] operator[SEP] identifier[state] operator[SEP] identifier[GeometryIndexDeselectedHandler] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onGeometryIndexDeselected] operator[SEP] identifier[GeometryIndexDeselectedEvent] identifier[event] operator[SEP] {
identifier[org] operator[SEP] identifier[geomajas] operator[SEP] identifier[plugin] operator[SEP] identifier[editing] operator[SEP] identifier[jsapi] operator[SEP] identifier[client] operator[SEP] identifier[event] operator[SEP] identifier[state] operator[SEP] identifier[GeometryIndexDeselectedEvent] identifier[e] operator[SEP] identifier[List] operator[<] identifier[GeometryIndex] operator[>] identifier[indices] operator[=] identifier[event] operator[SEP] identifier[getIndices] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[=] Keyword[new] identifier[org] operator[SEP] identifier[geomajas] operator[SEP] identifier[plugin] operator[SEP] identifier[editing] operator[SEP] identifier[jsapi] operator[SEP] identifier[client] operator[SEP] identifier[event] operator[SEP] identifier[state] operator[SEP] identifier[GeometryIndexDeselectedEvent] operator[SEP] identifier[event] operator[SEP] identifier[getGeometry] operator[SEP] operator[SEP] , identifier[indices] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[GeometryIndex] operator[SEP] identifier[indices] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[handler] operator[SEP] identifier[onGeometryIndexDeselected] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
} operator[SEP] Keyword[return] Keyword[new] identifier[JsHandlerRegistration] operator[SEP] Keyword[new] identifier[HandlerRegistration] operator[SEP] operator[SEP] {
identifier[delegate] operator[SEP] identifier[addGeometryIndexDeselectedHandler] operator[SEP] identifier[h] operator[SEP]
} operator[SEP] operator[SEP]
}
|
public static IAtomContainerSet detect(IAtomContainer ac) {
IAtomContainerSet piSystemSet = ac.getBuilder().newInstance(IAtomContainerSet.class);
for (int i = 0; i < ac.getAtomCount(); i++) {
IAtom atom = ac.getAtom(i);
atom.setFlag(CDKConstants.VISITED, false);
}
for (int i = 0; i < ac.getAtomCount(); i++) {
IAtom firstAtom = ac.getAtom(i);
// if this atom was already visited in a previous DFS, continue
if (firstAtom.getFlag(CDKConstants.VISITED) || checkAtom(ac, firstAtom) == -1) {
continue;
}
IAtomContainer piSystem = ac.getBuilder().newInstance(IAtomContainer.class);
Stack<IAtom> stack = new Stack<IAtom>();
piSystem.addAtom(firstAtom);
stack.push(firstAtom);
firstAtom.setFlag(CDKConstants.VISITED, true);
// Start DFS from firstAtom
while (!stack.empty()) {
//boolean addAtom = false;
IAtom currentAtom = stack.pop();
List<IAtom> atoms = ac.getConnectedAtomsList(currentAtom);
List<IBond> bonds = ac.getConnectedBondsList(currentAtom);
for (int j = 0; j < atoms.size(); j++) {
IAtom atom = atoms.get(j);
IBond bond = bonds.get(j);
if (!atom.getFlag(CDKConstants.VISITED)) {
int check = checkAtom(ac, atom);
if (check == 1) {
piSystem.addAtom(atom);
piSystem.addBond(bond);
continue;
// do not mark atom as visited if cumulative double bond
} else if (check == 0) {
piSystem.addAtom(atom);
piSystem.addBond(bond);
stack.push(atom);
}
atom.setFlag(CDKConstants.VISITED, true);
}
// close rings with one bond
else if (!piSystem.contains(bond) && piSystem.contains(atom)) {
piSystem.addBond(bond);
}
}
}
if (piSystem.getAtomCount() > 2) {
piSystemSet.addAtomContainer(piSystem);
}
}
return piSystemSet;
} | class class_name[name] begin[{]
method[detect, return_type[type[IAtomContainerSet]], modifier[public static], parameter[ac]] begin[{]
local_variable[type[IAtomContainerSet], piSystemSet]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VISITED, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setFlag, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), name=firstAtom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=VISITED, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[])], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=firstAtom, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=firstAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBuilder, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IAtomContainer, sub_type=None))], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=piSystem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtomContainer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))], dimensions=None, name=Stack, sub_type=None)), name=stack)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))], dimensions=[], name=Stack, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=firstAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAtom, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=firstAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VISITED, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setFlag, postfix_operators=[], prefix_operators=[], qualifier=firstAtom, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), name=currentAtom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnectedAtomsList, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), name=atoms)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnectedBondsList, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), name=bonds)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IBond, 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=atoms, 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=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=bonds, selectors=[], type_arguments=None), name=bond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=VISITED, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[])], member=getFlag, postfix_operators=[], prefix_operators=['!'], qualifier=atom, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=piSystem, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addBond, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=check)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=check, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=check, 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=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAtom, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addBond, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAtom, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addBond, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VISITED, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setFlag, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], 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=atoms, 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)]), condition=MethodInvocation(arguments=[], member=empty, postfix_operators=[], prefix_operators=['!'], qualifier=stack, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=piSystem, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=piSystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAtomContainer, postfix_operators=[], prefix_operators=[], qualifier=piSystemSet, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.piSystemSet]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IAtomContainerSet] identifier[detect] operator[SEP] identifier[IAtomContainer] identifier[ac] operator[SEP] {
identifier[IAtomContainerSet] identifier[piSystemSet] operator[=] identifier[ac] operator[SEP] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[IAtomContainerSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ac] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[IAtom] identifier[atom] operator[=] identifier[ac] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[atom] operator[SEP] identifier[setFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[VISITED] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ac] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[IAtom] identifier[firstAtom] operator[=] identifier[ac] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstAtom] operator[SEP] identifier[getFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[VISITED] operator[SEP] operator[||] identifier[checkAtom] operator[SEP] identifier[ac] , identifier[firstAtom] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[IAtomContainer] identifier[piSystem] operator[=] identifier[ac] operator[SEP] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[IAtomContainer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Stack] operator[<] identifier[IAtom] operator[>] identifier[stack] operator[=] Keyword[new] identifier[Stack] operator[<] identifier[IAtom] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[piSystem] operator[SEP] identifier[addAtom] operator[SEP] identifier[firstAtom] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[firstAtom] operator[SEP] operator[SEP] identifier[firstAtom] operator[SEP] identifier[setFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[VISITED] , literal[boolean] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[stack] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] {
identifier[IAtom] identifier[currentAtom] operator[=] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[IAtom] operator[>] identifier[atoms] operator[=] identifier[ac] operator[SEP] identifier[getConnectedAtomsList] operator[SEP] identifier[currentAtom] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[IBond] operator[>] identifier[bonds] operator[=] identifier[ac] operator[SEP] identifier[getConnectedBondsList] operator[SEP] identifier[currentAtom] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[atoms] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[IAtom] identifier[atom] operator[=] identifier[atoms] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[IBond] identifier[bond] operator[=] identifier[bonds] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[atom] operator[SEP] identifier[getFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[VISITED] operator[SEP] operator[SEP] {
Keyword[int] identifier[check] operator[=] identifier[checkAtom] operator[SEP] identifier[ac] , identifier[atom] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[check] operator[==] Other[1] operator[SEP] {
identifier[piSystem] operator[SEP] identifier[addAtom] operator[SEP] identifier[atom] operator[SEP] operator[SEP] identifier[piSystem] operator[SEP] identifier[addBond] operator[SEP] identifier[bond] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[check] operator[==] Other[0] operator[SEP] {
identifier[piSystem] operator[SEP] identifier[addAtom] operator[SEP] identifier[atom] operator[SEP] operator[SEP] identifier[piSystem] operator[SEP] identifier[addBond] operator[SEP] identifier[bond] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[atom] operator[SEP] operator[SEP]
}
identifier[atom] operator[SEP] identifier[setFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[VISITED] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[piSystem] operator[SEP] identifier[contains] operator[SEP] identifier[bond] operator[SEP] operator[&&] identifier[piSystem] operator[SEP] identifier[contains] operator[SEP] identifier[atom] operator[SEP] operator[SEP] {
identifier[piSystem] operator[SEP] identifier[addBond] operator[SEP] identifier[bond] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[piSystem] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[>] Other[2] operator[SEP] {
identifier[piSystemSet] operator[SEP] identifier[addAtomContainer] operator[SEP] identifier[piSystem] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[piSystemSet] operator[SEP]
}
|
@Override
public Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> getOrDefault(Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> defaultValue) throws PromiseUnresolvedException {
return _task.getOrDefault(defaultValue);
} | class class_name[name] begin[{]
method[getOrDefault, return_type[type[Tuple11]], modifier[public], parameter[defaultValue]] begin[{]
return[call[_task.getOrDefault, parameter[member[.defaultValue]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Tuple11] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] , identifier[T6] , identifier[T7] , identifier[T8] , identifier[T9] , identifier[T10] , identifier[T11] operator[>] identifier[getOrDefault] operator[SEP] identifier[Tuple11] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] , identifier[T6] , identifier[T7] , identifier[T8] , identifier[T9] , identifier[T10] , identifier[T11] operator[>] identifier[defaultValue] operator[SEP] Keyword[throws] identifier[PromiseUnresolvedException] {
Keyword[return] identifier[_task] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP]
}
|
public Observable<VpnGatewayInner> updateTagsAsync(String resourceGroupName, String gatewayName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1<ServiceResponse<VpnGatewayInner>, VpnGatewayInner>() {
@Override
public VpnGatewayInner call(ServiceResponse<VpnGatewayInner> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[updateTagsAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, gatewayName]] begin[{]
return[call[.updateTagsWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.gatewayName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[VpnGatewayInner] operator[>] identifier[updateTagsAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[gatewayName] operator[SEP] {
Keyword[return] identifier[updateTagsWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[gatewayName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[VpnGatewayInner] operator[>] , identifier[VpnGatewayInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[VpnGatewayInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[VpnGatewayInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public synchronized void unregister() throws Exception {
if (mbeanName == null) {
throw new Exception("Agent not registered");
}
logger.info("Unregistering JMX agent " + mbeanName);
ManagementFactory.getPlatformMBeanServer().unregisterMBean(mbeanName);
logger.info("JMX agent " + mbeanName + " unregistered");
} | class class_name[name] begin[{]
method[unregister, return_type[void], modifier[synchronized public], parameter[]] begin[{]
if[binary_operation[member[.mbeanName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Agent not registered")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[logger.info, parameter[binary_operation[literal["Unregistering JMX agent "], +, member[.mbeanName]]]]
call[ManagementFactory.getPlatformMBeanServer, parameter[]]
call[logger.info, parameter[binary_operation[binary_operation[literal["JMX agent "], +, member[.mbeanName]], +, literal[" unregistered"]]]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[unregister] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[mbeanName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[mbeanName] operator[SEP] operator[SEP] identifier[ManagementFactory] operator[SEP] identifier[getPlatformMBeanServer] operator[SEP] operator[SEP] operator[SEP] identifier[unregisterMBean] operator[SEP] identifier[mbeanName] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[mbeanName] operator[+] literal[String] operator[SEP] operator[SEP]
}
|
@Override
protected Object[] convertParameters(Object[] params) {
Iterator<Object> parameterIterator = Iterators.forArray(params);
List<Object> converted = parameterConverters.stream().map(parameterBinding -> parameterBinding.convertParameter(parameterIterator)).collect(Collectors.toList());
return converted.toArray(new Object[converted.size()]);
} | class class_name[name] begin[{]
method[convertParameters, return_type[type[Object]], modifier[protected], parameter[params]] begin[{]
local_variable[type[Iterator], parameterIterator]
local_variable[type[List], converted]
return[call[converted.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=converted, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[Object] operator[SEP] operator[SEP] identifier[convertParameters] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[params] operator[SEP] {
identifier[Iterator] operator[<] identifier[Object] operator[>] identifier[parameterIterator] operator[=] identifier[Iterators] operator[SEP] identifier[forArray] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] identifier[converted] operator[=] identifier[parameterConverters] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[parameterBinding] operator[->] identifier[parameterBinding] operator[SEP] identifier[convertParameter] operator[SEP] identifier[parameterIterator] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[converted] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Object] operator[SEP] identifier[converted] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public RestResponse postJson(final String uri, final String params)
throws IOException, AppPlatformException {
return requestJson(getPath(uri), HttpPost.METHOD_NAME, params);
} | class class_name[name] begin[{]
method[postJson, return_type[type[RestResponse]], modifier[public], parameter[uri, params]] begin[{]
return[call[.requestJson, parameter[call[.getPath, parameter[member[.uri]]], member[HttpPost.METHOD_NAME], member[.params]]]]
end[}]
END[}] | Keyword[public] identifier[RestResponse] identifier[postJson] operator[SEP] Keyword[final] identifier[String] identifier[uri] , Keyword[final] identifier[String] identifier[params] operator[SEP] Keyword[throws] identifier[IOException] , identifier[AppPlatformException] {
Keyword[return] identifier[requestJson] operator[SEP] identifier[getPath] operator[SEP] identifier[uri] operator[SEP] , identifier[HttpPost] operator[SEP] identifier[METHOD_NAME] , identifier[params] operator[SEP] operator[SEP]
}
|
public void announceSupportAndPublish()
throws NoSuchAlgorithmException, NoSuchProviderException, InterruptedException,
PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException,
SmackException.NotConnectedException, SmackException.NoResponseException, IOException,
InvalidAlgorithmParameterException, SmackException.NotLoggedInException, PGPException {
throwIfNoProviderSet();
throwIfNotAuthenticated();
OpenPgpV4Fingerprint primaryFingerprint = getOurFingerprint();
if (primaryFingerprint == null) {
primaryFingerprint = generateAndImportKeyPair(getJidOrThrow());
}
// Create <pubkey/> element
PubkeyElement pubkeyElement;
try {
pubkeyElement = createPubkeyElement(getJidOrThrow(), primaryFingerprint, new Date());
} catch (MissingOpenPgpKeyException e) {
throw new AssertionError("Cannot publish our public key, since it is missing (MUST NOT happen!)");
}
// publish it
publishPublicKey(pepManager, pubkeyElement, primaryFingerprint);
// Subscribe to public key changes
PepManager.getInstanceFor(connection()).addPepListener(metadataListener);
ServiceDiscoveryManager.getInstanceFor(connection())
.addFeature(PEP_NODE_PUBLIC_KEYS_NOTIFY);
} | class class_name[name] begin[{]
method[announceSupportAndPublish, return_type[void], modifier[public], parameter[]] begin[{]
call[.throwIfNoProviderSet, parameter[]]
call[.throwIfNotAuthenticated, parameter[]]
local_variable[type[OpenPgpV4Fingerprint], primaryFingerprint]
if[binary_operation[member[.primaryFingerprint], ==, literal[null]]] begin[{]
assign[member[.primaryFingerprint], call[.generateAndImportKeyPair, parameter[call[.getJidOrThrow, parameter[]]]]]
else begin[{]
None
end[}]
local_variable[type[PubkeyElement], pubkeyElement]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pubkeyElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getJidOrThrow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=primaryFingerprint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))], member=createPubkeyElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot publish our public key, since it is missing (MUST NOT happen!)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MissingOpenPgpKeyException']))], finally_block=None, label=None, resources=None)
call[.publishPublicKey, parameter[member[.pepManager], member[.pubkeyElement], member[.primaryFingerprint]]]
call[PepManager.getInstanceFor, parameter[call[.connection, parameter[]]]]
call[ServiceDiscoveryManager.getInstanceFor, parameter[call[.connection, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[announceSupportAndPublish] operator[SEP] operator[SEP] Keyword[throws] identifier[NoSuchAlgorithmException] , identifier[NoSuchProviderException] , identifier[InterruptedException] , identifier[PubSubException] operator[SEP] identifier[NotALeafNodeException] , identifier[XMPPException] operator[SEP] identifier[XMPPErrorException] , identifier[SmackException] operator[SEP] identifier[NotConnectedException] , identifier[SmackException] operator[SEP] identifier[NoResponseException] , identifier[IOException] , identifier[InvalidAlgorithmParameterException] , identifier[SmackException] operator[SEP] identifier[NotLoggedInException] , identifier[PGPException] {
identifier[throwIfNoProviderSet] operator[SEP] operator[SEP] operator[SEP] identifier[throwIfNotAuthenticated] operator[SEP] operator[SEP] operator[SEP] identifier[OpenPgpV4Fingerprint] identifier[primaryFingerprint] operator[=] identifier[getOurFingerprint] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[primaryFingerprint] operator[==] Other[null] operator[SEP] {
identifier[primaryFingerprint] operator[=] identifier[generateAndImportKeyPair] operator[SEP] identifier[getJidOrThrow] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[PubkeyElement] identifier[pubkeyElement] operator[SEP] Keyword[try] {
identifier[pubkeyElement] operator[=] identifier[createPubkeyElement] operator[SEP] identifier[getJidOrThrow] operator[SEP] operator[SEP] , identifier[primaryFingerprint] , Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MissingOpenPgpKeyException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[publishPublicKey] operator[SEP] identifier[pepManager] , identifier[pubkeyElement] , identifier[primaryFingerprint] operator[SEP] operator[SEP] identifier[PepManager] operator[SEP] identifier[getInstanceFor] operator[SEP] identifier[connection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addPepListener] operator[SEP] identifier[metadataListener] operator[SEP] operator[SEP] identifier[ServiceDiscoveryManager] operator[SEP] identifier[getInstanceFor] operator[SEP] identifier[connection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addFeature] operator[SEP] identifier[PEP_NODE_PUBLIC_KEYS_NOTIFY] operator[SEP] operator[SEP]
}
|
synchronized void add(long size, int generation) {
Preconditions.checkArgument(size >= 0, "size must be a non-negative number");
Preconditions.checkArgument(generation >= 0, "generation must be a non-negative number");
this.totalSize += size;
int newCount = this.generations.getOrDefault(generation, 0) + 1;
this.generations.put(generation, newCount);
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[synchronized], parameter[size, generation]] begin[{]
call[Preconditions.checkArgument, parameter[binary_operation[member[.size], >=, literal[0]], literal["size must be a non-negative number"]]]
call[Preconditions.checkArgument, parameter[binary_operation[member[.generation], >=, literal[0]], literal["generation must be a non-negative number"]]]
assign[THIS[member[None.totalSize]], member[.size]]
local_variable[type[int], newCount]
THIS[member[None.generations]call[None.put, parameter[member[.generation], member[.newCount]]]]
end[}]
END[}] | Keyword[synchronized] Keyword[void] identifier[add] operator[SEP] Keyword[long] identifier[size] , Keyword[int] identifier[generation] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[size] operator[>=] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[generation] operator[>=] Other[0] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[totalSize] operator[+=] identifier[size] operator[SEP] Keyword[int] identifier[newCount] operator[=] Keyword[this] operator[SEP] identifier[generations] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[generation] , Other[0] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[this] operator[SEP] identifier[generations] operator[SEP] identifier[put] operator[SEP] identifier[generation] , identifier[newCount] operator[SEP] operator[SEP]
}
|
public Message5WH_Builder setWhere(StackTraceElement ste){
if(ste!=null){
String cn = ste.getClassName();
String mn = ste.getMethodName();
int line = ste.getLineNumber();
//StackTraceElement requires Class and Method set to !null but allows for "", we cope with null but not "" in ST4
if(!"".equals(cn) || !"".equals(mn)){
if(!"".equals(cn)){
this.whereLocation = ste.getClassName();
}
if(!"".equals(mn)){
this.whereLocation = ste.getMethodName();
}
if(line>0){
this.whereLine = ste.getLineNumber();
}
//no column information in a stack trace
}
}
return this;
} | class class_name[name] begin[{]
method[setWhere, return_type[type[Message5WH_Builder]], modifier[public], parameter[ste]] begin[{]
if[binary_operation[member[.ste], !=, literal[null]]] begin[{]
local_variable[type[String], cn]
local_variable[type[String], mn]
local_variable[type[int], line]
if[binary_operation[literal[""], ||, literal[""]]] begin[{]
if[literal[""]] begin[{]
assign[THIS[member[None.whereLocation]], call[ste.getClassName, parameter[]]]
else begin[{]
None
end[}]
if[literal[""]] begin[{]
assign[THIS[member[None.whereLocation]], call[ste.getMethodName, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[member[.line], >, literal[0]]] begin[{]
assign[THIS[member[None.whereLine]], call[ste.getLineNumber, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Message5WH_Builder] identifier[setWhere] operator[SEP] identifier[StackTraceElement] identifier[ste] operator[SEP] {
Keyword[if] operator[SEP] identifier[ste] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[cn] operator[=] identifier[ste] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[mn] operator[=] identifier[ste] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[line] operator[=] identifier[ste] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[cn] operator[SEP] operator[||] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[mn] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[cn] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[whereLocation] operator[=] identifier[ste] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[mn] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[whereLocation] operator[=] identifier[ste] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[line] operator[>] Other[0] operator[SEP] {
Keyword[this] operator[SEP] identifier[whereLine] operator[=] identifier[ste] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static Histogram add(Histogram x, Histogram y) {
return new Histogram(Stream.concat(x.stream(), y.stream()));
} | class class_name[name] begin[{]
method[add, return_type[type[Histogram]], modifier[public static], parameter[x, y]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=y, selectors=[], type_arguments=None)], member=concat, postfix_operators=[], prefix_operators=[], qualifier=Stream, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Histogram, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Histogram] identifier[add] operator[SEP] identifier[Histogram] identifier[x] , identifier[Histogram] identifier[y] operator[SEP] {
Keyword[return] Keyword[new] identifier[Histogram] operator[SEP] identifier[Stream] operator[SEP] identifier[concat] operator[SEP] identifier[x] operator[SEP] identifier[stream] operator[SEP] operator[SEP] , identifier[y] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public long rankLong(int x) {
long size = 0;
short xhigh = highbits(x);
for (int i = 0; i < this.highLowContainer.size(); i++) {
short key = this.highLowContainer.getKeyAtIndex(i);
int comparison = Util.compareUnsigned(key, xhigh);
if (comparison < 0) {
size += this.highLowContainer.getCardinality(i);
} else if(comparison == 0) {
return size + this.highLowContainer.getContainerAtIndex(i).rank(lowbits(x));
}
}
return size;
} | class class_name[name] begin[{]
method[rankLong, return_type[type[long]], modifier[public], parameter[x]] begin[{]
local_variable[type[long], size]
local_variable[type[short], xhigh]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=highLowContainer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getKeyAtIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=key)], modifiers=set(), type=BasicType(dimensions=[], name=short)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xhigh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareUnsigned, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), name=comparison)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=comparison, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=comparison, 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=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=highLowContainer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getContainerAtIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lowbits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=rank, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=highLowContainer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCardinality, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=highLowContainer, 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)
return[member[.size]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[rankLong] operator[SEP] Keyword[int] identifier[x] operator[SEP] {
Keyword[long] identifier[size] operator[=] Other[0] operator[SEP] Keyword[short] identifier[xhigh] operator[=] identifier[highbits] operator[SEP] identifier[x] 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[highLowContainer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[short] identifier[key] operator[=] Keyword[this] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getKeyAtIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[comparison] operator[=] identifier[Util] operator[SEP] identifier[compareUnsigned] operator[SEP] identifier[key] , identifier[xhigh] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comparison] operator[<] Other[0] operator[SEP] {
identifier[size] operator[+=] Keyword[this] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getCardinality] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[comparison] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[size] operator[+] Keyword[this] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getContainerAtIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[rank] operator[SEP] identifier[lowbits] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[size] operator[SEP]
}
|
public static String getText(TextView view) {
String text = "";
if (view != null) {
text = view.getText().toString();
} else {
Log.e("Caffeine", "Null view given to getText(). \"\" will be returned.");
}
return text;
} | class class_name[name] begin[{]
method[getText, return_type[type[String]], modifier[public static], parameter[view]] begin[{]
local_variable[type[String], text]
if[binary_operation[member[.view], !=, literal[null]]] begin[{]
assign[member[.text], call[view.getText, parameter[]]]
else begin[{]
call[Log.e, parameter[literal["Caffeine"], literal["Null view given to getText(). \"\" will be returned."]]]
end[}]
return[member[.text]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getText] operator[SEP] identifier[TextView] identifier[view] operator[SEP] {
identifier[String] identifier[text] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[view] operator[!=] Other[null] operator[SEP] {
identifier[text] operator[=] identifier[view] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Log] operator[SEP] identifier[e] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[text] operator[SEP]
}
|
private boolean propertyMustBeInitializedByFullName(Name name) {
// If an object or function literal in the global namespace is never
// aliased, then its properties can only come from one of 2 places:
// 1) From its prototype chain, or
// 2) From an assignment to its fully qualified name.
// If we assume #1 is not the case, then #2 implies that its
// properties must all be modeled in the GlobalNamespace as well.
//
// We assume that for global object literals and types (constructors and
// interfaces), we can find all the properties inherited from the prototype
// chain of functions and objects.
if (name.getParent() == null) {
return false;
}
if (isNameUnsafelyAliased(name.getParent())) {
// e.g. if we have `const ns = {}; escape(ns); alert(ns.a.b);`
// we don't expect ns.a.b to be defined somewhere because `ns` has escaped
return false;
}
if (objectPrototypeProps.contains(name.getBaseName())) {
// checks for things on Object.prototype, e.g. a call to
// something.hasOwnProperty('a');
return false;
}
if (name.getParent().isObjectLiteral()) {
// if this is a property on an object literal, always expect an initialization somewhere
return true;
}
if (name.getParent().isClass()) {
// only warn on class properties if there is no superclass, because we don't handle
// class side inheritance here very well yet.
return !hasSuperclass(name.getParent());
}
// warn on remaining names if they are on a constructor and are not a Function.prototype
// property (e.g. f.call(1);)
return name.getParent().isFunction()
&& name.getParent().isDeclaredType()
&& !functionPrototypeProps.contains(name.getBaseName());
} | class class_name[name] begin[{]
method[propertyMustBeInitializedByFullName, return_type[type[boolean]], modifier[private], parameter[name]] begin[{]
if[binary_operation[call[name.getParent, parameter[]], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[.isNameUnsafelyAliased, parameter[call[name.getParent, parameter[]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[objectPrototypeProps.contains, parameter[call[name.getBaseName, parameter[]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[name.getParent, parameter[]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
if[call[name.getParent, parameter[]]] begin[{]
return[call[.hasSuperclass, parameter[call[name.getParent, parameter[]]]]]
else begin[{]
None
end[}]
return[binary_operation[binary_operation[call[name.getParent, parameter[]], &&, call[name.getParent, parameter[]]], &&, call[functionPrototypeProps.contains, parameter[call[name.getBaseName, parameter[]]]]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[propertyMustBeInitializedByFullName] operator[SEP] identifier[Name] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isNameUnsafelyAliased] operator[SEP] identifier[name] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[objectPrototypeProps] operator[SEP] identifier[contains] operator[SEP] identifier[name] operator[SEP] identifier[getBaseName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[isObjectLiteral] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[isClass] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[!] identifier[hasSuperclass] operator[SEP] identifier[name] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[name] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[isFunction] operator[SEP] operator[SEP] operator[&&] identifier[name] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[isDeclaredType] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[functionPrototypeProps] operator[SEP] identifier[contains] operator[SEP] identifier[name] operator[SEP] identifier[getBaseName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.BSG__REG_NAME:
setREGName((String)newValue);
return;
case AfplibPackage.BSG__TRIPLETS:
getTriplets().clear();
getTriplets().addAll((Collection<? extends Triplet>)newValue);
return;
}
super.eSet(featureID, newValue);
} | class class_name[name] begin[{]
method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BSG__REG_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=setREGName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=BSG__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Triplet, sub_type=None))], dimensions=[], name=Collection, sub_type=None))], member=addAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BSG__REG_NAME] operator[:] identifier[setREGName] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BSG__TRIPLETS] operator[:] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Triplet] operator[>] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP]
}
|
private static <T> Iterator<Iterator<? extends T>> iterators(
Iterable<? extends Iterable<? extends T>> iterables) {
return new TransformedIterator<Iterable<? extends T>, Iterator<? extends T>>(
iterables.iterator()) {
@Override
Iterator<? extends T> transform(Iterable<? extends T> from) {
return from.iterator();
}
};
} | class class_name[name] begin[{]
method[iterators, return_type[type[Iterator]], modifier[private static], parameter[iterables]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=iterables, selectors=[], type_arguments=None)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=from, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers=set(), name=transform, parameters=[FormalParameter(annotations=[], modifiers=set(), name=from, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Iterable, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Iterable, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Iterator, sub_type=None))], dimensions=None, name=TransformedIterator, sub_type=None))]
end[}]
END[}] | Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[Iterator] operator[<] identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[iterators] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[iterables] operator[SEP] {
Keyword[return] Keyword[new] identifier[TransformedIterator] operator[<] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] , identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] operator[SEP] identifier[iterables] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[transform] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[from] operator[SEP] {
Keyword[return] identifier[from] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
@SuppressWarnings("unchecked")
public <T extends VALUE> T withCacheEvict(KEY key, Supplier<VALUE> cacheableOperation) {
Assert.notNull(cacheableOperation, "Supplier is required");
VALUE result = cacheableOperation.get();
evict(getLock(), key);
return (T) result;
} | class class_name[name] begin[{]
method[withCacheEvict, return_type[type[T]], modifier[public], parameter[key, cacheableOperation]] begin[{]
call[Assert.notNull, parameter[member[.cacheableOperation], literal["Supplier is required"]]]
local_variable[type[VALUE], result]
call[.evict, parameter[call[.getLock, parameter[]], member[.key]]]
return[Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[VALUE] operator[>] identifier[T] identifier[withCacheEvict] operator[SEP] identifier[KEY] identifier[key] , identifier[Supplier] operator[<] identifier[VALUE] operator[>] identifier[cacheableOperation] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[cacheableOperation] , literal[String] operator[SEP] operator[SEP] identifier[VALUE] identifier[result] operator[=] identifier[cacheableOperation] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[evict] operator[SEP] identifier[getLock] operator[SEP] operator[SEP] , identifier[key] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[result] operator[SEP]
}
|
public void suspend() {
if (suspension.compareAndSet(null, new CountDownLatch(1))) {
try {
suspendBarrier.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (BrokenBarrierException e) {
LOG.error("Exception during suspend: " + flowletContext, e);
}
}
} | class class_name[name] begin[{]
method[suspend, return_type[void], modifier[public], parameter[]] begin[{]
if[call[suspension.compareAndSet, parameter[literal[null], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CountDownLatch, sub_type=None))]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=await, postfix_operators=[], prefix_operators=[], qualifier=suspendBarrier, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception during suspend: "), operandr=MemberReference(member=flowletContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BrokenBarrierException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[suspend] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[suspension] operator[SEP] identifier[compareAndSet] operator[SEP] Other[null] , Keyword[new] identifier[CountDownLatch] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[suspendBarrier] operator[SEP] identifier[await] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[BrokenBarrierException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[flowletContext] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
private final long checkSessionTimeout() {
long nextTimeout = 0;
if (configuration.getCheckSessionTimeoutInterval() > 0) {
gate.lock();
try {
if (selectTries * 1000 >= configuration
.getCheckSessionTimeoutInterval()) {
nextTimeout = configuration
.getCheckSessionTimeoutInterval();
for (SelectionKey key : selector.keys()) {
if (key.attachment() != null) {
long n = checkExpiredIdle(key,
getSessionFromAttchment(key));
nextTimeout = n < nextTimeout ? n : nextTimeout;
}
}
selectTries = 0;
}
} finally {
gate.unlock();
}
}
return nextTimeout;
} | class class_name[name] begin[{]
method[checkSessionTimeout, return_type[type[long]], modifier[final private], parameter[]] begin[{]
local_variable[type[long], nextTimeout]
if[binary_operation[call[configuration.getCheckSessionTimeoutInterval, parameter[]], >, literal[0]]] begin[{]
call[gate.lock, parameter[]]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=selectTries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=*), operandr=MethodInvocation(arguments=[], member=getCheckSessionTimeoutInterval, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getCheckSessionTimeoutInterval, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=attachment, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSessionFromAttchment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=checkExpiredIdle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nextTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=MemberReference(member=nextTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keys, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SelectionKey, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=selectTries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=gate, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
return[member[.nextTimeout]]
end[}]
END[}] | Keyword[private] Keyword[final] Keyword[long] identifier[checkSessionTimeout] operator[SEP] operator[SEP] {
Keyword[long] identifier[nextTimeout] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[configuration] operator[SEP] identifier[getCheckSessionTimeoutInterval] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[gate] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[selectTries] operator[*] Other[1000] operator[>=] identifier[configuration] operator[SEP] identifier[getCheckSessionTimeoutInterval] operator[SEP] operator[SEP] operator[SEP] {
identifier[nextTimeout] operator[=] identifier[configuration] operator[SEP] identifier[getCheckSessionTimeoutInterval] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SelectionKey] identifier[key] operator[:] identifier[selector] operator[SEP] identifier[keys] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[attachment] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[long] identifier[n] operator[=] identifier[checkExpiredIdle] operator[SEP] identifier[key] , identifier[getSessionFromAttchment] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] identifier[nextTimeout] operator[=] identifier[n] operator[<] identifier[nextTimeout] operator[?] identifier[n] operator[:] identifier[nextTimeout] operator[SEP]
}
}
identifier[selectTries] operator[=] Other[0] operator[SEP]
}
}
Keyword[finally] {
identifier[gate] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[nextTimeout] operator[SEP]
}
|
public <T> Optional<T> getResponseValueOptional(String path, Class<T> clazz) {
return JacksonUtils.getValueOptional(responseJson, path, clazz);
} | class class_name[name] begin[{]
method[getResponseValueOptional, return_type[type[Optional]], modifier[public], parameter[path, clazz]] begin[{]
return[call[JacksonUtils.getValueOptional, parameter[member[.responseJson], member[.path], member[.clazz]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[Optional] operator[<] identifier[T] operator[>] identifier[getResponseValueOptional] operator[SEP] identifier[String] identifier[path] , identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] {
Keyword[return] identifier[JacksonUtils] operator[SEP] identifier[getValueOptional] operator[SEP] identifier[responseJson] , identifier[path] , identifier[clazz] operator[SEP] operator[SEP]
}
|
public static XMLStreamException unexpectedEndElement(final XMLExtendedStreamReader reader) {
return ControllerLogger.ROOT_LOGGER.unexpectedEndElement(reader.getName(), reader.getLocation());
} | class class_name[name] begin[{]
method[unexpectedEndElement, return_type[type[XMLStreamException]], modifier[public static], parameter[reader]] begin[{]
return[call[ControllerLogger.ROOT_LOGGER.unexpectedEndElement, parameter[call[reader.getName, parameter[]], call[reader.getLocation, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[XMLStreamException] identifier[unexpectedEndElement] operator[SEP] Keyword[final] identifier[XMLExtendedStreamReader] identifier[reader] operator[SEP] {
Keyword[return] identifier[ControllerLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[unexpectedEndElement] operator[SEP] identifier[reader] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[reader] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public final void add(final V entity) {
checkNotNull(entity, "Received a null pointer as the entity");
if ((entity.getId() == null) || (entity.getId() < 0)) {
// No ID has been assigned
// It is a new entity
getEntityManager().persist(entity);
} else {
// ID already assigned
// It is an existing entity
getEntityManager().merge(entity);
}
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[final public], parameter[entity]] begin[{]
call[.checkNotNull, parameter[member[.entity], literal["Received a null pointer as the entity"]]]
if[binary_operation[binary_operation[call[entity.getId, parameter[]], ==, literal[null]], ||, binary_operation[call[entity.getId, parameter[]], <, literal[0]]]] begin[{]
call[.getEntityManager, parameter[]]
else begin[{]
call[.getEntityManager, parameter[]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[add] operator[SEP] Keyword[final] identifier[V] identifier[entity] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[entity] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[entity] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[entity] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] operator[SEP] {
identifier[getEntityManager] operator[SEP] operator[SEP] operator[SEP] identifier[persist] operator[SEP] identifier[entity] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[getEntityManager] operator[SEP] operator[SEP] operator[SEP] identifier[merge] operator[SEP] identifier[entity] operator[SEP] operator[SEP]
}
}
|
public static void main(final String[] args) throws ServletException, IOException, JspException {
final Map<String, String> config = toMap(args);
System.setProperty("lucee.cli.call", "true");
final boolean useRMI = "true".equalsIgnoreCase(config.get("rmi"));
File root;
final String param = config.get("webroot");
if (Util.isEmpty(param, true)) {
root = new File("."); // working directory that the java command was called from
config.put("webroot", root.getAbsolutePath());
}
else {
root = new File(param);
root.mkdirs();
}
// System.out.println("set webroot to: " + root.getAbsolutePath());
String servletName = config.get("servlet-name");
if (Util.isEmpty(servletName, true)) servletName = "CFMLServlet";
if (useRMI) {
final CLIFactory factory = new CLIFactory(root, servletName, config);
factory.setDaemon(false);
factory.start();
}
else {
final CLIInvokerImpl invoker = new CLIInvokerImpl(root, servletName);
invoker.invoke(config);
}
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[args]] begin[{]
local_variable[type[Map], config]
call[System.setProperty, parameter[literal["lucee.cli.call"], literal["true"]]]
local_variable[type[boolean], useRMI]
local_variable[type[File], root]
local_variable[type[String], param]
if[call[Util.isEmpty, parameter[member[.param], literal[true]]]] begin[{]
assign[member[.root], 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=File, sub_type=None))]
call[config.put, parameter[literal["webroot"], call[root.getAbsolutePath, parameter[]]]]
else begin[{]
assign[member[.root], ClassCreator(arguments=[MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]
call[root.mkdirs, parameter[]]
end[}]
local_variable[type[String], servletName]
if[call[Util.isEmpty, parameter[member[.servletName], literal[true]]]] begin[{]
assign[member[.servletName], literal["CFMLServlet"]]
else begin[{]
None
end[}]
if[member[.useRMI]] begin[{]
local_variable[type[CLIFactory], factory]
call[factory.setDaemon, parameter[literal[false]]]
call[factory.start, parameter[]]
else begin[{]
local_variable[type[CLIInvokerImpl], invoker]
call[invoker.invoke, parameter[member[.config]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] , identifier[JspException] {
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[config] operator[=] identifier[toMap] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[useRMI] operator[=] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[config] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[root] operator[SEP] Keyword[final] identifier[String] identifier[param] operator[=] identifier[config] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Util] operator[SEP] identifier[isEmpty] operator[SEP] identifier[param] , literal[boolean] operator[SEP] operator[SEP] {
identifier[root] operator[=] Keyword[new] identifier[File] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[root] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[root] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[servletName] operator[=] identifier[config] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Util] operator[SEP] identifier[isEmpty] operator[SEP] identifier[servletName] , literal[boolean] operator[SEP] operator[SEP] identifier[servletName] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[useRMI] operator[SEP] {
Keyword[final] identifier[CLIFactory] identifier[factory] operator[=] Keyword[new] identifier[CLIFactory] operator[SEP] identifier[root] , identifier[servletName] , identifier[config] operator[SEP] operator[SEP] identifier[factory] operator[SEP] identifier[setDaemon] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[factory] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[CLIInvokerImpl] identifier[invoker] operator[=] Keyword[new] identifier[CLIInvokerImpl] operator[SEP] identifier[root] , identifier[servletName] operator[SEP] operator[SEP] identifier[invoker] operator[SEP] identifier[invoke] operator[SEP] identifier[config] operator[SEP] operator[SEP]
}
}
|
private StringBuilder appendPostTypes(final EnumSet<Post.Type> types, final StringBuilder sql) {
int typesCount = types != null ? types.size() : 0;
switch(typesCount) {
case 0:
break;
case 1:
sql.append(" AND post_type=").append(String.format("'%s'", types.iterator().next().toString()));
break;
default:
sql.append(" AND post_type IN (");
sql.append(inJoiner.join(types.stream().map(t -> String.format("'%s'", t.toString())).collect(Collectors.toSet())));
sql.append(")");
break;
}
return sql;
} | class class_name[name] begin[{]
method[appendPostTypes, return_type[type[StringBuilder]], modifier[private], parameter[types, sql]] begin[{]
local_variable[type[int], typesCount]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" AND post_type=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'%s'"), MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" AND post_type IN (")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'%s'"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), parameters=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toSet, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=join, postfix_operators=[], prefix_operators=[], qualifier=inJoiner, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=typesCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[member[.sql]]
end[}]
END[}] | Keyword[private] identifier[StringBuilder] identifier[appendPostTypes] operator[SEP] Keyword[final] identifier[EnumSet] operator[<] identifier[Post] operator[SEP] identifier[Type] operator[>] identifier[types] , Keyword[final] identifier[StringBuilder] identifier[sql] operator[SEP] {
Keyword[int] identifier[typesCount] operator[=] identifier[types] operator[!=] Other[null] operator[?] identifier[types] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] Keyword[switch] operator[SEP] identifier[typesCount] operator[SEP] {
Keyword[case] Other[0] operator[:] Keyword[break] operator[SEP] Keyword[case] Other[1] operator[:] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[types] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[inJoiner] operator[SEP] identifier[join] operator[SEP] identifier[types] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[t] operator[->] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[t] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[return] identifier[sql] operator[SEP]
}
|
private static String formatStatName(final String stat) {
if (stat == null || stat.isEmpty()) {
return stat;
}
String name = stat.replace(" ", "");
return name.substring(0, 1).toLowerCase() + name.substring(1);
} | class class_name[name] begin[{]
method[formatStatName, return_type[type[String]], modifier[private static], parameter[stat]] begin[{]
if[binary_operation[binary_operation[member[.stat], ==, literal[null]], ||, call[stat.isEmpty, parameter[]]]] begin[{]
return[member[.stat]]
else begin[{]
None
end[}]
local_variable[type[String], name]
return[binary_operation[call[name.substring, parameter[literal[0], literal[1]]], +, call[name.substring, parameter[literal[1]]]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[formatStatName] operator[SEP] Keyword[final] identifier[String] identifier[stat] operator[SEP] {
Keyword[if] operator[SEP] identifier[stat] operator[==] Other[null] operator[||] identifier[stat] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[stat] operator[SEP]
}
identifier[String] identifier[name] operator[=] identifier[stat] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[+] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
|
@Override
public List<BelTerm> getSupportingTerms(KamNode kamNode)
throws KamStoreServiceException {
List<BelTerm> list = new ArrayList<BelTerm>();
try {
// Get the real Kam from the KamCache
KamStoreObjectRef kamElementRef;
try {
kamElementRef = Converter.decodeNode(kamNode);
} catch (InvalidIdException e) {
logger.warn(e.getMessage());
throw new KamStoreServiceException("Error processing KAM node",
e);
}
final KamInfo kamInfo =
getKamInfo(kamElementRef, "Error processing KAM node");
final org.openbel.framework.api.Kam objKam =
kamCacheService.getKam(kamInfo.getName());
if (objKam == null) {
throw new KamStoreServiceException(
new InvalidIdException(kamElementRef.getEncodedString()));
}
// Get the real KamNode from the Kam
org.openbel.framework.api.Kam.KamNode objKamNode =
objKam.findNode(kamElementRef.getKamStoreObjectId());
// Get the supporting terms for the node
for (org.openbel.framework.api.internal.KAMStoreDaoImpl.BelTerm objBelTerm : kAMStore
.getSupportingTerms(objKamNode)) {
list.add(convert(objBelTerm, kamInfo));
}
} catch (KAMStoreException e) {
logger.warn(e.getMessage());
throw new KamStoreServiceException(e);
}
return list;
} | class class_name[name] begin[{]
method[getSupportingTerms, return_type[type[List]], modifier[public], parameter[kamNode]] begin[{]
local_variable[type[List], list]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=kamElementRef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KamStoreObjectRef, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=kamElementRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=kamNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decodeNode, postfix_operators=[], prefix_operators=[], qualifier=Converter, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error processing KAM node"), 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=KamStoreServiceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvalidIdException']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=kamElementRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error processing KAM node")], member=getKamInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=kamInfo)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=KamInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=kamInfo, selectors=[], type_arguments=None)], member=getKam, postfix_operators=[], prefix_operators=[], qualifier=kamCacheService, selectors=[], type_arguments=None), name=objKam)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=openbel, sub_type=ReferenceType(arguments=None, dimensions=None, name=framework, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=Kam, sub_type=None)))))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=objKam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getEncodedString, postfix_operators=[], prefix_operators=[], qualifier=kamElementRef, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidIdException, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KamStoreServiceException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKamStoreObjectId, postfix_operators=[], prefix_operators=[], qualifier=kamElementRef, selectors=[], type_arguments=None)], member=findNode, postfix_operators=[], prefix_operators=[], qualifier=objKam, selectors=[], type_arguments=None), name=objKamNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=openbel, sub_type=ReferenceType(arguments=None, dimensions=None, name=framework, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=Kam, sub_type=ReferenceType(arguments=None, dimensions=None, name=KamNode, sub_type=None))))))), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=objBelTerm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kamInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=objKamNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSupportingTerms, postfix_operators=[], prefix_operators=[], qualifier=kAMStore, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=objBelTerm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=openbel, sub_type=ReferenceType(arguments=None, dimensions=None, name=framework, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=None, dimensions=None, name=KAMStoreDaoImpl, sub_type=ReferenceType(arguments=None, dimensions=None, name=BelTerm, sub_type=None))))))))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KamStoreServiceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KAMStoreException']))], finally_block=None, label=None, resources=None)
return[member[.list]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[BelTerm] operator[>] identifier[getSupportingTerms] operator[SEP] identifier[KamNode] identifier[kamNode] operator[SEP] Keyword[throws] identifier[KamStoreServiceException] {
identifier[List] operator[<] identifier[BelTerm] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[BelTerm] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[KamStoreObjectRef] identifier[kamElementRef] operator[SEP] Keyword[try] {
identifier[kamElementRef] operator[=] identifier[Converter] operator[SEP] identifier[decodeNode] operator[SEP] identifier[kamNode] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvalidIdException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[KamStoreServiceException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[final] identifier[KamInfo] identifier[kamInfo] operator[=] identifier[getKamInfo] operator[SEP] identifier[kamElementRef] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[org] operator[SEP] identifier[openbel] operator[SEP] identifier[framework] operator[SEP] identifier[api] operator[SEP] identifier[Kam] identifier[objKam] operator[=] identifier[kamCacheService] operator[SEP] identifier[getKam] operator[SEP] identifier[kamInfo] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[objKam] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[KamStoreServiceException] operator[SEP] Keyword[new] identifier[InvalidIdException] operator[SEP] identifier[kamElementRef] operator[SEP] identifier[getEncodedString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[org] operator[SEP] identifier[openbel] operator[SEP] identifier[framework] operator[SEP] identifier[api] operator[SEP] identifier[Kam] operator[SEP] identifier[KamNode] identifier[objKamNode] operator[=] identifier[objKam] operator[SEP] identifier[findNode] operator[SEP] identifier[kamElementRef] operator[SEP] identifier[getKamStoreObjectId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[org] operator[SEP] identifier[openbel] operator[SEP] identifier[framework] operator[SEP] identifier[api] operator[SEP] identifier[internal] operator[SEP] identifier[KAMStoreDaoImpl] operator[SEP] identifier[BelTerm] identifier[objBelTerm] operator[:] identifier[kAMStore] operator[SEP] identifier[getSupportingTerms] operator[SEP] identifier[objKamNode] operator[SEP] operator[SEP] {
identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[convert] operator[SEP] identifier[objBelTerm] , identifier[kamInfo] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[KAMStoreException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[KamStoreServiceException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP]
}
|
public void useMaxDimensions() {
int availableHeight = CmsToolbarPopup.getAvailableHeight();
int availableWidth = CmsToolbarPopup.getAvailableWidth();
setDialogSize(availableWidth, availableHeight);
} | class class_name[name] begin[{]
method[useMaxDimensions, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[int], availableHeight]
local_variable[type[int], availableWidth]
call[.setDialogSize, parameter[member[.availableWidth], member[.availableHeight]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[useMaxDimensions] operator[SEP] operator[SEP] {
Keyword[int] identifier[availableHeight] operator[=] identifier[CmsToolbarPopup] operator[SEP] identifier[getAvailableHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[availableWidth] operator[=] identifier[CmsToolbarPopup] operator[SEP] identifier[getAvailableWidth] operator[SEP] operator[SEP] operator[SEP] identifier[setDialogSize] operator[SEP] identifier[availableWidth] , identifier[availableHeight] operator[SEP] operator[SEP]
}
|
public static BufferedImage joinImages(List<BufferedImage> images, int lines, int height, int minHeight, boolean scale) {
// Array of input images.
List<BufferedImage> input = new ArrayList<BufferedImage>();
int actualHeight = height;
// if not scale, start from 1, so will use the max height of images, not more than that.
if (!scale) {
actualHeight = 1;
}
for (BufferedImage imageToJoin : images) {
try {
BufferedImage img = MyImageUtils.trim(imageToJoin);
if (scale) {
actualHeight = Integer.min(actualHeight, img.getHeight());
} else {
actualHeight = Integer.max(actualHeight, img.getHeight());
}
input.add(img);
} catch (Exception x) {
x.printStackTrace();
}
}
// minimum height for the posts is 480
if (scale && actualHeight < minHeight
&& input.size() > 0) {
actualHeight = minHeight;
}
int totalWidth = 0;
List<BufferedImage> fixedInput = new ArrayList<BufferedImage>();
for (BufferedImage img : input) {
BufferedImage newImg = img;
if (scale && img.getHeight() > actualHeight) {
newImg = MyImageUtils.resizeToHeight(img, actualHeight);
}
fixedInput.add(newImg);
totalWidth += newImg.getWidth();
}
// Create the output image and fill with white.
BufferedImage output = getWhiteImage(actualHeight * lines, totalWidth / lines);
drawImages(lines, scale, input, actualHeight, output.getGraphics());
return output;
} | class class_name[name] begin[{]
method[joinImages, return_type[type[BufferedImage]], modifier[public static], parameter[images, lines, height, minHeight, scale]] begin[{]
local_variable[type[List], input]
local_variable[type[int], actualHeight]
if[member[.scale]] begin[{]
assign[member[.actualHeight], literal[1]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=imageToJoin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trim, postfix_operators=[], prefix_operators=[], qualifier=MyImageUtils, selectors=[], type_arguments=None), name=img)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), IfStatement(condition=MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=actualHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=actualHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=img, selectors=[], type_arguments=None)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=actualHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=actualHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=img, selectors=[], type_arguments=None)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=img, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=images, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=imageToJoin)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None))), label=None)
if[binary_operation[binary_operation[member[.scale], &&, binary_operation[member[.actualHeight], <, member[.minHeight]]], &&, binary_operation[call[input.size, parameter[]], >, literal[0]]]] begin[{]
assign[member[.actualHeight], member[.minHeight]]
else begin[{]
None
end[}]
local_variable[type[int], totalWidth]
local_variable[type[List], fixedInput]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=img, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=newImg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=img, selectors=[], type_arguments=None), operandr=MemberReference(member=actualHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newImg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=img, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=actualHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resizeToHeight, postfix_operators=[], prefix_operators=[], qualifier=MyImageUtils, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newImg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fixedInput, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=newImg, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=img)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None))), label=None)
local_variable[type[BufferedImage], output]
call[.drawImages, parameter[member[.lines], member[.scale], member[.input], member[.actualHeight], call[output.getGraphics, parameter[]]]]
return[member[.output]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BufferedImage] identifier[joinImages] operator[SEP] identifier[List] operator[<] identifier[BufferedImage] operator[>] identifier[images] , Keyword[int] identifier[lines] , Keyword[int] identifier[height] , Keyword[int] identifier[minHeight] , Keyword[boolean] identifier[scale] operator[SEP] {
identifier[List] operator[<] identifier[BufferedImage] operator[>] identifier[input] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[BufferedImage] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[actualHeight] operator[=] identifier[height] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[scale] operator[SEP] {
identifier[actualHeight] operator[=] Other[1] operator[SEP]
}
Keyword[for] operator[SEP] identifier[BufferedImage] identifier[imageToJoin] operator[:] identifier[images] operator[SEP] {
Keyword[try] {
identifier[BufferedImage] identifier[img] operator[=] identifier[MyImageUtils] operator[SEP] identifier[trim] operator[SEP] identifier[imageToJoin] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scale] operator[SEP] {
identifier[actualHeight] operator[=] identifier[Integer] operator[SEP] identifier[min] operator[SEP] identifier[actualHeight] , identifier[img] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[actualHeight] operator[=] identifier[Integer] operator[SEP] identifier[max] operator[SEP] identifier[actualHeight] , identifier[img] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[input] operator[SEP] identifier[add] operator[SEP] identifier[img] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[x] operator[SEP] {
identifier[x] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[scale] operator[&&] identifier[actualHeight] operator[<] identifier[minHeight] operator[&&] identifier[input] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[actualHeight] operator[=] identifier[minHeight] operator[SEP]
}
Keyword[int] identifier[totalWidth] operator[=] Other[0] operator[SEP] identifier[List] operator[<] identifier[BufferedImage] operator[>] identifier[fixedInput] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[BufferedImage] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BufferedImage] identifier[img] operator[:] identifier[input] operator[SEP] {
identifier[BufferedImage] identifier[newImg] operator[=] identifier[img] operator[SEP] Keyword[if] operator[SEP] identifier[scale] operator[&&] identifier[img] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[>] identifier[actualHeight] operator[SEP] {
identifier[newImg] operator[=] identifier[MyImageUtils] operator[SEP] identifier[resizeToHeight] operator[SEP] identifier[img] , identifier[actualHeight] operator[SEP] operator[SEP]
}
identifier[fixedInput] operator[SEP] identifier[add] operator[SEP] identifier[newImg] operator[SEP] operator[SEP] identifier[totalWidth] operator[+=] identifier[newImg] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP]
}
identifier[BufferedImage] identifier[output] operator[=] identifier[getWhiteImage] operator[SEP] identifier[actualHeight] operator[*] identifier[lines] , identifier[totalWidth] operator[/] identifier[lines] operator[SEP] operator[SEP] identifier[drawImages] operator[SEP] identifier[lines] , identifier[scale] , identifier[input] , identifier[actualHeight] , identifier[output] operator[SEP] identifier[getGraphics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP]
}
|
@Indexable(type = IndexableType.DELETE)
@Override
public CommercePriceEntry deleteCommercePriceEntry(
CommercePriceEntry commercePriceEntry) throws PortalException {
return commercePriceEntryPersistence.remove(commercePriceEntry);
} | class class_name[name] begin[{]
method[deleteCommercePriceEntry, return_type[type[CommercePriceEntry]], modifier[public], parameter[commercePriceEntry]] begin[{]
return[call[commercePriceEntryPersistence.remove, parameter[member[.commercePriceEntry]]]]
end[}]
END[}] | annotation[@] identifier[Indexable] operator[SEP] identifier[type] operator[=] identifier[IndexableType] operator[SEP] identifier[DELETE] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[CommercePriceEntry] identifier[deleteCommercePriceEntry] operator[SEP] identifier[CommercePriceEntry] identifier[commercePriceEntry] operator[SEP] Keyword[throws] identifier[PortalException] {
Keyword[return] identifier[commercePriceEntryPersistence] operator[SEP] identifier[remove] operator[SEP] identifier[commercePriceEntry] operator[SEP] operator[SEP]
}
|
@Override
public void stopped() {
if (cache != null) {
try {
cache.close();
} catch (Throwable ignored) {
}
cache = null;
}
} | class class_name[name] begin[{]
method[stopped, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.cache], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Throwable']))], finally_block=None, label=None, resources=None)
assign[member[.cache], literal[null]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[stopped] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[cache] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[cache] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ignored] operator[SEP] {
}
identifier[cache] operator[=] Other[null] operator[SEP]
}
}
|
private List<TestCaseResult> createResultFromMap(IResultMap resultMap) {
logger.entering(resultMap);
List<TestCaseResult> statusWiseResults = new ArrayList<TestCaseResult>();
for (ITestResult singleMethodResult : resultMap.getAllResults()) {
TestCaseResult tcresult1 = new TestCaseResult();
tcresult1.setITestResultobj(singleMethodResult);
statusWiseResults.add(tcresult1);
}
Collections.sort(statusWiseResults);
logger.exiting(statusWiseResults);
return statusWiseResults;
} | class class_name[name] begin[{]
method[createResultFromMap, return_type[type[List]], modifier[private], parameter[resultMap]] begin[{]
call[logger.entering, parameter[member[.resultMap]]]
local_variable[type[List], statusWiseResults]
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=TestCaseResult, sub_type=None)), name=tcresult1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TestCaseResult, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=singleMethodResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setITestResultobj, postfix_operators=[], prefix_operators=[], qualifier=tcresult1, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tcresult1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=statusWiseResults, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAllResults, postfix_operators=[], prefix_operators=[], qualifier=resultMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=singleMethodResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ITestResult, sub_type=None))), label=None)
call[Collections.sort, parameter[member[.statusWiseResults]]]
call[logger.exiting, parameter[member[.statusWiseResults]]]
return[member[.statusWiseResults]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[TestCaseResult] operator[>] identifier[createResultFromMap] operator[SEP] identifier[IResultMap] identifier[resultMap] operator[SEP] {
identifier[logger] operator[SEP] identifier[entering] operator[SEP] identifier[resultMap] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[TestCaseResult] operator[>] identifier[statusWiseResults] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[TestCaseResult] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ITestResult] identifier[singleMethodResult] operator[:] identifier[resultMap] operator[SEP] identifier[getAllResults] operator[SEP] operator[SEP] operator[SEP] {
identifier[TestCaseResult] identifier[tcresult1] operator[=] Keyword[new] identifier[TestCaseResult] operator[SEP] operator[SEP] operator[SEP] identifier[tcresult1] operator[SEP] identifier[setITestResultobj] operator[SEP] identifier[singleMethodResult] operator[SEP] operator[SEP] identifier[statusWiseResults] operator[SEP] identifier[add] operator[SEP] identifier[tcresult1] operator[SEP] operator[SEP]
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[statusWiseResults] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[exiting] operator[SEP] identifier[statusWiseResults] operator[SEP] operator[SEP] Keyword[return] identifier[statusWiseResults] operator[SEP]
}
|
public static String setProperty(String key, String value) {
return INSTANCE.setProperty(key, value);
} | class class_name[name] begin[{]
method[setProperty, return_type[type[String]], modifier[public static], parameter[key, value]] begin[{]
return[call[INSTANCE.setProperty, parameter[member[.key], member[.value]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[setProperty] operator[SEP] identifier[String] identifier[key] , identifier[String] identifier[value] operator[SEP] {
Keyword[return] identifier[INSTANCE] operator[SEP] identifier[setProperty] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP]
}
|
public void execute() {
ExecutorService executorService = MoreExecutors.sameThreadExecutor();
for (Transaction<V, R> transaction : transactions) {
if (!transaction.isComplete()) {
executorService.execute(transaction);
}
}
try {
executorService.shutdown();
executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
throw new TransfuseTransactionException("Pool executor interrupted", e);
}
} | class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[ExecutorService], executorService]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isComplete, postfix_operators=[], prefix_operators=['!'], qualifier=transaction, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=executorService, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=transactions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=transaction)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=[], name=Transaction, sub_type=None))), label=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=shutdown, postfix_operators=[], prefix_operators=[], qualifier=executorService, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), MemberReference(member=MILLISECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=awaitTermination, postfix_operators=[], prefix_operators=[], qualifier=executorService, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Pool executor interrupted"), 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=TransfuseTransactionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] {
identifier[ExecutorService] identifier[executorService] operator[=] identifier[MoreExecutors] operator[SEP] identifier[sameThreadExecutor] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Transaction] operator[<] identifier[V] , identifier[R] operator[>] identifier[transaction] operator[:] identifier[transactions] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[transaction] operator[SEP] identifier[isComplete] operator[SEP] operator[SEP] operator[SEP] {
identifier[executorService] operator[SEP] identifier[execute] operator[SEP] identifier[transaction] operator[SEP] operator[SEP]
}
}
Keyword[try] {
identifier[executorService] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] identifier[executorService] operator[SEP] identifier[awaitTermination] operator[SEP] identifier[Long] operator[SEP] identifier[MAX_VALUE] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[TransfuseTransactionException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void marshall(UpdateDeviceStatusRequest updateDeviceStatusRequest, ProtocolMarshaller protocolMarshaller) {
if (updateDeviceStatusRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateDeviceStatusRequest.getAccessToken(), ACCESSTOKEN_BINDING);
protocolMarshaller.marshall(updateDeviceStatusRequest.getDeviceKey(), DEVICEKEY_BINDING);
protocolMarshaller.marshall(updateDeviceStatusRequest.getDeviceRememberedStatus(), DEVICEREMEMBEREDSTATUS_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[updateDeviceStatusRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.updateDeviceStatusRequest], ==, 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=getAccessToken, postfix_operators=[], prefix_operators=[], qualifier=updateDeviceStatusRequest, selectors=[], type_arguments=None), MemberReference(member=ACCESSTOKEN_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=getDeviceKey, postfix_operators=[], prefix_operators=[], qualifier=updateDeviceStatusRequest, selectors=[], type_arguments=None), MemberReference(member=DEVICEKEY_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=getDeviceRememberedStatus, postfix_operators=[], prefix_operators=[], qualifier=updateDeviceStatusRequest, selectors=[], type_arguments=None), MemberReference(member=DEVICEREMEMBEREDSTATUS_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[UpdateDeviceStatusRequest] identifier[updateDeviceStatusRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[updateDeviceStatusRequest] 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[updateDeviceStatusRequest] operator[SEP] identifier[getAccessToken] operator[SEP] operator[SEP] , identifier[ACCESSTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateDeviceStatusRequest] operator[SEP] identifier[getDeviceKey] operator[SEP] operator[SEP] , identifier[DEVICEKEY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateDeviceStatusRequest] operator[SEP] identifier[getDeviceRememberedStatus] operator[SEP] operator[SEP] , identifier[DEVICEREMEMBEREDSTATUS_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]
}
}
|
private static byte[] readStream(final InputStream inputStream, final boolean close)
throws IOException {
if (inputStream == null) {
throw new IOException("Class not found");
}
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] data = new byte[INPUT_STREAM_DATA_CHUNK_SIZE];
int bytesRead;
while ((bytesRead = inputStream.read(data, 0, data.length)) != -1) {
outputStream.write(data, 0, bytesRead);
}
outputStream.flush();
return outputStream.toByteArray();
} finally {
if (close) {
inputStream.close();
}
}
} | class class_name[name] begin[{]
method[readStream, return_type[type[byte]], modifier[private static], parameter[inputStream, close]] begin[{]
if[binary_operation[member[.inputStream], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class not found")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[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=ByteArrayOutputStream, sub_type=None)), name=outputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=INPUT_STREAM_DATA_CHUNK_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=data)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=bytesRead)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=bytesRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=outputStream, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=bytesRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=inputStream, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=outputStream, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=outputStream, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=inputStream, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[readStream] operator[SEP] Keyword[final] identifier[InputStream] identifier[inputStream] , Keyword[final] Keyword[boolean] identifier[close] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[inputStream] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[ByteArrayOutputStream] identifier[outputStream] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[INPUT_STREAM_DATA_CHUNK_SIZE] operator[SEP] operator[SEP] Keyword[int] identifier[bytesRead] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[bytesRead] operator[=] identifier[inputStream] operator[SEP] identifier[read] operator[SEP] identifier[data] , Other[0] , identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[outputStream] operator[SEP] identifier[write] operator[SEP] identifier[data] , Other[0] , identifier[bytesRead] operator[SEP] operator[SEP]
}
identifier[outputStream] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[outputStream] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[close] operator[SEP] {
identifier[inputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public ServiceFuture<DeletedSasDefinitionBundle> deleteSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback<DeletedSasDefinitionBundle> serviceCallback) {
return ServiceFuture.fromResponse(deleteSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName), serviceCallback);
} | class class_name[name] begin[{]
method[deleteSasDefinitionAsync, return_type[type[ServiceFuture]], modifier[public], parameter[vaultBaseUrl, storageAccountName, sasDefinitionName, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.deleteSasDefinitionWithServiceResponseAsync, parameter[member[.vaultBaseUrl], member[.storageAccountName], member[.sasDefinitionName]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[DeletedSasDefinitionBundle] operator[>] identifier[deleteSasDefinitionAsync] operator[SEP] identifier[String] identifier[vaultBaseUrl] , identifier[String] identifier[storageAccountName] , identifier[String] identifier[sasDefinitionName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[DeletedSasDefinitionBundle] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[deleteSasDefinitionWithServiceResponseAsync] operator[SEP] identifier[vaultBaseUrl] , identifier[storageAccountName] , identifier[sasDefinitionName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
@DoesServiceRequest
public Iterable<CloudQueue> listQueues() {
return this.listQueues(null, QueueListingDetails.NONE, null, null);
} | class class_name[name] begin[{]
method[listQueues, return_type[type[Iterable]], modifier[public], parameter[]] begin[{]
return[THIS[call[None.listQueues, parameter[literal[null], member[QueueListingDetails.NONE], literal[null], literal[null]]]]]
end[}]
END[}] | annotation[@] identifier[DoesServiceRequest] Keyword[public] identifier[Iterable] operator[<] identifier[CloudQueue] operator[>] identifier[listQueues] operator[SEP] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[listQueues] operator[SEP] Other[null] , identifier[QueueListingDetails] operator[SEP] identifier[NONE] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
public static SentryStackTraceElement[] fromStackTraceElements(StackTraceElement[] stackTraceElements,
Frame[] cachedFrames) {
/*
This loop is a bit hairy because it has to deal with cached frames (from FrameCache, set by
the agent if it is in use).
- If cachedFrames is null (most commonly: because the agent isn't being used) nothing fancy
needs to happen.
- If cachedFrames is not null we need to pair frames from stackTraceElements (the exception
being captured) to frames found in the FrameCache.
The issue is that some frameworks/libraries seem to trim stacktraces in some cases, and
so the array in the FrameCache (set when the original exception was *thrown*) may slightly
differ (be larger) than the actual exception that is being captured. For this reason we
need to iterate cachedFrames separately, sometimes advancing 'further' than the equivalent
index in stackTraceElements (thus skipping elements). In addition, the only information
we have to "match" frames with is the method name, which is checked for equality between
the two arrays at each step.
In the worst case, if something is mangled or weird, we just iterate through the cachedFrames
immediately (not finding a match) and locals are not set/sent with the event.
*/
SentryStackTraceElement[] sentryStackTraceElements = new SentryStackTraceElement[stackTraceElements.length];
for (int i = 0, j = 0; i < stackTraceElements.length; i++, j++) {
StackTraceElement stackTraceElement = stackTraceElements[i];
Map<String, Object> locals = null;
if (cachedFrames != null) {
// step through cachedFrames until we hit a match on the method in the stackTraceElement
while (j < cachedFrames.length
&& !cachedFrames[j].getMethod().getName().equals(stackTraceElement.getMethodName())) {
j++;
}
// only use cachedFrame locals if we haven't exhausted the array
if (j < cachedFrames.length) {
locals = cachedFrames[j].getLocals();
}
}
sentryStackTraceElements[i] = fromStackTraceElement(stackTraceElement, locals);
}
return sentryStackTraceElements;
} | class class_name[name] begin[{]
method[fromStackTraceElements, return_type[type[SentryStackTraceElement]], modifier[public static], parameter[stackTraceElements, cachedFrames]] begin[{]
local_variable[type[SentryStackTraceElement], sentryStackTraceElements]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=stackTraceElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=stackTraceElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StackTraceElement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=locals)], 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)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cachedFrames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cachedFrames, selectors=[]), operator=<), operandr=MemberReference(member=cachedFrames, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMethodName, postfix_operators=[], prefix_operators=[], qualifier=stackTraceElement, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=&&), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cachedFrames, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=locals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=cachedFrames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getLocals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sentryStackTraceElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=stackTraceElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromStackTraceElement, 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=stackTraceElements, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.sentryStackTraceElements]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SentryStackTraceElement] operator[SEP] operator[SEP] identifier[fromStackTraceElements] operator[SEP] identifier[StackTraceElement] operator[SEP] operator[SEP] identifier[stackTraceElements] , identifier[Frame] operator[SEP] operator[SEP] identifier[cachedFrames] operator[SEP] {
identifier[SentryStackTraceElement] operator[SEP] operator[SEP] identifier[sentryStackTraceElements] operator[=] Keyword[new] identifier[SentryStackTraceElement] operator[SEP] identifier[stackTraceElements] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[j] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[stackTraceElements] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] , identifier[j] operator[++] operator[SEP] {
identifier[StackTraceElement] identifier[stackTraceElement] operator[=] identifier[stackTraceElements] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[locals] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[cachedFrames] operator[!=] Other[null] operator[SEP] {
Keyword[while] operator[SEP] identifier[j] operator[<] identifier[cachedFrames] operator[SEP] identifier[length] operator[&&] operator[!] identifier[cachedFrames] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[stackTraceElement] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[j] operator[++] operator[SEP]
}
Keyword[if] operator[SEP] identifier[j] operator[<] identifier[cachedFrames] operator[SEP] identifier[length] operator[SEP] {
identifier[locals] operator[=] identifier[cachedFrames] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getLocals] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[sentryStackTraceElements] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[fromStackTraceElement] operator[SEP] identifier[stackTraceElement] , identifier[locals] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sentryStackTraceElements] operator[SEP]
}
|
@CheckReturnValue
public GuildManager setRequiredMFALevel(Guild.MFALevel level)
{
Checks.notNull(level, "Level");
Checks.check(level != Guild.MFALevel.UNKNOWN, "Level must not be UNKNOWN");
this.mfaLevel = level.getKey();
set |= MFA_LEVEL;
return this;
} | class class_name[name] begin[{]
method[setRequiredMFALevel, return_type[type[GuildManager]], modifier[public], parameter[level]] begin[{]
call[Checks.notNull, parameter[member[.level], literal["Level"]]]
call[Checks.check, parameter[binary_operation[member[.level], !=, member[Guild.MFALevel.UNKNOWN]], literal["Level must not be UNKNOWN"]]]
assign[THIS[member[None.mfaLevel]], call[level.getKey, parameter[]]]
assign[member[.set], member[.MFA_LEVEL]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] Keyword[public] identifier[GuildManager] identifier[setRequiredMFALevel] operator[SEP] identifier[Guild] operator[SEP] identifier[MFALevel] identifier[level] operator[SEP] {
identifier[Checks] operator[SEP] identifier[notNull] operator[SEP] identifier[level] , literal[String] operator[SEP] operator[SEP] identifier[Checks] operator[SEP] identifier[check] operator[SEP] identifier[level] operator[!=] identifier[Guild] operator[SEP] identifier[MFALevel] operator[SEP] identifier[UNKNOWN] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[mfaLevel] operator[=] identifier[level] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[|=] identifier[MFA_LEVEL] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
protected void configure() {
// Primitive mappers
primitiveType( boolean.class ).serializer( BooleanJsonSerializer.class ).deserializer( BooleanJsonDeserializer.class );
primitiveType( char.class ).serializer( CharacterJsonSerializer.class ).deserializer( CharacterJsonDeserializer.class );
primitiveType( byte.class ).serializer( ByteJsonSerializer.class ).deserializer( ByteJsonDeserializer.class );
primitiveType( double.class ).serializer( DoubleJsonSerializer.class ).deserializer( DoubleJsonDeserializer.class );
primitiveType( float.class ).serializer( FloatJsonSerializer.class ).deserializer( FloatJsonDeserializer.class );
primitiveType( int.class ).serializer( IntegerJsonSerializer.class ).deserializer( IntegerJsonDeserializer.class );
primitiveType( long.class ).serializer( LongJsonSerializer.class ).deserializer( LongJsonDeserializer.class );
primitiveType( short.class ).serializer( ShortJsonSerializer.class ).deserializer( ShortJsonDeserializer.class );
// Common mappers
type( String.class ).serializer( StringJsonSerializer.class ).deserializer( StringJsonDeserializer.class );
type( Boolean.class ).serializer( BooleanJsonSerializer.class ).deserializer( BooleanJsonDeserializer.class );
type( Character.class ).serializer( CharacterJsonSerializer.class ).deserializer( CharacterJsonDeserializer.class );
type( UUID.class ).serializer( UUIDJsonSerializer.class ).deserializer( UUIDJsonDeserializer.class );
type( Void.class ).serializer( VoidJsonSerializer.class ).deserializer( VoidJsonDeserializer.class );
type( JavaScriptObject.class ).serializer( JavaScriptObjectJsonSerializer.class )
.deserializer( JavaScriptObjectJsonDeserializer.class );
type( Enum.class ).serializer( EnumJsonSerializer.class ).deserializer( EnumJsonDeserializer.class );
// Number mappers
type( BigDecimal.class ).serializer( BigDecimalJsonSerializer.class ).deserializer( BigDecimalJsonDeserializer.class );
type( BigInteger.class ).serializer( BigIntegerJsonSerializer.class ).deserializer( BigIntegerJsonDeserializer.class );
type( Byte.class ).serializer( ByteJsonSerializer.class ).deserializer( ByteJsonDeserializer.class );
type( Double.class ).serializer( DoubleJsonSerializer.class ).deserializer( DoubleJsonDeserializer.class );
type( Float.class ).serializer( FloatJsonSerializer.class ).deserializer( FloatJsonDeserializer.class );
type( Integer.class ).serializer( IntegerJsonSerializer.class ).deserializer( IntegerJsonDeserializer.class );
type( Long.class ).serializer( LongJsonSerializer.class ).deserializer( LongJsonDeserializer.class );
type( Short.class ).serializer( ShortJsonSerializer.class ).deserializer( ShortJsonDeserializer.class );
type( Number.class ).serializer( NumberJsonSerializer.class ).deserializer( NumberJsonDeserializer.class );
// Date mappers
type( Date.class ).serializer( DateJsonSerializer.class ).deserializer( DateJsonDeserializer.class );
type( java.sql.Date.class ).serializer( SqlDateJsonSerializer.class ).deserializer( SqlDateJsonDeserializer.class );
type( Time.class ).serializer( SqlTimeJsonSerializer.class ).deserializer( SqlTimeJsonDeserializer.class );
type( Timestamp.class ).serializer( SqlTimestampJsonSerializer.class ).deserializer( SqlTimestampJsonDeserializer.class );
// Iterable mappers
type( Iterable.class ).serializer( IterableJsonSerializer.class ).deserializer( IterableJsonDeserializer.class );
type( Collection.class ).serializer( CollectionJsonSerializer.class ).deserializer( CollectionJsonDeserializer.class );
type( AbstractCollection.class ).serializer( CollectionJsonSerializer.class )
.deserializer( AbstractCollectionJsonDeserializer.class );
type( AbstractList.class ).serializer( CollectionJsonSerializer.class ).deserializer( AbstractListJsonDeserializer.class );
type( AbstractQueue.class ).serializer( CollectionJsonSerializer.class ).deserializer( AbstractQueueJsonDeserializer.class );
type( AbstractSequentialList.class ).serializer( CollectionJsonSerializer.class )
.deserializer( AbstractSequentialListJsonDeserializer.class );
type( AbstractSet.class ).serializer( CollectionJsonSerializer.class ).deserializer( AbstractSetJsonDeserializer.class );
type( ArrayList.class ).serializer( CollectionJsonSerializer.class ).deserializer( ArrayListJsonDeserializer.class );
type( EnumSet.class ).serializer( CollectionJsonSerializer.class ).deserializer( EnumSetJsonDeserializer.class );
type( HashSet.class ).serializer( CollectionJsonSerializer.class ).deserializer( HashSetJsonDeserializer.class );
type( LinkedHashSet.class ).serializer( CollectionJsonSerializer.class ).deserializer( LinkedHashSetJsonDeserializer.class );
type( LinkedList.class ).serializer( CollectionJsonSerializer.class ).deserializer( LinkedListJsonDeserializer.class );
type( List.class ).serializer( CollectionJsonSerializer.class ).deserializer( ListJsonDeserializer.class );
type( PriorityQueue.class ).serializer( CollectionJsonSerializer.class ).deserializer( PriorityQueueJsonDeserializer.class );
type( Queue.class ).serializer( CollectionJsonSerializer.class ).deserializer( QueueJsonDeserializer.class );
type( Set.class ).serializer( CollectionJsonSerializer.class ).deserializer( SetJsonDeserializer.class );
type( SortedSet.class ).serializer( CollectionJsonSerializer.class ).deserializer( SortedSetJsonDeserializer.class );
type( Stack.class ).serializer( CollectionJsonSerializer.class ).deserializer( StackJsonDeserializer.class );
type( TreeSet.class ).serializer( CollectionJsonSerializer.class ).deserializer( TreeSetJsonDeserializer.class );
type( Vector.class ).serializer( CollectionJsonSerializer.class ).deserializer( VectorJsonDeserializer.class );
// Map mappers
type( Map.class ).serializer( MapJsonSerializer.class ).deserializer( MapJsonDeserializer.class );
type( AbstractMap.class ).serializer( MapJsonSerializer.class ).deserializer( AbstractMapJsonDeserializer.class );
type( EnumMap.class ).serializer( MapJsonSerializer.class ).deserializer( EnumMapJsonDeserializer.class );
type( HashMap.class ).serializer( MapJsonSerializer.class ).deserializer( HashMapJsonDeserializer.class );
type( IdentityHashMap.class ).serializer( MapJsonSerializer.class ).deserializer( IdentityHashMapJsonDeserializer.class );
type( LinkedHashMap.class ).serializer( MapJsonSerializer.class ).deserializer( LinkedHashMapJsonDeserializer.class );
type( SortedMap.class ).serializer( MapJsonSerializer.class ).deserializer( SortedMapJsonDeserializer.class );
type( TreeMap.class ).serializer( MapJsonSerializer.class ).deserializer( TreeMapJsonDeserializer.class );
// Primitive array mappers
type( boolean[].class ).serializer( PrimitiveBooleanArrayJsonSerializer.class )
.deserializer( PrimitiveBooleanArrayJsonDeserializer.class );
type( byte[].class ).serializer( PrimitiveByteArrayJsonSerializer.class ).deserializer( PrimitiveByteArrayJsonDeserializer.class );
type( char[].class ).serializer( PrimitiveCharacterArrayJsonSerializer.class )
.deserializer( PrimitiveCharacterArrayJsonDeserializer.class );
type( double[].class ).serializer( PrimitiveDoubleArrayJsonSerializer.class )
.deserializer( PrimitiveDoubleArrayJsonDeserializer.class );
type( float[].class ).serializer( PrimitiveFloatArrayJsonSerializer.class )
.deserializer( PrimitiveFloatArrayJsonDeserializer.class );
type( int[].class ).serializer( PrimitiveIntegerArrayJsonSerializer.class )
.deserializer( PrimitiveIntegerArrayJsonDeserializer.class );
type( long[].class ).serializer( PrimitiveLongArrayJsonSerializer.class ).deserializer( PrimitiveLongArrayJsonDeserializer.class );
type( short[].class ).serializer( PrimitiveShortArrayJsonSerializer.class )
.deserializer( PrimitiveShortArrayJsonDeserializer.class );
// Primitive 2D Array mappers
type( boolean[][].class ).serializer( PrimitiveBooleanArray2dJsonSerializer.class )
.deserializer( PrimitiveBooleanArray2dJsonDeserializer.class );
type( byte[][].class ).serializer( PrimitiveByteArray2dJsonSerializer.class )
.deserializer( PrimitiveByteArray2dJsonDeserializer.class );
type( char[][].class ).serializer( PrimitiveCharacterArray2dJsonSerializer.class )
.deserializer( PrimitiveCharacterArray2dJsonDeserializer.class );
type( double[][].class ).serializer( PrimitiveDoubleArray2dJsonSerializer.class )
.deserializer( PrimitiveDoubleArray2dJsonDeserializer.class );
type( float[][].class ).serializer( PrimitiveFloatArray2dJsonSerializer.class )
.deserializer( PrimitiveFloatArray2dJsonDeserializer.class );
type( int[][].class ).serializer( PrimitiveIntegerArray2dJsonSerializer.class )
.deserializer( PrimitiveIntegerArray2dJsonDeserializer.class );
type( long[][].class ).serializer( PrimitiveLongArray2dJsonSerializer.class )
.deserializer( PrimitiveLongArray2dJsonDeserializer.class );
type( short[][].class ).serializer( PrimitiveShortArray2dJsonSerializer.class )
.deserializer( PrimitiveShortArray2dJsonDeserializer.class );
// Map's key mappers
key( Object.class ).serializer( ObjectKeySerializer.class ).deserializer( StringKeyDeserializer.class );
key( Serializable.class ).serializer( ObjectKeySerializer.class ).deserializer( StringKeyDeserializer.class );
key( BigDecimal.class ).serializer( NumberKeySerializer.class ).deserializer( BigDecimalKeyDeserializer.class );
key( BigInteger.class ).serializer( NumberKeySerializer.class ).deserializer( BigIntegerKeyDeserializer.class );
key( Boolean.class ).serializer( BooleanKeySerializer.class ).deserializer( BooleanKeyDeserializer.class );
key( Byte.class ).serializer( NumberKeySerializer.class ).deserializer( ByteKeyDeserializer.class );
key( Character.class ).serializer( ToStringKeySerializer.class ).deserializer( CharacterKeyDeserializer.class );
key( Date.class ).serializer( DateKeySerializer.class ).deserializer( DateKeyDeserializer.class );
key( Double.class ).serializer( NumberKeySerializer.class ).deserializer( DoubleKeyDeserializer.class );
key( Enum.class ).serializer( EnumKeySerializer.class ).deserializer( EnumKeyDeserializer.class );
key( Float.class ).serializer( NumberKeySerializer.class ).deserializer( FloatKeyDeserializer.class );
key( Integer.class ).serializer( NumberKeySerializer.class ).deserializer( IntegerKeyDeserializer.class );
key( Long.class ).serializer( NumberKeySerializer.class ).deserializer( LongKeyDeserializer.class );
key( Short.class ).serializer( NumberKeySerializer.class ).deserializer( ShortKeyDeserializer.class );
key( java.sql.Date.class ).serializer( DateKeySerializer.class ).deserializer( SqlDateKeyDeserializer.class );
key( Time.class ).serializer( DateKeySerializer.class ).deserializer( SqlTimeKeyDeserializer.class );
key( Timestamp.class ).serializer( DateKeySerializer.class ).deserializer( SqlTimestampKeyDeserializer.class );
key( String.class ).serializer( ToStringKeySerializer.class ).deserializer( StringKeyDeserializer.class );
key( UUID.class ).serializer( UUIDKeySerializer.class ).deserializer( UUIDKeyDeserializer.class );
} | class class_name[name] begin[{]
method[configure, return_type[void], modifier[protected], parameter[]] begin[{]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean))]]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=char))]]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=byte))]]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=double))]]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=float))]]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int))]]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=long))]]
call[.primitiveType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=short))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Character, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UUID, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Void, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JavaScriptObject, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Enum, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Number, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=java.sql, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Time, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Timestamp, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Iterable, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Collection, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractCollection, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractList, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractQueue, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractSequentialList, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractSet, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EnumSet, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashSet, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LinkedHashSet, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LinkedList, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PriorityQueue, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Queue, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Set, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SortedSet, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Stack, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TreeSet, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Vector, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractMap, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EnumMap, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IdentityHashMap, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LinkedHashMap, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SortedMap, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TreeMap, sub_type=None))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=boolean))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=byte))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=char))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=double))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=float))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=int))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=long))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=short))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=boolean))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=byte))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=char))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=double))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=float))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=int))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=long))]]
call[.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None, None], name=short))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Serializable, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Character, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Enum, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=java.sql, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Time, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Timestamp, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
call[.key, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UUID, sub_type=None))]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[configure] operator[SEP] operator[SEP] {
identifier[primitiveType] operator[SEP] Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[BooleanJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[BooleanJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[primitiveType] operator[SEP] Keyword[char] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CharacterJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[CharacterJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[primitiveType] operator[SEP] Keyword[byte] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ByteJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ByteJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[primitiveType] operator[SEP] Keyword[double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[DoubleJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[DoubleJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[primitiveType] operator[SEP] Keyword[float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[FloatJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[FloatJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[primitiveType] operator[SEP] Keyword[int] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[IntegerJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[IntegerJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[primitiveType] operator[SEP] Keyword[long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[LongJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[LongJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[primitiveType] operator[SEP] Keyword[short] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ShortJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ShortJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[StringJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[StringJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[BooleanJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[BooleanJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Character] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CharacterJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[CharacterJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[UUID] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[UUIDJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[UUIDJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Void] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[VoidJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[VoidJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[JavaScriptObject] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[JavaScriptObjectJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[JavaScriptObjectJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Enum] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[EnumJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[EnumJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[BigDecimal] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[BigDecimalJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[BigDecimalJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[BigInteger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[BigIntegerJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[BigIntegerJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Byte] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ByteJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ByteJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[DoubleJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[DoubleJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[FloatJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[FloatJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[IntegerJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[IntegerJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[LongJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[LongJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Short] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ShortJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ShortJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Number] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[NumberJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Date] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[DateJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[DateJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Date] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[SqlDateJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SqlDateJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Time] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[SqlTimeJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SqlTimeJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Timestamp] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[SqlTimestampJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SqlTimestampJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Iterable] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[IterableJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[IterableJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Collection] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[CollectionJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[AbstractCollection] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[AbstractCollectionJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[AbstractList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[AbstractListJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[AbstractQueue] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[AbstractQueueJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[AbstractSequentialList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[AbstractSequentialListJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[AbstractSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[AbstractSetJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[ArrayList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ArrayListJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[EnumSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[EnumSetJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[HashSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[HashSetJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[LinkedHashSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[LinkedHashSetJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[LinkedList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[LinkedListJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[List] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ListJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[PriorityQueue] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PriorityQueueJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Queue] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[QueueJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Set] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SetJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[SortedSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SortedSetJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Stack] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[StackJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[TreeSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[TreeSetJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Vector] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[CollectionJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[VectorJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[Map] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[MapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[AbstractMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[AbstractMapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[EnumMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[EnumMapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[HashMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[HashMapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[IdentityHashMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[IdentityHashMapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[LinkedHashMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[LinkedHashMapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[SortedMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SortedMapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[TreeMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[MapJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[TreeMapJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveBooleanArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveBooleanArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveByteArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveByteArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveCharacterArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveCharacterArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveDoubleArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveDoubleArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[float] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveFloatArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveFloatArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveIntegerArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveIntegerArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[long] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveLongArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveLongArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[short] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveShortArrayJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveShortArrayJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveBooleanArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveBooleanArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveByteArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveByteArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveCharacterArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveCharacterArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveDoubleArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveDoubleArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[float] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveFloatArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveFloatArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveIntegerArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveIntegerArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[long] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveLongArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveLongArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[type] operator[SEP] Keyword[short] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[PrimitiveShortArray2dJsonSerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[PrimitiveShortArray2dJsonDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ObjectKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[StringKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Serializable] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ObjectKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[StringKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[BigDecimal] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[BigDecimalKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[BigInteger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[BigIntegerKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[BooleanKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[BooleanKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Byte] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ByteKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Character] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ToStringKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[CharacterKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Date] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[DateKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[DateKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[DoubleKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Enum] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[EnumKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[EnumKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[FloatKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[IntegerKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[LongKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Short] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[NumberKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[ShortKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Date] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[DateKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SqlDateKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Time] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[DateKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SqlTimeKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Timestamp] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[DateKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[SqlTimestampKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[ToStringKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[StringKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[UUID] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[UUIDKeySerializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[deserializer] operator[SEP] identifier[UUIDKeyDeserializer] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public static String save(String str) {
String path;
synchronized (SAVE_DELETE_LOCK) {
path = save("looper", str);
}
return path;
} | class class_name[name] begin[{]
method[save, return_type[type[String]], modifier[public static], parameter[str]] begin[{]
local_variable[type[String], path]
SYNCHRONIZED[member[.SAVE_DELETE_LOCK]] BEGIN[{]
assign[member[.path], call[.save, parameter[literal["looper"], member[.str]]]]
END[}]
return[member[.path]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[save] operator[SEP] identifier[String] identifier[str] operator[SEP] {
identifier[String] identifier[path] operator[SEP] Keyword[synchronized] operator[SEP] identifier[SAVE_DELETE_LOCK] operator[SEP] {
identifier[path] operator[=] identifier[save] operator[SEP] literal[String] , identifier[str] operator[SEP] operator[SEP]
}
Keyword[return] identifier[path] operator[SEP]
}
|
public EClass getIfcRelAssociatesApproval() {
if (ifcRelAssociatesApprovalEClass == null) {
ifcRelAssociatesApprovalEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(449);
}
return ifcRelAssociatesApprovalEClass;
} | class class_name[name] begin[{]
method[getIfcRelAssociatesApproval, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcRelAssociatesApprovalEClass], ==, literal[null]]] begin[{]
assign[member[.ifcRelAssociatesApprovalEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=449)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcRelAssociatesApprovalEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIfcRelAssociatesApproval] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcRelAssociatesApprovalEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcRelAssociatesApprovalEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[449] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcRelAssociatesApprovalEClass] operator[SEP]
}
|
@Override
public <T> AppEngineUpdate<E> set(Property<?, T> property, T value) {
if (property == null) {
throw new IllegalArgumentException("'property' must not be [" + property + "]");
}
properties.put(property, value);
return this;
} | class class_name[name] begin[{]
method[set, return_type[type[AppEngineUpdate]], modifier[public], parameter[property, value]] begin[{]
if[binary_operation[member[.property], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'property' must not be ["), operandr=MemberReference(member=property, 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=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[properties.put, parameter[member[.property], member[.value]]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[AppEngineUpdate] operator[<] identifier[E] operator[>] identifier[set] operator[SEP] identifier[Property] operator[<] operator[?] , identifier[T] operator[>] identifier[property] , identifier[T] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[property] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[property] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private void initDurationButtonGroup() {
m_groupDuration = new CmsRadioButtonGroup();
m_endsAfterRadioButton = new CmsRadioButton(
EndType.TIMES.toString(),
Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_OCC_0));
m_endsAfterRadioButton.setGroup(m_groupDuration);
m_endsAtRadioButton = new CmsRadioButton(
EndType.DATE.toString(),
Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_DATE_0));
m_endsAtRadioButton.setGroup(m_groupDuration);
m_groupDuration.addValueChangeHandler(new ValueChangeHandler<String>() {
public void onValueChange(ValueChangeEvent<String> event) {
if (handleChange()) {
String value = event.getValue();
if (null != value) {
m_controller.setEndType(value);
}
}
}
});
} | class class_name[name] begin[{]
method[initDurationButtonGroup, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.m_groupDuration], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsRadioButtonGroup, sub_type=None))]
assign[member[.m_endsAfterRadioButton], ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=EndType.TIMES, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=GUI_SERIALDATE_DURATION_ENDTYPE_OCC_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsRadioButton, sub_type=None))]
call[m_endsAfterRadioButton.setGroup, parameter[member[.m_groupDuration]]]
assign[member[.m_endsAtRadioButton], ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=EndType.DATE, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=GUI_SERIALDATE_DURATION_ENDTYPE_DATE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsRadioButton, sub_type=None))]
call[m_endsAtRadioButton.setGroup, parameter[member[.m_groupDuration]]]
call[m_groupDuration.addValueChangeHandler, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[IfStatement(condition=MethodInvocation(arguments=[], member=handleChange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEndType, postfix_operators=[], prefix_operators=[], qualifier=m_controller, selectors=[], type_arguments=None), label=None)]))]))], documentation=None, modifiers={'public'}, name=onValueChange, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=ValueChangeEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ValueChangeHandler, sub_type=None))]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[initDurationButtonGroup] operator[SEP] operator[SEP] {
identifier[m_groupDuration] operator[=] Keyword[new] identifier[CmsRadioButtonGroup] operator[SEP] operator[SEP] operator[SEP] identifier[m_endsAfterRadioButton] operator[=] Keyword[new] identifier[CmsRadioButton] operator[SEP] identifier[EndType] operator[SEP] identifier[TIMES] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_SERIALDATE_DURATION_ENDTYPE_OCC_0] operator[SEP] operator[SEP] operator[SEP] identifier[m_endsAfterRadioButton] operator[SEP] identifier[setGroup] operator[SEP] identifier[m_groupDuration] operator[SEP] operator[SEP] identifier[m_endsAtRadioButton] operator[=] Keyword[new] identifier[CmsRadioButton] operator[SEP] identifier[EndType] operator[SEP] identifier[DATE] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_SERIALDATE_DURATION_ENDTYPE_DATE_0] operator[SEP] operator[SEP] operator[SEP] identifier[m_endsAtRadioButton] operator[SEP] identifier[setGroup] operator[SEP] identifier[m_groupDuration] operator[SEP] operator[SEP] identifier[m_groupDuration] operator[SEP] identifier[addValueChangeHandler] operator[SEP] Keyword[new] identifier[ValueChangeHandler] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onValueChange] operator[SEP] identifier[ValueChangeEvent] operator[<] identifier[String] operator[>] identifier[event] operator[SEP] {
Keyword[if] operator[SEP] identifier[handleChange] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[event] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[value] operator[SEP] {
identifier[m_controller] operator[SEP] identifier[setEndType] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
}
} operator[SEP] operator[SEP]
}
|
public void setACL(final String path, List<ACL> acl, int version,
StatCallback cb, Object ctx) {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
final String serverPath = prependChroot(clientPath);
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.setACL);
SetACLRequest request = new SetACLRequest();
request.setPath(serverPath);
request.setAcl(acl);
request.setVersion(version);
SetACLResponse response = new SetACLResponse();
cnxn.queuePacket(h, new ReplyHeader(), request, response, cb,
clientPath, serverPath, ctx, null);
} | class class_name[name] begin[{]
method[setACL, return_type[void], modifier[public], parameter[path, acl, version, cb, ctx]] begin[{]
call[.verbotenThreadCheck, parameter[]]
local_variable[type[String], clientPath]
call[PathUtils.validatePath, parameter[member[.clientPath]]]
local_variable[type[String], serverPath]
local_variable[type[RequestHeader], h]
call[h.setType, parameter[member[ZooDefs.OpCode.setACL]]]
local_variable[type[SetACLRequest], request]
call[request.setPath, parameter[member[.serverPath]]]
call[request.setAcl, parameter[member[.acl]]]
call[request.setVersion, parameter[member[.version]]]
local_variable[type[SetACLResponse], response]
call[cnxn.queuePacket, parameter[member[.h], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReplyHeader, sub_type=None)), member[.request], member[.response], member[.cb], member[.clientPath], member[.serverPath], member[.ctx], literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setACL] operator[SEP] Keyword[final] identifier[String] identifier[path] , identifier[List] operator[<] identifier[ACL] operator[>] identifier[acl] , Keyword[int] identifier[version] , identifier[StatCallback] identifier[cb] , identifier[Object] identifier[ctx] operator[SEP] {
identifier[verbotenThreadCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[clientPath] operator[=] identifier[path] operator[SEP] identifier[PathUtils] operator[SEP] identifier[validatePath] operator[SEP] identifier[clientPath] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[serverPath] operator[=] identifier[prependChroot] operator[SEP] identifier[clientPath] operator[SEP] operator[SEP] identifier[RequestHeader] identifier[h] operator[=] Keyword[new] identifier[RequestHeader] operator[SEP] operator[SEP] operator[SEP] identifier[h] operator[SEP] identifier[setType] operator[SEP] identifier[ZooDefs] operator[SEP] identifier[OpCode] operator[SEP] identifier[setACL] operator[SEP] operator[SEP] identifier[SetACLRequest] identifier[request] operator[=] Keyword[new] identifier[SetACLRequest] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setPath] operator[SEP] identifier[serverPath] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setAcl] operator[SEP] identifier[acl] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setVersion] operator[SEP] identifier[version] operator[SEP] operator[SEP] identifier[SetACLResponse] identifier[response] operator[=] Keyword[new] identifier[SetACLResponse] operator[SEP] operator[SEP] operator[SEP] identifier[cnxn] operator[SEP] identifier[queuePacket] operator[SEP] identifier[h] , Keyword[new] identifier[ReplyHeader] operator[SEP] operator[SEP] , identifier[request] , identifier[response] , identifier[cb] , identifier[clientPath] , identifier[serverPath] , identifier[ctx] , Other[null] operator[SEP] operator[SEP]
}
|
public static void mount(VirtualFile target, MountOption... mountOptions) throws IOException {
mount(new VirtualFileOwner(target), target, mountOptions);
} | class class_name[name] begin[{]
method[mount, return_type[void], modifier[public static], parameter[target, mountOptions]] begin[{]
call[.mount, parameter[ClassCreator(arguments=[MemberReference(member=target, 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=VirtualFileOwner, sub_type=None)), member[.target], member[.mountOptions]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[mount] operator[SEP] identifier[VirtualFile] identifier[target] , identifier[MountOption] operator[...] identifier[mountOptions] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[mount] operator[SEP] Keyword[new] identifier[VirtualFileOwner] operator[SEP] identifier[target] operator[SEP] , identifier[target] , identifier[mountOptions] operator[SEP] operator[SEP]
}
|
private boolean checkFrVatId(final String pvatId) {
final int checkSum = Integer.parseInt(pvatId.substring(2, 4));
final int sum = Integer.parseInt(pvatId.substring(4));
final int calculatedCheckSum = (12 + 3 * (sum % MODULO_97)) % MODULO_97;
return checkSum == calculatedCheckSum;
} | class class_name[name] begin[{]
method[checkFrVatId, return_type[type[boolean]], modifier[private], parameter[pvatId]] begin[{]
local_variable[type[int], checkSum]
local_variable[type[int], sum]
local_variable[type[int], calculatedCheckSum]
return[binary_operation[member[.checkSum], ==, member[.calculatedCheckSum]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[checkFrVatId] operator[SEP] Keyword[final] identifier[String] identifier[pvatId] operator[SEP] {
Keyword[final] Keyword[int] identifier[checkSum] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[pvatId] operator[SEP] identifier[substring] operator[SEP] Other[2] , Other[4] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[sum] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[pvatId] operator[SEP] identifier[substring] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[calculatedCheckSum] operator[=] operator[SEP] Other[12] operator[+] Other[3] operator[*] operator[SEP] identifier[sum] operator[%] identifier[MODULO_97] operator[SEP] operator[SEP] operator[%] identifier[MODULO_97] operator[SEP] Keyword[return] identifier[checkSum] operator[==] identifier[calculatedCheckSum] operator[SEP]
}
|
@Override
public RequestBody convert(T value) throws IOException {
Buffer buffer = new Buffer();
try {
binderContext.serialize(value, buffer.outputStream());
return RequestBody.create(MEDIA_TYPE, buffer.readByteString());
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
buffer.close();
}
} | class class_name[name] begin[{]
method[convert, return_type[type[RequestBody]], modifier[public], parameter[value]] begin[{]
local_variable[type[Buffer], buffer]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=outputStream, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None)], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=binderContext, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=MEDIA_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=readByteString, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None)], member=create, postfix_operators=[], prefix_operators=[], qualifier=RequestBody, 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), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[RequestBody] identifier[convert] operator[SEP] identifier[T] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Buffer] identifier[buffer] operator[=] Keyword[new] identifier[Buffer] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[binderContext] operator[SEP] identifier[serialize] operator[SEP] identifier[value] , identifier[buffer] operator[SEP] identifier[outputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[RequestBody] operator[SEP] identifier[create] operator[SEP] identifier[MEDIA_TYPE] , identifier[buffer] operator[SEP] identifier[readByteString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[finally] {
identifier[buffer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static dnspolicylabel_stats get(nitro_service service, String labelname) throws Exception{
dnspolicylabel_stats obj = new dnspolicylabel_stats();
obj.set_labelname(labelname);
dnspolicylabel_stats response = (dnspolicylabel_stats) obj.stat_resource(service);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[dnspolicylabel_stats]], modifier[public static], parameter[service, labelname]] begin[{]
local_variable[type[dnspolicylabel_stats], obj]
call[obj.set_labelname, parameter[member[.labelname]]]
local_variable[type[dnspolicylabel_stats], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[dnspolicylabel_stats] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[labelname] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[dnspolicylabel_stats] identifier[obj] operator[=] Keyword[new] identifier[dnspolicylabel_stats] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_labelname] operator[SEP] identifier[labelname] operator[SEP] operator[SEP] identifier[dnspolicylabel_stats] identifier[response] operator[=] operator[SEP] identifier[dnspolicylabel_stats] operator[SEP] identifier[obj] operator[SEP] identifier[stat_resource] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
public static String repeat(String string, int count) {
requireNonNull(string);
if (count <= 1) {
if (count < 0) {
throw new IllegalArgumentException("invalid count: " + count);
}
return (count == 0) ? "" : string;
}
// IF YOU MODIFY THE CODE HERE, you must update StringsRepeatBenchmark
final int len = string.length();
final long longSize = (long) len * (long) count;
final int size = (int) longSize;
if (size != longSize) {
throw new ArrayIndexOutOfBoundsException("Required array size too large: " + longSize);
}
final char[] array = new char[size];
string.getChars(0, len, array, 0);
int n;
for (n = len; n < size - n; n <<= 1) {
System.arraycopy(array, 0, array, n, n);
}
System.arraycopy(array, 0, array, n, size - n);
return new String(array);
} | class class_name[name] begin[{]
method[repeat, return_type[type[String]], modifier[public static], parameter[string, count]] begin[{]
call[.requireNonNull, parameter[member[.string]]]
if[binary_operation[member[.count], <=, literal[1]]] begin[{]
if[binary_operation[member[.count], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid count: "), operandr=MemberReference(member=count, 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=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MemberReference(member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))]
else begin[{]
None
end[}]
local_variable[type[int], len]
local_variable[type[long], longSize]
local_variable[type[int], size]
if[binary_operation[member[.size], !=, member[.longSize]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Required array size too large: "), operandr=MemberReference(member=longSize, 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=ArrayIndexOutOfBoundsException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[char], array]
call[string.getChars, parameter[literal[0], member[.len], member[.array], literal[0]]]
local_variable[type[int], n]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=<), init=[Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=<<=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), label=None)
call[System.arraycopy, parameter[member[.array], literal[0], member[.array], member[.n], binary_operation[member[.size], -, member[.n]]]]
return[ClassCreator(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[repeat] operator[SEP] identifier[String] identifier[string] , Keyword[int] identifier[count] operator[SEP] {
identifier[requireNonNull] operator[SEP] identifier[string] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[<=] Other[1] operator[SEP] {
Keyword[if] operator[SEP] identifier[count] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[count] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[count] operator[==] Other[0] operator[SEP] operator[?] literal[String] operator[:] identifier[string] operator[SEP]
}
Keyword[final] Keyword[int] identifier[len] operator[=] identifier[string] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[longSize] operator[=] operator[SEP] Keyword[long] operator[SEP] identifier[len] operator[*] operator[SEP] Keyword[long] operator[SEP] identifier[count] operator[SEP] Keyword[final] Keyword[int] identifier[size] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[longSize] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[!=] identifier[longSize] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ArrayIndexOutOfBoundsException] operator[SEP] literal[String] operator[+] identifier[longSize] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[string] operator[SEP] identifier[getChars] operator[SEP] Other[0] , identifier[len] , identifier[array] , Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[SEP] Keyword[for] operator[SEP] identifier[n] operator[=] identifier[len] operator[SEP] identifier[n] operator[<] identifier[size] operator[-] identifier[n] operator[SEP] identifier[n] operator[<<=] Other[1] operator[SEP] {
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[array] , Other[0] , identifier[array] , identifier[n] , identifier[n] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[array] , Other[0] , identifier[array] , identifier[n] , identifier[size] operator[-] identifier[n] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[array] operator[SEP] operator[SEP]
}
|
public EpisodeOfCareCareTeamComponent addCareTeam() { //3
EpisodeOfCareCareTeamComponent t = new EpisodeOfCareCareTeamComponent();
if (this.careTeam == null)
this.careTeam = new ArrayList<EpisodeOfCareCareTeamComponent>();
this.careTeam.add(t);
return t;
} | class class_name[name] begin[{]
method[addCareTeam, return_type[type[EpisodeOfCareCareTeamComponent]], modifier[public], parameter[]] begin[{]
local_variable[type[EpisodeOfCareCareTeamComponent], t]
if[binary_operation[THIS[member[None.careTeam]], ==, literal[null]]] begin[{]
assign[THIS[member[None.careTeam]], 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=EpisodeOfCareCareTeamComponent, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
THIS[member[None.careTeam]call[None.add, parameter[member[.t]]]]
return[member[.t]]
end[}]
END[}] | Keyword[public] identifier[EpisodeOfCareCareTeamComponent] identifier[addCareTeam] operator[SEP] operator[SEP] {
identifier[EpisodeOfCareCareTeamComponent] identifier[t] operator[=] Keyword[new] identifier[EpisodeOfCareCareTeamComponent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[careTeam] operator[==] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[careTeam] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[EpisodeOfCareCareTeamComponent] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[careTeam] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP]
}
|
private void genPreambleStaticInitializers() throws JasperException {
out.printil("private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();");
out.println();
// Static data for getDependants()
out.printil("private static java.util.List<String> _jspx_dependants;");
out.println();
List<String> dependants = pageInfo.getDependants();
Iterator<String> iter = dependants.iterator();
if (!dependants.isEmpty()) {
out.printil("static {");
out.pushIndent();
out.printin("_jspx_dependants = new java.util.ArrayList<String>(");
out.print("" + dependants.size());
out.println(");");
while (iter.hasNext()) {
out.printin("_jspx_dependants.add(\"");
out.print(iter.next());
out.println("\");");
}
out.popIndent();
out.printil("}");
out.println();
}
// Codes to support genStringAsByteArray option
// Generate a static variable for the initial response encoding
if (genBytes) {
// first get the respons encoding
String contentType = pageInfo.getContentType();
String encoding = "ISO-8859-1";
int i = contentType.indexOf("charset=");
if (i > 0)
encoding = contentType.substring(i+8);
// Make sure the encoding is supported
// Assume that this can be determined at compile time
try {
"testing".getBytes(encoding);
out.printin("private static final String _jspx_encoding = ");
out.print(quote(encoding));
out.println(";");
out.printil("private boolean _jspx_gen_bytes = true;");
out.printil("private boolean _jspx_encoding_tested;");
} catch (java.io.UnsupportedEncodingException ex) {
genBytes = false;
}
}
} | class class_name[name] begin[{]
method[genPreambleStaticInitializers, return_type[void], modifier[private], parameter[]] begin[{]
call[out.printil, parameter[literal["private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();"]]]
call[out.println, parameter[]]
call[out.printil, parameter[literal["private static java.util.List<String> _jspx_dependants;"]]]
call[out.println, parameter[]]
local_variable[type[List], dependants]
local_variable[type[Iterator], iter]
if[call[dependants.isEmpty, parameter[]]] begin[{]
call[out.printil, parameter[literal["static {"]]]
call[out.pushIndent, parameter[]]
call[out.printin, parameter[literal["_jspx_dependants = new java.util.ArrayList<String>("]]]
call[out.print, parameter[binary_operation[literal[""], +, call[dependants.size, parameter[]]]]]
call[out.println, parameter[literal[");"]]]
while[call[iter.hasNext, parameter[]]] begin[{]
call[out.printin, parameter[literal["_jspx_dependants.add(\""]]]
call[out.print, parameter[call[iter.next, parameter[]]]]
call[out.println, parameter[literal["\");"]]]
end[}]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["}"]]]
call[out.println, parameter[]]
else begin[{]
None
end[}]
if[member[.genBytes]] begin[{]
local_variable[type[String], contentType]
local_variable[type[String], encoding]
local_variable[type[int], i]
if[binary_operation[member[.i], >, literal[0]]] begin[{]
assign[member[.encoding], call[contentType.substring, parameter[binary_operation[member[.i], +, literal[8]]]]]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="testing"), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="private static final String _jspx_encoding = ")], member=printin, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=quote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";")], member=println, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="private boolean _jspx_gen_bytes = true;")], member=printil, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="private boolean _jspx_encoding_tested;")], member=printil, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=genBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['java.io.UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[genPreambleStaticInitializers] operator[SEP] operator[SEP] Keyword[throws] identifier[JasperException] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[dependants] operator[=] identifier[pageInfo] operator[SEP] identifier[getDependants] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[iter] operator[=] identifier[dependants] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[dependants] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[pushIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printin] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[dependants] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[out] operator[SEP] identifier[printin] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[genBytes] operator[SEP] {
identifier[String] identifier[contentType] operator[=] identifier[pageInfo] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[encoding] operator[=] literal[String] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[contentType] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] identifier[encoding] operator[=] identifier[contentType] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[+] Other[8] operator[SEP] operator[SEP] Keyword[try] {
literal[String] operator[SEP] identifier[getBytes] operator[SEP] identifier[encoding] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printin] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[quote] operator[SEP] identifier[encoding] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[UnsupportedEncodingException] identifier[ex] operator[SEP] {
identifier[genBytes] operator[=] literal[boolean] operator[SEP]
}
}
}
|
public InvokeCallback sendRpcToDefault(String service, String method, Object... args) {
return sendRpcWithEndpoint("my-rtmps", service, method, args);
} | class class_name[name] begin[{]
method[sendRpcToDefault, return_type[type[InvokeCallback]], modifier[public], parameter[service, method, args]] begin[{]
return[call[.sendRpcWithEndpoint, parameter[literal["my-rtmps"], member[.service], member[.method], member[.args]]]]
end[}]
END[}] | Keyword[public] identifier[InvokeCallback] identifier[sendRpcToDefault] operator[SEP] identifier[String] identifier[service] , identifier[String] identifier[method] , identifier[Object] operator[...] identifier[args] operator[SEP] {
Keyword[return] identifier[sendRpcWithEndpoint] operator[SEP] literal[String] , identifier[service] , identifier[method] , identifier[args] operator[SEP] operator[SEP]
}
|
public final static <T, R> Stream<R> flatMapStream(final Stream<T> stream, final Function<? super T, ? extends BaseStream<? extends R, ?>> fn) {
return stream.flatMap(fn.andThen(bs -> {
if (bs instanceof Stream)
return (Stream<R>) bs;
else
return Streams.stream(bs.iterator());
}));
} | class class_name[name] begin[{]
method[flatMapStream, return_type[type[Stream]], modifier[final public static], parameter[stream, fn]] begin[{]
return[call[stream.flatMap, parameter[call[fn.andThen, parameter[LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Stream, sub_type=None), operator=instanceof), else_statement=ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=bs, selectors=[], type_arguments=None)], member=stream, postfix_operators=[], prefix_operators=[], qualifier=Streams, selectors=[], type_arguments=None), label=None), label=None, then_statement=ReturnStatement(expression=Cast(expression=MemberReference(member=bs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=[], name=Stream, sub_type=None)), label=None))], parameters=[MemberReference(member=bs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[static] operator[<] identifier[T] , identifier[R] operator[>] identifier[Stream] operator[<] identifier[R] operator[>] identifier[flatMapStream] operator[SEP] Keyword[final] identifier[Stream] operator[<] identifier[T] operator[>] identifier[stream] , Keyword[final] identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[BaseStream] operator[<] operator[?] Keyword[extends] identifier[R] , operator[?] operator[>] operator[>] identifier[fn] operator[SEP] {
Keyword[return] identifier[stream] operator[SEP] identifier[flatMap] operator[SEP] identifier[fn] operator[SEP] identifier[andThen] operator[SEP] identifier[bs] operator[->] {
Keyword[if] operator[SEP] identifier[bs] Keyword[instanceof] identifier[Stream] operator[SEP] Keyword[return] operator[SEP] identifier[Stream] operator[<] identifier[R] operator[>] operator[SEP] identifier[bs] operator[SEP] Keyword[else] Keyword[return] identifier[Streams] operator[SEP] identifier[stream] operator[SEP] identifier[bs] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] operator[SEP]
}
|
@Help(
help =
"Update the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id"
)
public PhysicalNetworkFunctionDescriptor updatePNFD(
final String idNsd,
final String idPnf,
final PhysicalNetworkFunctionDescriptor physicalNetworkFunctionDescriptor)
throws SDKException {
String url = idNsd + "/pnfdescriptors" + "/" + idPnf;
return (PhysicalNetworkFunctionDescriptor) requestPut(url, physicalNetworkFunctionDescriptor);
} | class class_name[name] begin[{]
method[updatePNFD, return_type[type[PhysicalNetworkFunctionDescriptor]], modifier[public], parameter[idNsd, idPnf, physicalNetworkFunctionDescriptor]] begin[{]
local_variable[type[String], url]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=physicalNetworkFunctionDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requestPut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=PhysicalNetworkFunctionDescriptor, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Help] operator[SEP] identifier[help] operator[=] literal[String] operator[SEP] Keyword[public] identifier[PhysicalNetworkFunctionDescriptor] identifier[updatePNFD] operator[SEP] Keyword[final] identifier[String] identifier[idNsd] , Keyword[final] identifier[String] identifier[idPnf] , Keyword[final] identifier[PhysicalNetworkFunctionDescriptor] identifier[physicalNetworkFunctionDescriptor] operator[SEP] Keyword[throws] identifier[SDKException] {
identifier[String] identifier[url] operator[=] identifier[idNsd] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[idPnf] operator[SEP] Keyword[return] operator[SEP] identifier[PhysicalNetworkFunctionDescriptor] operator[SEP] identifier[requestPut] operator[SEP] identifier[url] , identifier[physicalNetworkFunctionDescriptor] operator[SEP] operator[SEP]
}
|
public EClass getIfcApplication() {
if (ifcApplicationEClass == null) {
ifcApplicationEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(21);
}
return ifcApplicationEClass;
} | class class_name[name] begin[{]
method[getIfcApplication, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcApplicationEClass], ==, literal[null]]] begin[{]
assign[member[.ifcApplicationEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=21)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcApplicationEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIfcApplication] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcApplicationEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcApplicationEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[21] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcApplicationEClass] operator[SEP]
}
|
public void marshall(DescribeThingRequest describeThingRequest, ProtocolMarshaller protocolMarshaller) {
if (describeThingRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeThingRequest.getThingName(), THINGNAME_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[describeThingRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.describeThingRequest], ==, 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=getThingName, postfix_operators=[], prefix_operators=[], qualifier=describeThingRequest, selectors=[], type_arguments=None), MemberReference(member=THINGNAME_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[DescribeThingRequest] identifier[describeThingRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[describeThingRequest] 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[describeThingRequest] operator[SEP] identifier[getThingName] operator[SEP] operator[SEP] , identifier[THINGNAME_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]
}
}
|
@BetaApi
public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck) {
GetHttpHealthCheckHttpRequest request =
GetHttpHealthCheckHttpRequest.newBuilder().setHttpHealthCheck(httpHealthCheck).build();
return getHttpHealthCheck(request);
} | class class_name[name] begin[{]
method[getHttpHealthCheck, return_type[type[HttpHealthCheck2]], modifier[final public], parameter[httpHealthCheck]] begin[{]
local_variable[type[GetHttpHealthCheckHttpRequest], request]
return[call[.getHttpHealthCheck, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[HttpHealthCheck2] identifier[getHttpHealthCheck] operator[SEP] identifier[String] identifier[httpHealthCheck] operator[SEP] {
identifier[GetHttpHealthCheckHttpRequest] identifier[request] operator[=] identifier[GetHttpHealthCheckHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setHttpHealthCheck] operator[SEP] identifier[httpHealthCheck] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getHttpHealthCheck] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private void appendInitialEntries() {
final long term = context.getTerm();
// Append a no-op entry to reset session timeouts and commit entries from prior terms.
try (InitializeEntry entry = context.getLog().create(InitializeEntry.class)) {
entry.setTerm(term)
.setTimestamp(appender.time());
Assert.state(context.getLog().append(entry) == appender.index(), "Initialize entry not appended at the start of the leader's term");
LOGGER.trace("{} - Appended {}", context.getCluster().member().address(), entry);
}
// Append a configuration entry to propagate the leader's cluster configuration.
configure(context.getCluster().members());
} | class class_name[name] begin[{]
method[appendInitialEntries, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[long], term]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=term, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTerm, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=time, postfix_operators=[], prefix_operators=[], qualifier=appender, selectors=[], type_arguments=None)], member=setTimestamp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=index, postfix_operators=[], prefix_operators=[], qualifier=appender, selectors=[], type_arguments=None), operator===), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Initialize entry not appended at the start of the leader's term")], member=state, postfix_operators=[], prefix_operators=[], qualifier=Assert, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{} - Appended {}"), MethodInvocation(arguments=[], member=getCluster, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[], member=member, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=address, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=entry, type=ReferenceType(arguments=None, dimensions=[], name=InitializeEntry, sub_type=None), value=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitializeEntry, sub_type=None))], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))])
call[.configure, parameter[call[context.getCluster, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[appendInitialEntries] operator[SEP] operator[SEP] {
Keyword[final] Keyword[long] identifier[term] operator[=] identifier[context] operator[SEP] identifier[getTerm] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[InitializeEntry] identifier[entry] operator[=] identifier[context] operator[SEP] identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[InitializeEntry] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[entry] operator[SEP] identifier[setTerm] operator[SEP] identifier[term] operator[SEP] operator[SEP] identifier[setTimestamp] operator[SEP] identifier[appender] operator[SEP] identifier[time] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[state] operator[SEP] identifier[context] operator[SEP] identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] operator[==] identifier[appender] operator[SEP] identifier[index] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[context] operator[SEP] identifier[getCluster] operator[SEP] operator[SEP] operator[SEP] identifier[member] operator[SEP] operator[SEP] operator[SEP] identifier[address] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] operator[SEP]
}
identifier[configure] operator[SEP] identifier[context] operator[SEP] identifier[getCluster] operator[SEP] operator[SEP] operator[SEP] identifier[members] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static int endsWithOne(final String src, final String... dest) {
for (int i = 0; i < dest.length; i++) {
String m = dest[i];
if (m == null) {
continue;
}
if (src.endsWith(m)) {
return i;
}
}
return -1;
} | class class_name[name] begin[{]
method[endsWithOne, return_type[type[int]], modifier[public static], parameter[src, dest]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dest, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[1]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[endsWithOne] operator[SEP] Keyword[final] identifier[String] identifier[src] , Keyword[final] identifier[String] operator[...] identifier[dest] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dest] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[m] operator[=] identifier[dest] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[src] operator[SEP] identifier[endsWith] operator[SEP] identifier[m] operator[SEP] operator[SEP] {
Keyword[return] identifier[i] operator[SEP]
}
}
Keyword[return] operator[-] Other[1] operator[SEP]
}
|
public static void call(Class<? extends Unit> unitClass, Handler<UnitResponse> handler) {
call(unitClass, new HashMap<>(), handler);
} | class class_name[name] begin[{]
method[call, return_type[void], modifier[public static], parameter[unitClass, handler]] begin[{]
call[.call, parameter[member[.unitClass], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), member[.handler]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[call] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Unit] operator[>] identifier[unitClass] , identifier[Handler] operator[<] identifier[UnitResponse] operator[>] identifier[handler] operator[SEP] {
identifier[call] operator[SEP] identifier[unitClass] , Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] , identifier[handler] operator[SEP] operator[SEP]
}
|
public GetSecurityPolicyResponse getSecurityPolicy(GetSecurityPolicyRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getName(),
"The parameter name should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_SECURITY_POLICY,
request.getName());
return invokeHttpClient(internalRequest, GetSecurityPolicyResponse.class);
} | class class_name[name] begin[{]
method[getSecurityPolicy, return_type[type[GetSecurityPolicyResponse]], modifier[public], parameter[request]] begin[{]
call[.checkNotNull, parameter[member[.request], literal["The parameter request should NOT be null."]]]
call[.checkStringNotEmpty, parameter[call[request.getName, parameter[]], literal["The parameter name should NOT be null or empty string."]]]
local_variable[type[InternalRequest], internalRequest]
return[call[.invokeHttpClient, parameter[member[.internalRequest], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetSecurityPolicyResponse, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[GetSecurityPolicyResponse] identifier[getSecurityPolicy] operator[SEP] identifier[GetSecurityPolicyRequest] identifier[request] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[request] , literal[String] operator[SEP] operator[SEP] identifier[checkStringNotEmpty] operator[SEP] identifier[request] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[InternalRequest] identifier[internalRequest] operator[=] identifier[createRequest] operator[SEP] identifier[HttpMethodName] operator[SEP] identifier[GET] , identifier[request] , identifier[LIVE_SECURITY_POLICY] , identifier[request] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[invokeHttpClient] operator[SEP] identifier[internalRequest] , identifier[GetSecurityPolicyResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
protected String naryOperator(final NAryOperator operator, final String opString) {
final StringBuilder sb = new StringBuilder();
int count = 0;
final int size = operator.numberOfOperands();
Formula last = null;
for (final Formula op : operator) {
if (++count == size) {
last = op;
} else {
sb.append(operator.type().precedence() < op.type().precedence() ? this.toString(op) : this.bracket(op));
sb.append(opString);
}
}
if (last != null) {
sb.append(operator.type().precedence() < last.type().precedence() ? this.toString(last) : this.bracket(last));
}
return sb.toString();
} | class class_name[name] begin[{]
method[naryOperator, return_type[type[String]], modifier[protected], parameter[operator, opString]] begin[{]
local_variable[type[StringBuilder], sb]
local_variable[type[int], count]
local_variable[type[int], size]
local_variable[type[Formula], last]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=operator, selectors=[MethodInvocation(arguments=[], member=precedence, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[MethodInvocation(arguments=[], member=precedence, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), if_false=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bracket, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=opString, 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=Assignment(expressionl=MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=operator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=op)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Formula, sub_type=None))), label=None)
if[binary_operation[member[.last], !=, literal[null]]] begin[{]
call[sb.append, parameter[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=operator, selectors=[MethodInvocation(arguments=[], member=precedence, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=last, selectors=[MethodInvocation(arguments=[], member=precedence, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), if_false=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bracket, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))]]
else begin[{]
None
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[naryOperator] operator[SEP] Keyword[final] identifier[NAryOperator] identifier[operator] , Keyword[final] identifier[String] identifier[opString] operator[SEP] {
Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[final] Keyword[int] identifier[size] operator[=] identifier[operator] operator[SEP] identifier[numberOfOperands] operator[SEP] operator[SEP] operator[SEP] identifier[Formula] identifier[last] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Formula] identifier[op] operator[:] identifier[operator] operator[SEP] {
Keyword[if] operator[SEP] operator[++] identifier[count] operator[==] identifier[size] operator[SEP] {
identifier[last] operator[=] identifier[op] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[operator] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[precedence] operator[SEP] operator[SEP] operator[<] identifier[op] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[precedence] operator[SEP] operator[SEP] operator[?] Keyword[this] operator[SEP] identifier[toString] operator[SEP] identifier[op] operator[SEP] operator[:] Keyword[this] operator[SEP] identifier[bracket] operator[SEP] identifier[op] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[opString] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[last] operator[!=] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[operator] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[precedence] operator[SEP] operator[SEP] operator[<] identifier[last] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[precedence] operator[SEP] operator[SEP] operator[?] Keyword[this] operator[SEP] identifier[toString] operator[SEP] identifier[last] operator[SEP] operator[:] Keyword[this] operator[SEP] identifier[bracket] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public EEnum getIfcStateEnum() {
if (ifcStateEnumEEnum == null) {
ifcStateEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(1072);
}
return ifcStateEnumEEnum;
} | class class_name[name] begin[{]
method[getIfcStateEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcStateEnumEEnum], ==, literal[null]]] begin[{]
assign[member[.ifcStateEnumEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1072)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcStateEnumEEnum]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcStateEnum] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcStateEnumEEnum] operator[==] Other[null] operator[SEP] {
identifier[ifcStateEnumEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1072] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcStateEnumEEnum] operator[SEP]
}
|
private void processPartitionWatchEvent() throws KeeperException, InterruptedException {
try {
m_zk.create(m_rootNode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
m_zk.getData(m_rootNode, m_childWatch, null);
} catch (KeeperException.NodeExistsException e) {
m_zk.getData(m_rootNode, m_childWatch, null);
}
} | class class_name[name] begin[{]
method[processPartitionWatchEvent, return_type[void], modifier[private], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_rootNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=OPEN_ACL_UNSAFE, postfix_operators=[], prefix_operators=[], qualifier=Ids, selectors=[]), MemberReference(member=PERSISTENT, postfix_operators=[], prefix_operators=[], qualifier=CreateMode, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=m_zk, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_rootNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_childWatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getData, postfix_operators=[], prefix_operators=[], qualifier=m_zk, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_rootNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_childWatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getData, postfix_operators=[], prefix_operators=[], qualifier=m_zk, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeeperException.NodeExistsException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[processPartitionWatchEvent] operator[SEP] operator[SEP] Keyword[throws] identifier[KeeperException] , identifier[InterruptedException] {
Keyword[try] {
identifier[m_zk] operator[SEP] identifier[create] operator[SEP] identifier[m_rootNode] , Other[null] , identifier[Ids] operator[SEP] identifier[OPEN_ACL_UNSAFE] , identifier[CreateMode] operator[SEP] identifier[PERSISTENT] operator[SEP] operator[SEP] identifier[m_zk] operator[SEP] identifier[getData] operator[SEP] identifier[m_rootNode] , identifier[m_childWatch] , Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[KeeperException] operator[SEP] identifier[NodeExistsException] identifier[e] operator[SEP] {
identifier[m_zk] operator[SEP] identifier[getData] operator[SEP] identifier[m_rootNode] , identifier[m_childWatch] , Other[null] operator[SEP] operator[SEP]
}
}
|
private CompositeExpression parseTildeRange() {
consumeNextToken(TILDE);
int major = intOf(consumeNextToken(NUMERIC).lexeme);
if (!tokens.positiveLookahead(DOT)) {
return gte(versionFor(major)).and(lt(versionFor(major + 1)));
}
consumeNextToken(DOT);
int minor = intOf(consumeNextToken(NUMERIC).lexeme);
if (!tokens.positiveLookahead(DOT)) {
return gte(versionFor(major, minor)).and(lt(versionFor(major, minor + 1)));
}
consumeNextToken(DOT);
int patch = intOf(consumeNextToken(NUMERIC).lexeme);
return gte(versionFor(major, minor, patch)).and(lt(versionFor(major, minor + 1)));
} | class class_name[name] begin[{]
method[parseTildeRange, return_type[type[CompositeExpression]], modifier[private], parameter[]] begin[{]
call[.consumeNextToken, parameter[member[.TILDE]]]
local_variable[type[int], major]
if[call[tokens.positiveLookahead, parameter[member[.DOT]]]] begin[{]
return[call[.gte, parameter[call[.versionFor, parameter[member[.major]]]]]]
else begin[{]
None
end[}]
call[.consumeNextToken, parameter[member[.DOT]]]
local_variable[type[int], minor]
if[call[tokens.positiveLookahead, parameter[member[.DOT]]]] begin[{]
return[call[.gte, parameter[call[.versionFor, parameter[member[.major], member[.minor]]]]]]
else begin[{]
None
end[}]
call[.consumeNextToken, parameter[member[.DOT]]]
local_variable[type[int], patch]
return[call[.gte, parameter[call[.versionFor, parameter[member[.major], member[.minor], member[.patch]]]]]]
end[}]
END[}] | Keyword[private] identifier[CompositeExpression] identifier[parseTildeRange] operator[SEP] operator[SEP] {
identifier[consumeNextToken] operator[SEP] identifier[TILDE] operator[SEP] operator[SEP] Keyword[int] identifier[major] operator[=] identifier[intOf] operator[SEP] identifier[consumeNextToken] operator[SEP] identifier[NUMERIC] operator[SEP] operator[SEP] identifier[lexeme] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[tokens] operator[SEP] identifier[positiveLookahead] operator[SEP] identifier[DOT] operator[SEP] operator[SEP] {
Keyword[return] identifier[gte] operator[SEP] identifier[versionFor] operator[SEP] identifier[major] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[lt] operator[SEP] identifier[versionFor] operator[SEP] identifier[major] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[consumeNextToken] operator[SEP] identifier[DOT] operator[SEP] operator[SEP] Keyword[int] identifier[minor] operator[=] identifier[intOf] operator[SEP] identifier[consumeNextToken] operator[SEP] identifier[NUMERIC] operator[SEP] operator[SEP] identifier[lexeme] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[tokens] operator[SEP] identifier[positiveLookahead] operator[SEP] identifier[DOT] operator[SEP] operator[SEP] {
Keyword[return] identifier[gte] operator[SEP] identifier[versionFor] operator[SEP] identifier[major] , identifier[minor] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[lt] operator[SEP] identifier[versionFor] operator[SEP] identifier[major] , identifier[minor] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[consumeNextToken] operator[SEP] identifier[DOT] operator[SEP] operator[SEP] Keyword[int] identifier[patch] operator[=] identifier[intOf] operator[SEP] identifier[consumeNextToken] operator[SEP] identifier[NUMERIC] operator[SEP] operator[SEP] identifier[lexeme] operator[SEP] operator[SEP] Keyword[return] identifier[gte] operator[SEP] identifier[versionFor] operator[SEP] identifier[major] , identifier[minor] , identifier[patch] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[lt] operator[SEP] identifier[versionFor] operator[SEP] identifier[major] , identifier[minor] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Attachment updateWithUploadDetails(UploadContentResponse response) {
this.id = response.getId();
this.url = response.getUrl();
this.size = response.getSize();
this.type = response.getType();
return this;
} | class class_name[name] begin[{]
method[updateWithUploadDetails, return_type[type[Attachment]], modifier[public], parameter[response]] begin[{]
assign[THIS[member[None.id]], call[response.getId, parameter[]]]
assign[THIS[member[None.url]], call[response.getUrl, parameter[]]]
assign[THIS[member[None.size]], call[response.getSize, parameter[]]]
assign[THIS[member[None.type]], call[response.getType, parameter[]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Attachment] identifier[updateWithUploadDetails] operator[SEP] identifier[UploadContentResponse] identifier[response] operator[SEP] {
Keyword[this] operator[SEP] identifier[id] operator[=] identifier[response] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[url] operator[=] identifier[response] operator[SEP] identifier[getUrl] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[size] operator[=] identifier[response] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[=] identifier[response] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public Transaction createWithPreauthorization( String preauthorizationId, Integer amount, String currency, String description ) {
ValidationUtils.validatesId( preauthorizationId );
ValidationUtils.validatesAmount( amount );
ValidationUtils.validatesCurrency( currency );
ParameterMap<String, String> params = new ParameterMap<String, String>();
params.add( "preauthorization", preauthorizationId );
params.add( "amount", String.valueOf( amount ) );
params.add( "currency", currency );
params.add( "source", String.format( "%s-%s", PaymillContext.getProjectName(), PaymillContext.getProjectVersion() ) );
if( StringUtils.isNotBlank( description ) )
params.add( "description", description );
return RestfulUtils.create( TransactionService.PATH, params, Transaction.class, super.httpClient );
} | class class_name[name] begin[{]
method[createWithPreauthorization, return_type[type[Transaction]], modifier[public], parameter[preauthorizationId, amount, currency, description]] begin[{]
call[ValidationUtils.validatesId, parameter[member[.preauthorizationId]]]
call[ValidationUtils.validatesAmount, parameter[member[.amount]]]
call[ValidationUtils.validatesCurrency, parameter[member[.currency]]]
local_variable[type[ParameterMap], params]
call[params.add, parameter[literal["preauthorization"], member[.preauthorizationId]]]
call[params.add, parameter[literal["amount"], call[String.valueOf, parameter[member[.amount]]]]]
call[params.add, parameter[literal["currency"], member[.currency]]]
call[params.add, parameter[literal["source"], call[String.format, parameter[literal["%s-%s"], call[PaymillContext.getProjectName, parameter[]], call[PaymillContext.getProjectVersion, parameter[]]]]]]
if[call[StringUtils.isNotBlank, parameter[member[.description]]]] begin[{]
call[params.add, parameter[literal["description"], member[.description]]]
else begin[{]
None
end[}]
return[call[RestfulUtils.create, parameter[member[TransactionService.PATH], member[.params], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Transaction, sub_type=None)), SuperMemberReference(member=httpClient, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]]]
end[}]
END[}] | Keyword[public] identifier[Transaction] identifier[createWithPreauthorization] operator[SEP] identifier[String] identifier[preauthorizationId] , identifier[Integer] identifier[amount] , identifier[String] identifier[currency] , identifier[String] identifier[description] operator[SEP] {
identifier[ValidationUtils] operator[SEP] identifier[validatesId] operator[SEP] identifier[preauthorizationId] operator[SEP] operator[SEP] identifier[ValidationUtils] operator[SEP] identifier[validatesAmount] operator[SEP] identifier[amount] operator[SEP] operator[SEP] identifier[ValidationUtils] operator[SEP] identifier[validatesCurrency] operator[SEP] identifier[currency] operator[SEP] operator[SEP] identifier[ParameterMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] Keyword[new] identifier[ParameterMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[preauthorizationId] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[amount] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[currency] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[PaymillContext] operator[SEP] identifier[getProjectName] operator[SEP] operator[SEP] , identifier[PaymillContext] operator[SEP] identifier[getProjectVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[description] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[description] operator[SEP] operator[SEP] Keyword[return] identifier[RestfulUtils] operator[SEP] identifier[create] operator[SEP] identifier[TransactionService] operator[SEP] identifier[PATH] , identifier[params] , identifier[Transaction] operator[SEP] Keyword[class] , Keyword[super] operator[SEP] identifier[httpClient] operator[SEP] operator[SEP]
}
|
public final long getUlong48(final int pos) {
final int position = origin + pos;
if (pos + 5 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
+ (pos < 0 ? pos : (pos + 5)));
byte[] buf = buffer;
return ((long) (0xff & buf[position])) | ((long) (0xff & buf[position + 1]) << 8)
| ((long) (0xff & buf[position + 2]) << 16) | ((long) (0xff & buf[position + 3]) << 24)
| ((long) (0xff & buf[position + 4]) << 32) | ((long) (0xff & buf[position + 5]) << 40);
} | class class_name[name] begin[{]
method[getUlong48, return_type[type[long]], modifier[final public], parameter[pos]] begin[{]
local_variable[type[int], position]
if[binary_operation[binary_operation[binary_operation[member[.pos], +, literal[5]], >=, member[.limit]], ||, binary_operation[member[.pos], <, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="limit excceed: "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=+), if_true=MemberReference(member=pos, 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=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[byte], buf]
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=&), type=BasicType(dimensions=[], name=long)), |, binary_operation[Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operator=&), type=BasicType(dimensions=[], name=long)), <<, literal[8]]], |, binary_operation[Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))]), operator=&), type=BasicType(dimensions=[], name=long)), <<, literal[16]]], |, binary_operation[Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+))]), operator=&), type=BasicType(dimensions=[], name=long)), <<, literal[24]]], |, binary_operation[Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=+))]), operator=&), type=BasicType(dimensions=[], name=long)), <<, literal[32]]], |, binary_operation[Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=+))]), operator=&), type=BasicType(dimensions=[], name=long)), <<, literal[40]]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[long] identifier[getUlong48] operator[SEP] Keyword[final] Keyword[int] identifier[pos] operator[SEP] {
Keyword[final] Keyword[int] identifier[position] operator[=] identifier[origin] operator[+] identifier[pos] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[+] Other[5] operator[>=] identifier[limit] operator[||] identifier[pos] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[pos] operator[<] Other[0] operator[?] identifier[pos] operator[:] operator[SEP] identifier[pos] operator[+] Other[5] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] identifier[buffer] operator[SEP] Keyword[return] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] operator[|] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[1] operator[SEP] operator[SEP] operator[<<] Other[8] operator[SEP] operator[|] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[2] operator[SEP] operator[SEP] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[3] operator[SEP] operator[SEP] operator[<<] Other[24] operator[SEP] operator[|] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[4] operator[SEP] operator[SEP] operator[<<] Other[32] operator[SEP] operator[|] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[5] operator[SEP] operator[SEP] operator[<<] Other[40] operator[SEP] operator[SEP]
}
|
public static Function<Object,Byte> attrOfByte(final String attributeName) {
return new Get<Object,Byte>(Types.BYTE, attributeName);
} | class class_name[name] begin[{]
method[attrOfByte, return_type[type[Function]], modifier[public static], parameter[attributeName]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=BYTE, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=attributeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Byte, sub_type=None))], dimensions=None, name=Get, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Function] operator[<] identifier[Object] , identifier[Byte] operator[>] identifier[attrOfByte] operator[SEP] Keyword[final] identifier[String] identifier[attributeName] operator[SEP] {
Keyword[return] Keyword[new] identifier[Get] operator[<] identifier[Object] , identifier[Byte] operator[>] operator[SEP] identifier[Types] operator[SEP] identifier[BYTE] , identifier[attributeName] operator[SEP] operator[SEP]
}
|
public java.util.List<QueryInfo> getQueries() {
if (queries == null) {
queries = new com.amazonaws.internal.SdkInternalList<QueryInfo>();
}
return queries;
} | class class_name[name] begin[{]
method[getQueries, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.queries], ==, literal[null]]] begin[{]
assign[member[.queries], 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=QueryInfo, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.queries]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[QueryInfo] operator[>] identifier[getQueries] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[queries] operator[==] Other[null] operator[SEP] {
identifier[queries] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[QueryInfo] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[queries] operator[SEP]
}
|
private <T> void authenticateExecuteAndProcessResults(Supplier<String> authenticator, Function<String, CompletableFuture<T>> call,
final StreamObserver<T> streamObserver, RequestTag requestTag) {
try {
String delegationToken;
delegationToken = authenticator.get();
CompletableFuture<T> result = call.apply(delegationToken);
result.whenComplete(
(value, ex) -> {
log.debug("result = {}", value);
logAndUntrackRequestTag(requestTag);
if (ex != null) {
Throwable cause = Exceptions.unwrap(ex);
log.error("Controller api failed with error: ", ex);
String errorDescription = replyWithStackTraceOnError ? "controllerStackTrace=" + Throwables.getStackTraceAsString(ex) : cause.getMessage();
streamObserver.onError(Status.INTERNAL
.withCause(cause)
.withDescription(errorDescription)
.asRuntimeException());
} else if (value != null) {
streamObserver.onNext(value);
streamObserver.onCompleted();
}
});
} catch (Exception e) {
log.error("Controller api failed with authenticator error");
logAndUntrackRequestTag(requestTag);
streamObserver.onError(Status.UNAUTHENTICATED
.withDescription("Authentication failed")
.asRuntimeException());
}
} | class class_name[name] begin[{]
method[authenticateExecuteAndProcessResults, return_type[void], modifier[private], parameter[authenticator, call, streamObserver, requestTag]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=delegationToken)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=delegationToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=authenticator, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=delegationToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=CompletableFuture, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="result = {}"), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=requestTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logAndUntrackRequestTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onNext, postfix_operators=[], prefix_operators=[], qualifier=streamObserver, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=onCompleted, postfix_operators=[], prefix_operators=[], qualifier=streamObserver, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unwrap, postfix_operators=[], prefix_operators=[], qualifier=Exceptions, selectors=[], type_arguments=None), name=cause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Controller api failed with error: "), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MemberReference(member=replyWithStackTraceOnError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=cause, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="controllerStackTrace="), operandr=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTraceAsString, postfix_operators=[], prefix_operators=[], qualifier=Throwables, selectors=[], type_arguments=None), operator=+)), name=errorDescription)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withCause, postfix_operators=[], prefix_operators=[], qualifier=Status.INTERNAL, selectors=[MethodInvocation(arguments=[MemberReference(member=errorDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withDescription, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=asRuntimeException, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=onError, postfix_operators=[], prefix_operators=[], qualifier=streamObserver, selectors=[], type_arguments=None), label=None)]))], parameters=[InferredFormalParameter(name=value), InferredFormalParameter(name=ex)])], member=whenComplete, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Controller api failed with authenticator error")], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=requestTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logAndUntrackRequestTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Authentication failed")], member=withDescription, postfix_operators=[], prefix_operators=[], qualifier=Status.UNAUTHENTICATED, selectors=[MethodInvocation(arguments=[], member=asRuntimeException, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=onError, postfix_operators=[], prefix_operators=[], qualifier=streamObserver, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] operator[<] identifier[T] operator[>] Keyword[void] identifier[authenticateExecuteAndProcessResults] operator[SEP] identifier[Supplier] operator[<] identifier[String] operator[>] identifier[authenticator] , identifier[Function] operator[<] identifier[String] , identifier[CompletableFuture] operator[<] identifier[T] operator[>] operator[>] identifier[call] , Keyword[final] identifier[StreamObserver] operator[<] identifier[T] operator[>] identifier[streamObserver] , identifier[RequestTag] identifier[requestTag] operator[SEP] {
Keyword[try] {
identifier[String] identifier[delegationToken] operator[SEP] identifier[delegationToken] operator[=] identifier[authenticator] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[CompletableFuture] operator[<] identifier[T] operator[>] identifier[result] operator[=] identifier[call] operator[SEP] identifier[apply] operator[SEP] identifier[delegationToken] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[whenComplete] operator[SEP] operator[SEP] identifier[value] , identifier[ex] operator[SEP] operator[->] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[value] operator[SEP] operator[SEP] identifier[logAndUntrackRequestTag] operator[SEP] identifier[requestTag] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ex] operator[!=] Other[null] operator[SEP] {
identifier[Throwable] identifier[cause] operator[=] identifier[Exceptions] operator[SEP] identifier[unwrap] operator[SEP] identifier[ex] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] identifier[String] identifier[errorDescription] operator[=] identifier[replyWithStackTraceOnError] operator[?] literal[String] operator[+] identifier[Throwables] operator[SEP] identifier[getStackTraceAsString] operator[SEP] identifier[ex] operator[SEP] operator[:] identifier[cause] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] identifier[streamObserver] operator[SEP] identifier[onError] operator[SEP] identifier[Status] operator[SEP] identifier[INTERNAL] operator[SEP] identifier[withCause] operator[SEP] identifier[cause] operator[SEP] operator[SEP] identifier[withDescription] operator[SEP] identifier[errorDescription] operator[SEP] operator[SEP] identifier[asRuntimeException] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[streamObserver] operator[SEP] identifier[onNext] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[streamObserver] operator[SEP] identifier[onCompleted] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[logAndUntrackRequestTag] operator[SEP] identifier[requestTag] operator[SEP] operator[SEP] identifier[streamObserver] operator[SEP] identifier[onError] operator[SEP] identifier[Status] operator[SEP] identifier[UNAUTHENTICATED] operator[SEP] identifier[withDescription] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asRuntimeException] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static void stopManagingThread() {
try {
if (!isManagingThread()) {
//Start managing the thread only to send the warning
startManagingThread();
logger.warn("Thread not yet managed by Sentry");
}
} finally {
if (SENTRY_THREAD.get().decrementAndGet() == 0) {
// Remove the ThreadLocal so we don't log leak warnings on Tomcat.
// The next get/incr (if any) will re-initialize it to 0.
SENTRY_THREAD.remove();
}
}
} | class class_name[name] begin[{]
method[stopManagingThread, return_type[void], modifier[public static], parameter[]] begin[{]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isManagingThread, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=startManagingThread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Thread not yet managed by Sentry")], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=SENTRY_THREAD, selectors=[MethodInvocation(arguments=[], member=decrementAndGet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=SENTRY_THREAD, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[stopManagingThread] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] operator[!] identifier[isManagingThread] operator[SEP] operator[SEP] operator[SEP] {
identifier[startManagingThread] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[SENTRY_THREAD] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[SENTRY_THREAD] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static <B> Set<List<B>> cartesianProduct(List<? extends Set<? extends B>> sets) {
return CartesianSet.create(sets);
} | class class_name[name] begin[{]
method[cartesianProduct, return_type[type[Set]], modifier[public static], parameter[sets]] begin[{]
return[call[CartesianSet.create, parameter[member[.sets]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[B] operator[>] identifier[Set] operator[<] identifier[List] operator[<] identifier[B] operator[>] operator[>] identifier[cartesianProduct] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[Set] operator[<] operator[?] Keyword[extends] identifier[B] operator[>] operator[>] identifier[sets] operator[SEP] {
Keyword[return] identifier[CartesianSet] operator[SEP] identifier[create] operator[SEP] identifier[sets] operator[SEP] operator[SEP]
}
|
@Override
public CommerceShipmentItem findByPrimaryKey(Serializable primaryKey)
throws NoSuchShipmentItemException {
CommerceShipmentItem commerceShipmentItem = fetchByPrimaryKey(primaryKey);
if (commerceShipmentItem == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchShipmentItemException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return commerceShipmentItem;
} | class class_name[name] begin[{]
method[findByPrimaryKey, return_type[type[CommerceShipmentItem]], modifier[public], parameter[primaryKey]] begin[{]
local_variable[type[CommerceShipmentItem], commerceShipmentItem]
if[binary_operation[member[.commerceShipmentItem], ==, literal[null]]] begin[{]
if[call[_log.isDebugEnabled, parameter[]]] begin[{]
call[_log.debug, parameter[binary_operation[member[._NO_SUCH_ENTITY_WITH_PRIMARY_KEY], +, member[.primaryKey]]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=_NO_SUCH_ENTITY_WITH_PRIMARY_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=primaryKey, 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=NoSuchShipmentItemException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.commerceShipmentItem]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CommerceShipmentItem] identifier[findByPrimaryKey] operator[SEP] identifier[Serializable] identifier[primaryKey] operator[SEP] Keyword[throws] identifier[NoSuchShipmentItemException] {
identifier[CommerceShipmentItem] identifier[commerceShipmentItem] operator[=] identifier[fetchByPrimaryKey] operator[SEP] identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceShipmentItem] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[_log] operator[SEP] identifier[debug] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[NoSuchShipmentItemException] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP]
}
Keyword[return] identifier[commerceShipmentItem] operator[SEP]
}
|
public void marshall(Domain domain, ProtocolMarshaller protocolMarshaller) {
if (domain == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(domain.getName(), NAME_BINDING);
protocolMarshaller.marshall(domain.getArn(), ARN_BINDING);
protocolMarshaller.marshall(domain.getSupportCode(), SUPPORTCODE_BINDING);
protocolMarshaller.marshall(domain.getCreatedAt(), CREATEDAT_BINDING);
protocolMarshaller.marshall(domain.getLocation(), LOCATION_BINDING);
protocolMarshaller.marshall(domain.getResourceType(), RESOURCETYPE_BINDING);
protocolMarshaller.marshall(domain.getTags(), TAGS_BINDING);
protocolMarshaller.marshall(domain.getDomainEntries(), DOMAINENTRIES_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[domain, protocolMarshaller]] begin[{]
if[binary_operation[member[.domain], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getArn, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=ARN_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=getSupportCode, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=SUPPORTCODE_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=getCreatedAt, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=CREATEDAT_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=getLocation, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=LOCATION_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=getResourceType, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=RESOURCETYPE_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=getTags, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=TAGS_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=getDomainEntries, postfix_operators=[], prefix_operators=[], qualifier=domain, selectors=[], type_arguments=None), MemberReference(member=DOMAINENTRIES_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[Domain] identifier[domain] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[domain] 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[domain] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[domain] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[domain] operator[SEP] identifier[getSupportCode] operator[SEP] operator[SEP] , identifier[SUPPORTCODE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[domain] operator[SEP] identifier[getCreatedAt] operator[SEP] operator[SEP] , identifier[CREATEDAT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[domain] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] , identifier[LOCATION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[domain] operator[SEP] identifier[getResourceType] operator[SEP] operator[SEP] , identifier[RESOURCETYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[domain] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] , identifier[TAGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[domain] operator[SEP] identifier[getDomainEntries] operator[SEP] operator[SEP] , identifier[DOMAINENTRIES_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void setReuseAddress(boolean on) throws SocketException {
if (isClosed())
throw new SocketException("Socket is closed");
getImpl().setOption(SocketOptions.SO_REUSEADDR, Boolean.valueOf(on));
} | class class_name[name] begin[{]
method[setReuseAddress, return_type[void], modifier[public], parameter[on]] begin[{]
if[call[.isClosed, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Socket is closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SocketException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.getImpl, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setReuseAddress] operator[SEP] Keyword[boolean] identifier[on] operator[SEP] Keyword[throws] identifier[SocketException] {
Keyword[if] operator[SEP] identifier[isClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SocketException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getImpl] operator[SEP] operator[SEP] operator[SEP] identifier[setOption] operator[SEP] identifier[SocketOptions] operator[SEP] identifier[SO_REUSEADDR] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[on] operator[SEP] operator[SEP] operator[SEP]
}
|
public DescribeMaintenanceWindowExecutionTaskInvocationsRequest withFilters(MaintenanceWindowFilter... filters) {
if (this.filters == null) {
setFilters(new com.amazonaws.internal.SdkInternalList<MaintenanceWindowFilter>(filters.length));
}
for (MaintenanceWindowFilter ele : filters) {
this.filters.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withFilters, return_type[type[DescribeMaintenanceWindowExecutionTaskInvocationsRequest]], modifier[public], parameter[filters]] begin[{]
if[binary_operation[THIS[member[None.filters]], ==, literal[null]]] begin[{]
call[.setFilters, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=filters, selectors=[])], 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=MaintenanceWindowFilter, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=filters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=filters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MaintenanceWindowFilter, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DescribeMaintenanceWindowExecutionTaskInvocationsRequest] identifier[withFilters] operator[SEP] identifier[MaintenanceWindowFilter] operator[...] identifier[filters] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[filters] operator[==] Other[null] operator[SEP] {
identifier[setFilters] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[MaintenanceWindowFilter] operator[>] operator[SEP] identifier[filters] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[MaintenanceWindowFilter] identifier[ele] operator[:] identifier[filters] operator[SEP] {
Keyword[this] operator[SEP] identifier[filters] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private BufferPool.Buffer getBuffer(final int pos,
final boolean forRead) {
if ((curBuffer != null) && curBuffer.contains(pos)){
return curBuffer;
}
for (BufferPool.Buffer b: buffers) {
if (forRead) {
if (b.contains(pos)) {
curBuffer = b;
return b;
}
continue;
}
if ((b.at(pos))) {
curBuffer = b;
return b;
}
}
return null;
} | class class_name[name] begin[{]
method[getBuffer, return_type[type[BufferPool]], modifier[private], parameter[pos, forRead]] begin[{]
if[binary_operation[binary_operation[member[.curBuffer], !=, literal[null]], &&, call[curBuffer.contains, parameter[member[.pos]]]]] begin[{]
return[member[.curBuffer]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=forRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=curBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ReturnStatement(expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=at, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=curBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ReturnStatement(expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=buffers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferPool, sub_type=ReferenceType(arguments=None, dimensions=None, name=Buffer, sub_type=None)))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[BufferPool] operator[SEP] identifier[Buffer] identifier[getBuffer] operator[SEP] Keyword[final] Keyword[int] identifier[pos] , Keyword[final] Keyword[boolean] identifier[forRead] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[curBuffer] operator[!=] Other[null] operator[SEP] operator[&&] identifier[curBuffer] operator[SEP] identifier[contains] operator[SEP] identifier[pos] operator[SEP] operator[SEP] {
Keyword[return] identifier[curBuffer] operator[SEP]
}
Keyword[for] operator[SEP] identifier[BufferPool] operator[SEP] identifier[Buffer] identifier[b] operator[:] identifier[buffers] operator[SEP] {
Keyword[if] operator[SEP] identifier[forRead] operator[SEP] {
Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[contains] operator[SEP] identifier[pos] operator[SEP] operator[SEP] {
identifier[curBuffer] operator[=] identifier[b] operator[SEP] Keyword[return] identifier[b] operator[SEP]
}
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[at] operator[SEP] identifier[pos] operator[SEP] operator[SEP] operator[SEP] {
identifier[curBuffer] operator[=] identifier[b] operator[SEP] Keyword[return] identifier[b] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public final void mFETCH() throws RecognitionException {
try {
int _type = FETCH;
int _channel = DEFAULT_TOKEN_CHANNEL;
// hql.g:28:7: ( 'fetch' )
// hql.g:28:9: 'fetch'
{
match("fetch"); if (state.failed) return;
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
} | class class_name[name] begin[{]
method[mFETCH, return_type[void], modifier[final public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=FETCH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fetch")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[mFETCH] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
Keyword[int] identifier[_type] operator[=] identifier[FETCH] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] {
identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP]
}
identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP]
}
Keyword[finally] {
}
}
|
public static <T> T requireNonNull(String name, T value) {
Objects.requireNonNull(value, "Argument [" + name + "] cannot be null");
return value;
} | class class_name[name] begin[{]
method[requireNonNull, return_type[type[T]], modifier[public static], parameter[name, value]] begin[{]
call[Objects.requireNonNull, parameter[member[.value], binary_operation[binary_operation[literal["Argument ["], +, member[.name]], +, literal["] cannot be null"]]]]
return[member[.value]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[requireNonNull] operator[SEP] identifier[String] identifier[name] , identifier[T] identifier[value] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[value] , literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP]
}
|
public void setLayerGravity(int index, int gravity) {
final ChildDrawable childDrawable = mLayerState.mChildren[index];
childDrawable.mGravity = gravity;
} | class class_name[name] begin[{]
method[setLayerGravity, return_type[void], modifier[public], parameter[index, gravity]] begin[{]
local_variable[type[ChildDrawable], childDrawable]
assign[member[childDrawable.mGravity], member[.gravity]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setLayerGravity] operator[SEP] Keyword[int] identifier[index] , Keyword[int] identifier[gravity] operator[SEP] {
Keyword[final] identifier[ChildDrawable] identifier[childDrawable] operator[=] identifier[mLayerState] operator[SEP] identifier[mChildren] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[childDrawable] operator[SEP] identifier[mGravity] operator[=] identifier[gravity] operator[SEP]
}
|
public static String getRequestPayloadOutput(Request params, File file) {
StringBuilder payload = new StringBuilder();
String uuid = getUUID();
payload.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Payload</a> ");
payload.append(SPAN_ID).append(uuid).append(DISPLAY_NONE);
if (params != null && params.getJsonPayload() != null) {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
payload.append(DIV);
payload.append(formatHTML(gson.toJson(params.getJsonPayload())));
payload.append(END_DIV);
}
if (params != null && params.getMultipartData() != null) {
for (Map.Entry<String, Object> entry : params.getMultipartData().entrySet()) {
payload.append(DIV);
payload.append(entry.getKey());
payload.append(" : ");
payload.append(entry.getValue());
payload.append(END_DIV);
}
}
if (file != null) {
payload.append("<div> with file: <a href='file:///").append(file.getAbsoluteFile()).append("'>").append(file.getName()).append("</a></div>");
}
payload.append(END_SPAN);
if (payload.toString().equals(ONCLICK_TOGGLE + uuid + "\")'>Toggle Payload</a> " + SPAN_ID + uuid + DISPLAY_NONE + END_SPAN)) {
return "";
} else {
return payload.toString();
}
} | class class_name[name] begin[{]
method[getRequestPayloadOutput, return_type[type[String]], modifier[public static], parameter[params, file]] begin[{]
local_variable[type[StringBuilder], payload]
local_variable[type[String], uuid]
call[payload.append, parameter[member[.ONCLICK_TOGGLE]]]
call[payload.append, parameter[member[.SPAN_ID]]]
if[binary_operation[binary_operation[member[.params], !=, literal[null]], &&, binary_operation[call[params.getJsonPayload, parameter[]], !=, literal[null]]]] begin[{]
local_variable[type[Gson], gson]
call[payload.append, parameter[member[.DIV]]]
call[payload.append, parameter[call[.formatHTML, parameter[call[gson.toJson, parameter[call[params.getJsonPayload, parameter[]]]]]]]]
call[payload.append, parameter[member[.END_DIV]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.params], !=, literal[null]], &&, binary_operation[call[params.getMultipartData, parameter[]], !=, literal[null]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DIV, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=payload, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=payload, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" : ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=payload, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=payload, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=END_DIV, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=payload, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMultipartData, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[MethodInvocation(arguments=[], member=entrySet, 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=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.file], !=, literal[null]]] begin[{]
call[payload.append, parameter[literal["<div> with file: <a href='file:///"]]]
else begin[{]
None
end[}]
call[payload.append, parameter[member[.END_SPAN]]]
if[call[payload.toString, parameter[]]] begin[{]
return[literal[""]]
else begin[{]
return[call[payload.toString, parameter[]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getRequestPayloadOutput] operator[SEP] identifier[Request] identifier[params] , identifier[File] identifier[file] operator[SEP] {
identifier[StringBuilder] identifier[payload] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[uuid] operator[=] identifier[getUUID] operator[SEP] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[ONCLICK_TOGGLE] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[SPAN_ID] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[DISPLAY_NONE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[!=] Other[null] operator[&&] identifier[params] operator[SEP] identifier[getJsonPayload] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[Gson] identifier[gson] operator[=] Keyword[new] identifier[GsonBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setPrettyPrinting] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[DIV] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[formatHTML] operator[SEP] identifier[gson] operator[SEP] identifier[toJson] operator[SEP] identifier[params] operator[SEP] identifier[getJsonPayload] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[END_DIV] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[params] operator[!=] Other[null] operator[&&] identifier[params] operator[SEP] identifier[getMultipartData] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[params] operator[SEP] identifier[getMultipartData] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[DIV] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[END_DIV] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[file] operator[!=] Other[null] operator[SEP] {
identifier[payload] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[file] operator[SEP] identifier[getAbsoluteFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[payload] operator[SEP] identifier[append] operator[SEP] identifier[END_SPAN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[payload] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ONCLICK_TOGGLE] operator[+] identifier[uuid] operator[+] literal[String] operator[+] identifier[SPAN_ID] operator[+] identifier[uuid] operator[+] identifier[DISPLAY_NONE] operator[+] identifier[END_SPAN] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[payload] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public synchronized void deleteAlert(int alertId) throws DatabaseException {
try {
psDeleteAlert.setInt(1, alertId);
psDeleteAlert.execute();
} catch (SQLException e) {
throw new DatabaseException(e);
}
} | class class_name[name] begin[{]
method[deleteAlert, return_type[void], modifier[synchronized public], parameter[alertId]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=alertId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=psDeleteAlert, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=execute, postfix_operators=[], prefix_operators=[], qualifier=psDeleteAlert, 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=DatabaseException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[deleteAlert] operator[SEP] Keyword[int] identifier[alertId] operator[SEP] Keyword[throws] identifier[DatabaseException] {
Keyword[try] {
identifier[psDeleteAlert] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[alertId] operator[SEP] operator[SEP] identifier[psDeleteAlert] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
private void createSampleData(String username, String password) {
Assert.notNull(documentDao, "DocumentDao required");
Assert.hasText(username, "Username required");
Authentication auth = new UsernamePasswordAuthenticationToken(username, password);
try {
// Set the SecurityContextHolder ThreadLocal so any subclasses
// automatically know which user is operating
SecurityContextHolder.getContext().setAuthentication(auth);
// Create the home directory first
Directory home = new Directory(username, Directory.ROOT_DIRECTORY);
documentDao.create(home);
addPermission(documentDao, home, username, LEVEL_GRANT_ADMIN);
addPermission(documentDao, home, "ROLE_USER", LEVEL_GRANT_READ);
createFiles(documentDao, home);
// Now create the confidential directory
Directory confid = new Directory("confidential", home);
documentDao.create(confid);
addPermission(documentDao, confid, "ROLE_USER", LEVEL_NEGATE_READ);
createFiles(documentDao, confid);
// Now create the shared directory
Directory shared = new Directory("shared", home);
documentDao.create(shared);
addPermission(documentDao, shared, "ROLE_USER", LEVEL_GRANT_READ);
addPermission(documentDao, shared, "ROLE_USER", LEVEL_GRANT_WRITE);
createFiles(documentDao, shared);
}
finally {
// Clear the SecurityContextHolder ThreadLocal so future calls are
// guaranteed to be clean
SecurityContextHolder.clearContext();
}
} | class class_name[name] begin[{]
method[createSampleData, return_type[void], modifier[private], parameter[username, password]] begin[{]
call[Assert.notNull, parameter[member[.documentDao], literal["DocumentDao required"]]]
call[Assert.hasText, parameter[member[.username], literal["Username required"]]]
local_variable[type[Authentication], auth]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=SecurityContextHolder, selectors=[MethodInvocation(arguments=[MemberReference(member=auth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAuthentication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ROOT_DIRECTORY, postfix_operators=[], prefix_operators=[], qualifier=Directory, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Directory, sub_type=None)), name=home)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Directory, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=home, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=documentDao, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=home, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LEVEL_GRANT_ADMIN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPermission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=home, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ROLE_USER"), MemberReference(member=LEVEL_GRANT_READ, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPermission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=home, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="confidential"), MemberReference(member=home, 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=Directory, sub_type=None)), name=confid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Directory, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=confid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=documentDao, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=confid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ROLE_USER"), MemberReference(member=LEVEL_NEGATE_READ, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPermission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=confid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="shared"), MemberReference(member=home, 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=Directory, sub_type=None)), name=shared)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Directory, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shared, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=documentDao, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=shared, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ROLE_USER"), MemberReference(member=LEVEL_GRANT_READ, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPermission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=shared, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ROLE_USER"), MemberReference(member=LEVEL_GRANT_WRITE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPermission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=shared, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clearContext, postfix_operators=[], prefix_operators=[], qualifier=SecurityContextHolder, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createSampleData] operator[SEP] identifier[String] identifier[username] , identifier[String] identifier[password] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[documentDao] , literal[String] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[hasText] operator[SEP] identifier[username] , literal[String] operator[SEP] operator[SEP] identifier[Authentication] identifier[auth] operator[=] Keyword[new] identifier[UsernamePasswordAuthenticationToken] operator[SEP] identifier[username] , identifier[password] operator[SEP] operator[SEP] Keyword[try] {
identifier[SecurityContextHolder] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setAuthentication] operator[SEP] identifier[auth] operator[SEP] operator[SEP] identifier[Directory] identifier[home] operator[=] Keyword[new] identifier[Directory] operator[SEP] identifier[username] , identifier[Directory] operator[SEP] identifier[ROOT_DIRECTORY] operator[SEP] operator[SEP] identifier[documentDao] operator[SEP] identifier[create] operator[SEP] identifier[home] operator[SEP] operator[SEP] identifier[addPermission] operator[SEP] identifier[documentDao] , identifier[home] , identifier[username] , identifier[LEVEL_GRANT_ADMIN] operator[SEP] operator[SEP] identifier[addPermission] operator[SEP] identifier[documentDao] , identifier[home] , literal[String] , identifier[LEVEL_GRANT_READ] operator[SEP] operator[SEP] identifier[createFiles] operator[SEP] identifier[documentDao] , identifier[home] operator[SEP] operator[SEP] identifier[Directory] identifier[confid] operator[=] Keyword[new] identifier[Directory] operator[SEP] literal[String] , identifier[home] operator[SEP] operator[SEP] identifier[documentDao] operator[SEP] identifier[create] operator[SEP] identifier[confid] operator[SEP] operator[SEP] identifier[addPermission] operator[SEP] identifier[documentDao] , identifier[confid] , literal[String] , identifier[LEVEL_NEGATE_READ] operator[SEP] operator[SEP] identifier[createFiles] operator[SEP] identifier[documentDao] , identifier[confid] operator[SEP] operator[SEP] identifier[Directory] identifier[shared] operator[=] Keyword[new] identifier[Directory] operator[SEP] literal[String] , identifier[home] operator[SEP] operator[SEP] identifier[documentDao] operator[SEP] identifier[create] operator[SEP] identifier[shared] operator[SEP] operator[SEP] identifier[addPermission] operator[SEP] identifier[documentDao] , identifier[shared] , literal[String] , identifier[LEVEL_GRANT_READ] operator[SEP] operator[SEP] identifier[addPermission] operator[SEP] identifier[documentDao] , identifier[shared] , literal[String] , identifier[LEVEL_GRANT_WRITE] operator[SEP] operator[SEP] identifier[createFiles] operator[SEP] identifier[documentDao] , identifier[shared] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[SecurityContextHolder] operator[SEP] identifier[clearContext] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static byte[] serialize(final Object o, final boolean zip) throws IOException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStream os = baos;
ObjectOutputStream oos = null;
try {
if (zip) {
os = new GZIPOutputStream(os);
}
oos = new ObjectOutputStream(os);
oos.writeObject(o);
oos.flush();
} finally {
if (oos != null) {
oos.close();
}
os.close();
}
return baos.toByteArray();
} | class class_name[name] begin[{]
method[serialize, return_type[type[byte]], modifier[public static], parameter[o, zip]] begin[{]
local_variable[type[ByteArrayOutputStream], baos]
local_variable[type[OutputStream], os]
local_variable[type[ObjectOutputStream], oos]
TryStatement(block=[IfStatement(condition=MemberReference(member=zip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GZIPOutputStream, sub_type=None))), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=oos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=os, 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=ObjectOutputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=oos, 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=oos, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[call[baos.toByteArray, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[serialize] operator[SEP] Keyword[final] identifier[Object] identifier[o] , Keyword[final] Keyword[boolean] identifier[zip] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[ByteArrayOutputStream] identifier[baos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[OutputStream] identifier[os] operator[=] identifier[baos] operator[SEP] identifier[ObjectOutputStream] identifier[oos] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[zip] operator[SEP] {
identifier[os] operator[=] Keyword[new] identifier[GZIPOutputStream] operator[SEP] identifier[os] operator[SEP] operator[SEP]
}
identifier[oos] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] identifier[os] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[writeObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[oos] operator[!=] Other[null] operator[SEP] {
identifier[oos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
identifier[os] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[baos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP]
}
|
public static ClassStub parseClass(URL url) throws IOException {
URI uri;
try {
uri = url.toURI();
} catch (URISyntaxException e) {
throw new GroovyRuntimeException(e);
}
SoftReference<ClassStub> ref = StubCache.map.get(uri);
ClassStub stub = ref == null ? null : ref.get();
if (stub == null) {
DecompilingVisitor visitor = new DecompilingVisitor();
try (InputStream stream = new BufferedInputStream(URLStreams.openUncachedStream(url))) {
new ClassReader(stream).accept(visitor, ClassReader.SKIP_FRAMES);
}
stub = visitor.result;
StubCache.map.put(uri, new SoftReference<ClassStub>(stub));
}
return stub;
} | class class_name[name] begin[{]
method[parseClass, return_type[type[ClassStub]], modifier[public static], parameter[url]] begin[{]
local_variable[type[URI], uri]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=url, 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=GroovyRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None)
local_variable[type[SoftReference], ref]
local_variable[type[ClassStub], stub]
if[binary_operation[member[.stub], ==, literal[null]]] begin[{]
local_variable[type[DecompilingVisitor], visitor]
TryStatement(block=[StatementExpression(expression=ClassCreator(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SKIP_FRAMES, postfix_operators=[], prefix_operators=[], qualifier=ClassReader, selectors=[])], member=accept, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ClassReader, sub_type=None)), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stream, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=openUncachedStream, postfix_operators=[], prefix_operators=[], qualifier=URLStreams, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None)))])
assign[member[.stub], member[visitor.result]]
call[StubCache.map.put, parameter[member[.uri], ClassCreator(arguments=[MemberReference(member=stub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassStub, sub_type=None))], dimensions=None, name=SoftReference, sub_type=None))]]
else begin[{]
None
end[}]
return[member[.stub]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ClassStub] identifier[parseClass] operator[SEP] identifier[URL] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[URI] identifier[uri] operator[SEP] Keyword[try] {
identifier[uri] operator[=] identifier[url] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[GroovyRuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
identifier[SoftReference] operator[<] identifier[ClassStub] operator[>] identifier[ref] operator[=] identifier[StubCache] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[ClassStub] identifier[stub] operator[=] identifier[ref] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stub] operator[==] Other[null] operator[SEP] {
identifier[DecompilingVisitor] identifier[visitor] operator[=] Keyword[new] identifier[DecompilingVisitor] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[InputStream] identifier[stream] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[URLStreams] operator[SEP] identifier[openUncachedStream] operator[SEP] identifier[url] operator[SEP] operator[SEP] operator[SEP] {
Keyword[new] identifier[ClassReader] operator[SEP] identifier[stream] operator[SEP] operator[SEP] identifier[accept] operator[SEP] identifier[visitor] , identifier[ClassReader] operator[SEP] identifier[SKIP_FRAMES] operator[SEP] operator[SEP]
}
identifier[stub] operator[=] identifier[visitor] operator[SEP] identifier[result] operator[SEP] identifier[StubCache] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[uri] , Keyword[new] identifier[SoftReference] operator[<] identifier[ClassStub] operator[>] operator[SEP] identifier[stub] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[stub] operator[SEP]
}
|
public static File unzip(File zip, File toDir) throws IOException {
return unzip(zip, toDir, (Predicate<ZipEntry>) ze -> true);
} | class class_name[name] begin[{]
method[unzip, return_type[type[File]], modifier[public static], parameter[zip, toDir]] begin[{]
return[call[.unzip, parameter[member[.zip], member[.toDir], LambdaExpression(body=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), parameters=[Cast(expression=MemberReference(member=ze, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ZipEntry, sub_type=None))], dimensions=[], name=Predicate, sub_type=None))])]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[File] identifier[unzip] operator[SEP] identifier[File] identifier[zip] , identifier[File] identifier[toDir] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[unzip] operator[SEP] identifier[zip] , identifier[toDir] , operator[SEP] identifier[Predicate] operator[<] identifier[ZipEntry] operator[>] operator[SEP] identifier[ze] operator[->] literal[boolean] operator[SEP] operator[SEP]
}
|
public ServiceFuture<ApplicationInsightsComponentProactiveDetectionConfigurationInner> updateAsync(String resourceGroupName, String resourceName, String configurationId, ApplicationInsightsComponentProactiveDetectionConfigurationInner proactiveDetectionProperties, final ServiceCallback<ApplicationInsightsComponentProactiveDetectionConfigurationInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, configurationId, proactiveDetectionProperties), serviceCallback);
} | class class_name[name] begin[{]
method[updateAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, resourceName, configurationId, proactiveDetectionProperties, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.resourceName], member[.configurationId], member[.proactiveDetectionProperties]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[ApplicationInsightsComponentProactiveDetectionConfigurationInner] operator[>] identifier[updateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[resourceName] , identifier[String] identifier[configurationId] , identifier[ApplicationInsightsComponentProactiveDetectionConfigurationInner] identifier[proactiveDetectionProperties] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[ApplicationInsightsComponentProactiveDetectionConfigurationInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[resourceName] , identifier[configurationId] , identifier[proactiveDetectionProperties] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
private static CodeDependent createCodeByType(ProtoFile protoFile, MessageType type, Set<String> enumNames,
boolean topLevelClass, List<Type> parentNestedTypes, List<CodeDependent> cds, Set<String> packages,
Map<String, String> uniMappedName, boolean isUniName) {
CodeDependent cd = new CodeDependent();
String packageName = protoFile.getPackageName();
String defaultClsName = type.getName();
// to check if has "java_package" option and "java_outer_classname"
List<Option> options = protoFile.getOptions();
if (options != null) {
for (Option option : options) {
if (option.getName().equals(JAVA_PACKAGE_OPTION)) {
packageName = option.getValue().toString();
}
}
}
String simpleName = getProxyClassName(defaultClsName, uniMappedName, isUniName);
// To generate class
StringBuilder code = new StringBuilder();
if (topLevelClass) {
// define package
if (!StringUtils.isEmpty(packageName)) {
code.append("package ").append(packageName).append(CODE_END);
code.append("\n");
}
// add import;
code.append("import com.baidu.bjf.remoting.protobuf.FieldType;\n");
code.append("import com.baidu.bjf.remoting.protobuf.EnumReadable;\n");
code.append("import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;\n");
}
// define class
String clsName;
if (topLevelClass) {
clsName = "public class ";
} else {
clsName = "public static class ";
}
code.append(clsName).append(simpleName).append(" {\n");
List<Field> fields = type.getFields();
// get nested types
List<Type> nestedTypes = fetchAllNestedTypes(type, true);
List<Type> checkNestedTypes = new ArrayList<Type>(nestedTypes);
// to check if has nested classes and check has Enum type
for (Type t : nestedTypes) {
if (t instanceof EnumType) {
enumNames.add(t.getName());
enumNames.add(t.getFullyQualifiedName());
if (!StringUtils.isEmpty(packageName)) {
enumNames.add(StringUtils.removeStart(t.getFullyQualifiedName(), packageName + PACKAGE_SPLIT));
}
} else {
checkNestedTypes.add(t);
}
}
checkNestedTypes.addAll(parentNestedTypes);
String suffix = "";
for (Field field : fields) {
// define annotation
generateProtobufDefinedForField(code, field, enumNames);
FieldType fType = typeMapping.get(field.getType());
String javaType = "";
if (fType == null) {
String jType = field.getType();
javaType = getProxyClassName(jType, packages, uniMappedName, isUniName);
if (!isNestedTypeDependency(field.getType(), checkNestedTypes)) {
cd.addDependency(javaType);
}
} else {
javaType = fType.getJavaType();
suffix = fType.getSuffix();
}
// check if repeated type
if (Label.REPEATED == field.getLabel()) {
javaType = List.class.getName() + "<" + javaType + ">";
}
// define field
code.append("public ").append(javaType);
code.append(" ").append(field.getName());
// check if has default
Option defaultOption = Option.findByName(field.getOptions(), "default");
if (defaultOption != null) {
code.append("=");
Object defaultValue = defaultOption.getValue();
// if is enum type
if (defaultValue instanceof EnumType.Value) {
EnumType.Value enumValue = (EnumType.Value) defaultValue;
code.append(javaType).append(PACKAGE_SPLIT_CHAR).append(enumValue.getName());
} else if (defaultValue instanceof String) {
code.append("\"").append(defaultValue).append("\"");
} else {
code.append(String.valueOf(defaultValue) + suffix);
}
}
code.append(CODE_END);
}
// to check if has nested classes
if (nestedTypes != null) {
for (Type t : nestedTypes) {
CodeDependent nestedCd;
String fqname = t.getFullyQualifiedName();
if (!StringUtils.isEmpty(packageName)) {
fqname = StringUtils.removeStart(t.getFullyQualifiedName(), packageName + PACKAGE_SPLIT_CHAR);
}
String subClsName = getProxyClassName(fqname, uniMappedName, isUniName);
if (t instanceof EnumType) {
nestedCd = createCodeByType((EnumType) t, false, packageName, uniMappedName, isUniName);
enumNames.add(t.getName());
} else {
nestedCd = createCodeByType(protoFile, (MessageType) t, enumNames, false, checkNestedTypes, cds,
getPackages(cds), uniMappedName, isUniName);
}
nestedCd.addSubClass(subClsName);
nestedCd.addSubClass(packageName + PACKAGE_SPLIT_CHAR + subClsName);
code.append(nestedCd.code);
// merge dependency
cd.dependencies.addAll(nestedCd.dependencies);
cd.subClasses.addAll(nestedCd.subClasses);
}
}
code.append("}\n");
cd.name = simpleName;
cd.pkg = packageName;
cd.code = code.toString();
// finally dependency should remove self
cd.dependencies.remove(cd.name);
// also remove parent include
if (!parentNestedTypes.isEmpty()) {
for (Type t : checkNestedTypes) {
Iterator<String> iterator = cd.dependencies.iterator();
while (iterator.hasNext()) {
String dependName = iterator.next();
if (!StringUtils.isEmpty(DEFAULT_SUFFIX_CLASSNAME)) {
dependName = dependName.replaceAll(DEFAULT_SUFFIX_CLASSNAME, "");
}
if (t.getFullyQualifiedName().endsWith(dependName)) {
iterator.remove();
}
}
}
}
return cd;
} | class class_name[name] begin[{]
method[createCodeByType, return_type[type[CodeDependent]], modifier[private static], parameter[protoFile, type, enumNames, topLevelClass, parentNestedTypes, cds, packages, uniMappedName, isUniName]] begin[{]
local_variable[type[CodeDependent], cd]
local_variable[type[String], packageName]
local_variable[type[String], defaultClsName]
local_variable[type[List], options]
if[binary_operation[member[.options], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[MethodInvocation(arguments=[MemberReference(member=JAVA_PACKAGE_OPTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=option)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Option, sub_type=None))), label=None)
else begin[{]
None
end[}]
local_variable[type[String], simpleName]
local_variable[type[StringBuilder], code]
if[member[.topLevelClass]] begin[{]
if[call[StringUtils.isEmpty, parameter[member[.packageName]]]] begin[{]
call[code.append, parameter[literal["package "]]]
call[code.append, parameter[literal["\n"]]]
else begin[{]
None
end[}]
call[code.append, parameter[literal["import com.baidu.bjf.remoting.protobuf.FieldType;\n"]]]
call[code.append, parameter[literal["import com.baidu.bjf.remoting.protobuf.EnumReadable;\n"]]]
call[code.append, parameter[literal["import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;\n"]]]
else begin[{]
None
end[}]
local_variable[type[String], clsName]
if[member[.topLevelClass]] begin[{]
assign[member[.clsName], literal["public class "]]
else begin[{]
assign[member[.clsName], literal["public static class "]]
end[}]
call[code.append, parameter[member[.clsName]]]
local_variable[type[List], fields]
local_variable[type[List], nestedTypes]
local_variable[type[List], checkNestedTypes]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=checkNestedTypes, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=enumNames, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=enumNames, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PACKAGE_SPLIT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=removeStart, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=enumNames, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=nestedTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
call[checkNestedTypes.addAll, parameter[member[.parentNestedTypes]]]
local_variable[type[String], suffix]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enumNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateProtobufDefinedForField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=typeMapping, selectors=[], type_arguments=None), name=fType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldType, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=javaType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getJavaType, postfix_operators=[], prefix_operators=[], qualifier=fType, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=suffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getSuffix, postfix_operators=[], prefix_operators=[], qualifier=fType, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), name=jType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=jType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=packages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uniMappedName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isUniName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProxyClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MemberReference(member=checkNestedTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNestedTypeDependency, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDependency, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[], type_arguments=None), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=REPEATED, postfix_operators=[], prefix_operators=[], qualifier=Label, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<"), operator=+), operandr=MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">"), operator=+)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="public ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[MethodInvocation(arguments=[MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOptions, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="default")], member=findByName, postfix_operators=[], prefix_operators=[], qualifier=Option, selectors=[], type_arguments=None), name=defaultOption)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Option, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=defaultOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=defaultOption, selectors=[], type_arguments=None), name=defaultValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=ReferenceType(arguments=None, dimensions=None, name=Value, sub_type=None)), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), operandr=MemberReference(member=suffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[MethodInvocation(arguments=[MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=ReferenceType(arguments=None, dimensions=None, name=Value, sub_type=None))), name=enumValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=ReferenceType(arguments=None, dimensions=None, name=Value, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[MethodInvocation(arguments=[MemberReference(member=PACKAGE_SPLIT_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=enumValue, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CODE_END, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None)
if[binary_operation[member[.nestedTypes], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=nestedCd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CodeDependent, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), name=fqname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fqname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PACKAGE_SPLIT_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=removeStart, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fqname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uniMappedName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isUniName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProxyClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=subClsName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nestedCd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=protoFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MessageType, sub_type=None)), MemberReference(member=enumNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=checkNestedTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=cds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPackages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=uniMappedName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isUniName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createCodeByType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nestedCd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uniMappedName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isUniName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createCodeByType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=enumNames, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subClsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSubClass, postfix_operators=[], prefix_operators=[], qualifier=nestedCd, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PACKAGE_SPLIT_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=subClsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=addSubClass, postfix_operators=[], prefix_operators=[], qualifier=nestedCd, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=nestedCd, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=code, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dependencies, postfix_operators=[], prefix_operators=[], qualifier=nestedCd, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=cd.dependencies, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subClasses, postfix_operators=[], prefix_operators=[], qualifier=nestedCd, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=cd.subClasses, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nestedTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
else begin[{]
None
end[}]
call[code.append, parameter[literal["}\n"]]]
assign[member[cd.name], member[.simpleName]]
assign[member[cd.pkg], member[.packageName]]
assign[member[cd.code], call[code.toString, parameter[]]]
call[cd.dependencies.remove, parameter[member[cd.name]]]
if[call[parentNestedTypes.isEmpty, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=cd.dependencies, selectors=[], type_arguments=None), name=iterator)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), name=dependName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=DEFAULT_SUFFIX_CLASSNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dependName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=DEFAULT_SUFFIX_CLASSNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=dependName, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[MethodInvocation(arguments=[MemberReference(member=dependName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=checkNestedTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[member[.cd]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[CodeDependent] identifier[createCodeByType] operator[SEP] identifier[ProtoFile] identifier[protoFile] , identifier[MessageType] identifier[type] , identifier[Set] operator[<] identifier[String] operator[>] identifier[enumNames] , Keyword[boolean] identifier[topLevelClass] , identifier[List] operator[<] identifier[Type] operator[>] identifier[parentNestedTypes] , identifier[List] operator[<] identifier[CodeDependent] operator[>] identifier[cds] , identifier[Set] operator[<] identifier[String] operator[>] identifier[packages] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[uniMappedName] , Keyword[boolean] identifier[isUniName] operator[SEP] {
identifier[CodeDependent] identifier[cd] operator[=] Keyword[new] identifier[CodeDependent] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[packageName] operator[=] identifier[protoFile] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[defaultClsName] operator[=] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Option] operator[>] identifier[options] operator[=] identifier[protoFile] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Option] identifier[option] operator[:] identifier[options] operator[SEP] {
Keyword[if] operator[SEP] identifier[option] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[JAVA_PACKAGE_OPTION] operator[SEP] operator[SEP] {
identifier[packageName] operator[=] identifier[option] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[String] identifier[simpleName] operator[=] identifier[getProxyClassName] operator[SEP] identifier[defaultClsName] , identifier[uniMappedName] , identifier[isUniName] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[code] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[topLevelClass] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] {
identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CODE_END] operator[SEP] operator[SEP] identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[clsName] operator[SEP] Keyword[if] operator[SEP] identifier[topLevelClass] operator[SEP] {
identifier[clsName] operator[=] literal[String] operator[SEP]
}
Keyword[else] {
identifier[clsName] operator[=] literal[String] operator[SEP]
}
identifier[code] operator[SEP] identifier[append] operator[SEP] identifier[clsName] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[simpleName] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Field] operator[>] identifier[fields] operator[=] identifier[type] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Type] operator[>] identifier[nestedTypes] operator[=] identifier[fetchAllNestedTypes] operator[SEP] identifier[type] , literal[boolean] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Type] operator[>] identifier[checkNestedTypes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Type] operator[>] operator[SEP] identifier[nestedTypes] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Type] identifier[t] operator[:] identifier[nestedTypes] operator[SEP] {
Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[EnumType] operator[SEP] {
identifier[enumNames] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enumNames] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] {
identifier[enumNames] operator[SEP] identifier[add] operator[SEP] identifier[StringUtils] operator[SEP] identifier[removeStart] operator[SEP] identifier[t] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] , identifier[packageName] operator[+] identifier[PACKAGE_SPLIT] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[checkNestedTypes] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
identifier[checkNestedTypes] operator[SEP] identifier[addAll] operator[SEP] identifier[parentNestedTypes] operator[SEP] operator[SEP] identifier[String] identifier[suffix] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[field] operator[:] identifier[fields] operator[SEP] {
identifier[generateProtobufDefinedForField] operator[SEP] identifier[code] , identifier[field] , identifier[enumNames] operator[SEP] operator[SEP] identifier[FieldType] identifier[fType] operator[=] identifier[typeMapping] operator[SEP] identifier[get] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[javaType] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[fType] operator[==] Other[null] operator[SEP] {
identifier[String] identifier[jType] operator[=] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[javaType] operator[=] identifier[getProxyClassName] operator[SEP] identifier[jType] , identifier[packages] , identifier[uniMappedName] , identifier[isUniName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNestedTypeDependency] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[checkNestedTypes] operator[SEP] operator[SEP] {
identifier[cd] operator[SEP] identifier[addDependency] operator[SEP] identifier[javaType] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[javaType] operator[=] identifier[fType] operator[SEP] identifier[getJavaType] operator[SEP] operator[SEP] operator[SEP] identifier[suffix] operator[=] identifier[fType] operator[SEP] identifier[getSuffix] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Label] operator[SEP] identifier[REPEATED] operator[==] identifier[field] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] {
identifier[javaType] operator[=] identifier[List] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[javaType] operator[+] literal[String] operator[SEP]
}
identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[javaType] operator[SEP] operator[SEP] identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Option] identifier[defaultOption] operator[=] identifier[Option] operator[SEP] identifier[findByName] operator[SEP] identifier[field] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[defaultOption] operator[!=] Other[null] operator[SEP] {
identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[defaultValue] operator[=] identifier[defaultOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[defaultValue] Keyword[instanceof] identifier[EnumType] operator[SEP] identifier[Value] operator[SEP] {
identifier[EnumType] operator[SEP] identifier[Value] identifier[enumValue] operator[=] operator[SEP] identifier[EnumType] operator[SEP] identifier[Value] operator[SEP] identifier[defaultValue] operator[SEP] identifier[code] operator[SEP] identifier[append] operator[SEP] identifier[javaType] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[PACKAGE_SPLIT_CHAR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[enumValue] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[defaultValue] Keyword[instanceof] identifier[String] operator[SEP] {
identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[code] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[defaultValue] operator[SEP] operator[+] identifier[suffix] operator[SEP] operator[SEP]
}
}
identifier[code] operator[SEP] identifier[append] operator[SEP] identifier[CODE_END] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[nestedTypes] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Type] identifier[t] operator[:] identifier[nestedTypes] operator[SEP] {
identifier[CodeDependent] identifier[nestedCd] operator[SEP] identifier[String] identifier[fqname] operator[=] identifier[t] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] {
identifier[fqname] operator[=] identifier[StringUtils] operator[SEP] identifier[removeStart] operator[SEP] identifier[t] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] , identifier[packageName] operator[+] identifier[PACKAGE_SPLIT_CHAR] operator[SEP] operator[SEP]
}
identifier[String] identifier[subClsName] operator[=] identifier[getProxyClassName] operator[SEP] identifier[fqname] , identifier[uniMappedName] , identifier[isUniName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[EnumType] operator[SEP] {
identifier[nestedCd] operator[=] identifier[createCodeByType] operator[SEP] operator[SEP] identifier[EnumType] operator[SEP] identifier[t] , literal[boolean] , identifier[packageName] , identifier[uniMappedName] , identifier[isUniName] operator[SEP] operator[SEP] identifier[enumNames] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[nestedCd] operator[=] identifier[createCodeByType] operator[SEP] identifier[protoFile] , operator[SEP] identifier[MessageType] operator[SEP] identifier[t] , identifier[enumNames] , literal[boolean] , identifier[checkNestedTypes] , identifier[cds] , identifier[getPackages] operator[SEP] identifier[cds] operator[SEP] , identifier[uniMappedName] , identifier[isUniName] operator[SEP] operator[SEP]
}
identifier[nestedCd] operator[SEP] identifier[addSubClass] operator[SEP] identifier[subClsName] operator[SEP] operator[SEP] identifier[nestedCd] operator[SEP] identifier[addSubClass] operator[SEP] identifier[packageName] operator[+] identifier[PACKAGE_SPLIT_CHAR] operator[+] identifier[subClsName] operator[SEP] operator[SEP] identifier[code] operator[SEP] identifier[append] operator[SEP] identifier[nestedCd] operator[SEP] identifier[code] operator[SEP] operator[SEP] identifier[cd] operator[SEP] identifier[dependencies] operator[SEP] identifier[addAll] operator[SEP] identifier[nestedCd] operator[SEP] identifier[dependencies] operator[SEP] operator[SEP] identifier[cd] operator[SEP] identifier[subClasses] operator[SEP] identifier[addAll] operator[SEP] identifier[nestedCd] operator[SEP] identifier[subClasses] operator[SEP] operator[SEP]
}
}
identifier[code] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cd] operator[SEP] identifier[name] operator[=] identifier[simpleName] operator[SEP] identifier[cd] operator[SEP] identifier[pkg] operator[=] identifier[packageName] operator[SEP] identifier[cd] operator[SEP] identifier[code] operator[=] identifier[code] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[cd] operator[SEP] identifier[dependencies] operator[SEP] identifier[remove] operator[SEP] identifier[cd] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[parentNestedTypes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Type] identifier[t] operator[:] identifier[checkNestedTypes] operator[SEP] {
identifier[Iterator] operator[<] identifier[String] operator[>] identifier[iterator] operator[=] identifier[cd] operator[SEP] identifier[dependencies] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[dependName] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[DEFAULT_SUFFIX_CLASSNAME] operator[SEP] operator[SEP] {
identifier[dependName] operator[=] identifier[dependName] operator[SEP] identifier[replaceAll] operator[SEP] identifier[DEFAULT_SUFFIX_CLASSNAME] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[t] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] identifier[dependName] operator[SEP] operator[SEP] {
identifier[iterator] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[cd] operator[SEP]
}
|
public void end() {
final OClass vClass = db.getMetadata().getSchema().getClass(vertexClass);
try {
runningThreads = new AtomicInteger(parallel);
for (int i = 0; i < parallel - 1; i++) {
Thread t = new BatchImporterJob(i, vClass);
t.start();
}
Thread t = new BatchImporterJob(parallel - 1, vClass);
t.run();
if (runningThreads.get() > 0) {
synchronized (runningThreads) {
while (runningThreads.get() > 0) {
try {
runningThreads.wait();
} catch (InterruptedException e) {
}
}
}
}
} finally {
db.activateOnCurrentThread();
db.declareIntent(null);
db.close();
if (walActive)
OGlobalConfiguration.USE_WAL.setValue(true);
}
} | class class_name[name] begin[{]
method[end, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[OClass], vClass]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=runningThreads, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=parallel, 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=AtomicInteger, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vClass, 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=BatchImporterJob, sub_type=None)), name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=parallel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=parallel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), MemberReference(member=vClass, 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=BatchImporterJob, sub_type=None)), name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=runningThreads, 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=[SynchronizedStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=wait, postfix_operators=[], prefix_operators=[], qualifier=runningThreads, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=runningThreads, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], label=None, lock=MemberReference(member=runningThreads, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=activateOnCurrentThread, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=declareIntent, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=walActive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=OGlobalConfiguration.USE_WAL, selectors=[], type_arguments=None), label=None))], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[end] operator[SEP] operator[SEP] {
Keyword[final] identifier[OClass] identifier[vClass] operator[=] identifier[db] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] identifier[vertexClass] operator[SEP] operator[SEP] Keyword[try] {
identifier[runningThreads] operator[=] Keyword[new] identifier[AtomicInteger] operator[SEP] identifier[parallel] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parallel] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Thread] identifier[t] operator[=] Keyword[new] identifier[BatchImporterJob] operator[SEP] identifier[i] , identifier[vClass] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Thread] identifier[t] operator[=] Keyword[new] identifier[BatchImporterJob] operator[SEP] identifier[parallel] operator[-] Other[1] , identifier[vClass] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[runningThreads] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[runningThreads] operator[SEP] {
Keyword[while] operator[SEP] identifier[runningThreads] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[try] {
identifier[runningThreads] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
}
}
}
}
}
Keyword[finally] {
identifier[db] operator[SEP] identifier[activateOnCurrentThread] operator[SEP] operator[SEP] operator[SEP] identifier[db] operator[SEP] identifier[declareIntent] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[db] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[walActive] operator[SEP] identifier[OGlobalConfiguration] operator[SEP] identifier[USE_WAL] operator[SEP] identifier[setValue] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
|
public static void addRowsInAInToC(DMatrixSparseCSC A , int colA ,
DMatrixSparseCSC C, int colC,
int w[] ) {
int idxA0 = A.col_idx[colA];
int idxA1 = A.col_idx[colA+1];
for (int j = idxA0; j < idxA1; j++) {
int row = A.nz_rows[j];
if( w[row] < colC ) {
if( C.nz_length >= C.nz_rows.length ) {
C.growMaxLength(C.nz_length *2+1,true);
}
w[row] = colC;
C.nz_rows[C.nz_length++] = row;
}
}
C.col_idx[colC+1] = C.nz_length;
} | class class_name[name] begin[{]
method[addRowsInAInToC, return_type[void], modifier[public static], parameter[A, colA, C, colC, w]] begin[{]
local_variable[type[int], idxA0]
local_variable[type[int], idxA1]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=nz_rows, postfix_operators=[], prefix_operators=[], qualifier=A, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=colC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nz_length, postfix_operators=[], prefix_operators=[], qualifier=C, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=C.nz_rows, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nz_length, postfix_operators=[], prefix_operators=[], qualifier=C, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=growMaxLength, postfix_operators=[], prefix_operators=[], qualifier=C, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=colC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nz_rows, postfix_operators=[], prefix_operators=[], qualifier=C, selectors=[ArraySelector(index=MemberReference(member=nz_length, postfix_operators=['++'], prefix_operators=[], qualifier=C, selectors=[]))]), type==, value=MemberReference(member=row, 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=idxA1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=idxA0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[C.col_idx], member[C.nz_length]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[addRowsInAInToC] operator[SEP] identifier[DMatrixSparseCSC] identifier[A] , Keyword[int] identifier[colA] , identifier[DMatrixSparseCSC] identifier[C] , Keyword[int] identifier[colC] , Keyword[int] identifier[w] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[idxA0] operator[=] identifier[A] operator[SEP] identifier[col_idx] operator[SEP] identifier[colA] operator[SEP] operator[SEP] Keyword[int] identifier[idxA1] operator[=] identifier[A] operator[SEP] identifier[col_idx] operator[SEP] identifier[colA] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[idxA0] operator[SEP] identifier[j] operator[<] identifier[idxA1] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[int] identifier[row] operator[=] identifier[A] operator[SEP] identifier[nz_rows] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[w] operator[SEP] identifier[row] operator[SEP] operator[<] identifier[colC] operator[SEP] {
Keyword[if] operator[SEP] identifier[C] operator[SEP] identifier[nz_length] operator[>=] identifier[C] operator[SEP] identifier[nz_rows] operator[SEP] identifier[length] operator[SEP] {
identifier[C] operator[SEP] identifier[growMaxLength] operator[SEP] identifier[C] operator[SEP] identifier[nz_length] operator[*] Other[2] operator[+] Other[1] , literal[boolean] operator[SEP] operator[SEP]
}
identifier[w] operator[SEP] identifier[row] operator[SEP] operator[=] identifier[colC] operator[SEP] identifier[C] operator[SEP] identifier[nz_rows] operator[SEP] identifier[C] operator[SEP] identifier[nz_length] operator[++] operator[SEP] operator[=] identifier[row] operator[SEP]
}
}
identifier[C] operator[SEP] identifier[col_idx] operator[SEP] identifier[colC] operator[+] Other[1] operator[SEP] operator[=] identifier[C] operator[SEP] identifier[nz_length] operator[SEP]
}
|
protected void deleteExceptionByteArrayByParameterMap(String key, Object value) {
EnsureUtil.ensureNotNull(key, value);
Map<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put(key, value);
getDbEntityManager().delete(ByteArrayEntity.class, "deleteExceptionByteArraysByIds", parameterMap);
} | class class_name[name] begin[{]
method[deleteExceptionByteArrayByParameterMap, return_type[void], modifier[protected], parameter[key, value]] begin[{]
call[EnsureUtil.ensureNotNull, parameter[member[.key], member[.value]]]
local_variable[type[Map], parameterMap]
call[parameterMap.put, parameter[member[.key], member[.value]]]
call[.getDbEntityManager, parameter[]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[deleteExceptionByteArrayByParameterMap] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] {
identifier[EnsureUtil] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameterMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[parameterMap] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] identifier[getDbEntityManager] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[ByteArrayEntity] operator[SEP] Keyword[class] , literal[String] , identifier[parameterMap] operator[SEP] operator[SEP]
}
|
public void tryVibrate() {
if (mVibrator != null && mIsGloballyEnabled) {
long now = SystemClock.uptimeMillis();
// We want to try to vibrate each individual tick discretely.
if (now - mLastVibrate >= VIBRATE_DELAY_MS) {
mVibrator.vibrate(VIBRATE_LENGTH_MS);
mLastVibrate = now;
}
}
} | class class_name[name] begin[{]
method[tryVibrate, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[member[.mVibrator], !=, literal[null]], &&, member[.mIsGloballyEnabled]]] begin[{]
local_variable[type[long], now]
if[binary_operation[binary_operation[member[.now], -, member[.mLastVibrate]], >=, member[.VIBRATE_DELAY_MS]]] begin[{]
call[mVibrator.vibrate, parameter[member[.VIBRATE_LENGTH_MS]]]
assign[member[.mLastVibrate], member[.now]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[tryVibrate] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[mVibrator] operator[!=] Other[null] operator[&&] identifier[mIsGloballyEnabled] operator[SEP] {
Keyword[long] identifier[now] operator[=] identifier[SystemClock] operator[SEP] identifier[uptimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[now] operator[-] identifier[mLastVibrate] operator[>=] identifier[VIBRATE_DELAY_MS] operator[SEP] {
identifier[mVibrator] operator[SEP] identifier[vibrate] operator[SEP] identifier[VIBRATE_LENGTH_MS] operator[SEP] operator[SEP] identifier[mLastVibrate] operator[=] identifier[now] operator[SEP]
}
}
}
|
public LaunchPermissionModifications withRemove(LaunchPermission... remove) {
if (this.remove == null) {
setRemove(new com.amazonaws.internal.SdkInternalList<LaunchPermission>(remove.length));
}
for (LaunchPermission ele : remove) {
this.remove.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withRemove, return_type[type[LaunchPermissionModifications]], modifier[public], parameter[remove]] begin[{]
if[binary_operation[THIS[member[None.remove]], ==, literal[null]]] begin[{]
call[.setRemove, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=remove, selectors=[])], 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=LaunchPermission, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LaunchPermission, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[LaunchPermissionModifications] identifier[withRemove] operator[SEP] identifier[LaunchPermission] operator[...] identifier[remove] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[remove] operator[==] Other[null] operator[SEP] {
identifier[setRemove] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[LaunchPermission] operator[>] operator[SEP] identifier[remove] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[LaunchPermission] identifier[ele] operator[:] identifier[remove] operator[SEP] {
Keyword[this] operator[SEP] identifier[remove] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public void setExtends(String superType) {
if (!Strings.isEmpty(superType)
&& !Skill.class.getName().equals(superType)) {
JvmParameterizedTypeReference superTypeRef = newTypeRef(this.sarlSkill, superType);
JvmTypeReference baseTypeRef = findType(this.sarlSkill, Skill.class.getCanonicalName());
if (isSubTypeOf(this.sarlSkill, superTypeRef, baseTypeRef)) {
this.sarlSkill.setExtends(superTypeRef);
return;
}
}
this.sarlSkill.setExtends(null);
} | class class_name[name] begin[{]
method[setExtends, return_type[void], modifier[public], parameter[superType]] begin[{]
if[binary_operation[call[Strings.isEmpty, parameter[member[.superType]]], &&, ClassReference(postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=superType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Skill, sub_type=None))]] begin[{]
local_variable[type[JvmParameterizedTypeReference], superTypeRef]
local_variable[type[JvmTypeReference], baseTypeRef]
if[call[.isSubTypeOf, parameter[THIS[member[None.sarlSkill]], member[.superTypeRef], member[.baseTypeRef]]]] begin[{]
THIS[member[None.sarlSkill]call[None.setExtends, parameter[member[.superTypeRef]]]]
return[None]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
THIS[member[None.sarlSkill]call[None.setExtends, parameter[literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setExtends] operator[SEP] identifier[String] identifier[superType] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[Strings] operator[SEP] identifier[isEmpty] operator[SEP] identifier[superType] operator[SEP] operator[&&] operator[!] identifier[Skill] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[superType] operator[SEP] operator[SEP] {
identifier[JvmParameterizedTypeReference] identifier[superTypeRef] operator[=] identifier[newTypeRef] operator[SEP] Keyword[this] operator[SEP] identifier[sarlSkill] , identifier[superType] operator[SEP] operator[SEP] identifier[JvmTypeReference] identifier[baseTypeRef] operator[=] identifier[findType] operator[SEP] Keyword[this] operator[SEP] identifier[sarlSkill] , identifier[Skill] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isSubTypeOf] operator[SEP] Keyword[this] operator[SEP] identifier[sarlSkill] , identifier[superTypeRef] , identifier[baseTypeRef] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[sarlSkill] operator[SEP] identifier[setExtends] operator[SEP] identifier[superTypeRef] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
Keyword[this] operator[SEP] identifier[sarlSkill] operator[SEP] identifier[setExtends] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
|
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.FNI__RG:
return rg != null && !rg.isEmpty();
}
return super.eIsSet(featureID);
} | class class_name[name] begin[{]
method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=FNI__RG, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rg, 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=rg, selectors=[], type_arguments=None), operator=&&), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNI__RG] operator[:] Keyword[return] identifier[rg] operator[!=] Other[null] operator[&&] operator[!] identifier[rg] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
private JaxWsSoapContextHandler getContextHandlerFromClient(BindingProvider soapClient) {
@SuppressWarnings("rawtypes") // getHandlerChain returns a list of raw Handler.
List<Handler> handlers = soapClient.getBinding().getHandlerChain();
for (Handler<?> handler : handlers) {
if (handler instanceof JaxWsSoapContextHandler) {
return (JaxWsSoapContextHandler) handler;
}
}
throw new IllegalStateException("The SOAP client passed into the JaxWsHandler does not "
+ "have the necessary context handler on its binding chain.");
} | class class_name[name] begin[{]
method[getContextHandlerFromClient, return_type[type[JaxWsSoapContextHandler]], modifier[private], parameter[soapClient]] begin[{]
local_variable[type[List], handlers]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JaxWsSoapContextHandler, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JaxWsSoapContextHandler, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=handlers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=handler)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Handler, sub_type=None))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The SOAP client passed into the JaxWsHandler does not "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="have the necessary context handler on its binding chain."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[private] identifier[JaxWsSoapContextHandler] identifier[getContextHandlerFromClient] operator[SEP] identifier[BindingProvider] identifier[soapClient] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[List] operator[<] identifier[Handler] operator[>] identifier[handlers] operator[=] identifier[soapClient] operator[SEP] identifier[getBinding] operator[SEP] operator[SEP] operator[SEP] identifier[getHandlerChain] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Handler] operator[<] operator[?] operator[>] identifier[handler] operator[:] identifier[handlers] operator[SEP] {
Keyword[if] operator[SEP] identifier[handler] Keyword[instanceof] identifier[JaxWsSoapContextHandler] operator[SEP] {
Keyword[return] operator[SEP] identifier[JaxWsSoapContextHandler] operator[SEP] identifier[handler] operator[SEP]
}
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
|
public static LocalPaymentResult fromJson(String json) throws JSONException {
LocalPaymentResult localPaymentResult = new LocalPaymentResult();
localPaymentResult.fromJson(LocalPaymentResult.getJsonObjectForType(API_RESOURCE_KEY, new JSONObject(json)));
return localPaymentResult;
} | class class_name[name] begin[{]
method[fromJson, return_type[type[LocalPaymentResult]], modifier[public static], parameter[json]] begin[{]
local_variable[type[LocalPaymentResult], localPaymentResult]
call[localPaymentResult.fromJson, parameter[call[LocalPaymentResult.getJsonObjectForType, parameter[member[.API_RESOURCE_KEY], ClassCreator(arguments=[MemberReference(member=json, 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=JSONObject, sub_type=None))]]]]
return[member[.localPaymentResult]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[LocalPaymentResult] identifier[fromJson] operator[SEP] identifier[String] identifier[json] operator[SEP] Keyword[throws] identifier[JSONException] {
identifier[LocalPaymentResult] identifier[localPaymentResult] operator[=] Keyword[new] identifier[LocalPaymentResult] operator[SEP] operator[SEP] operator[SEP] identifier[localPaymentResult] operator[SEP] identifier[fromJson] operator[SEP] identifier[LocalPaymentResult] operator[SEP] identifier[getJsonObjectForType] operator[SEP] identifier[API_RESOURCE_KEY] , Keyword[new] identifier[JSONObject] operator[SEP] identifier[json] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[localPaymentResult] operator[SEP]
}
|
public CreateClusterRequest withInstanceGroup(InstanceGroupConfig instanceGroup) {
if (this.instanceGroups == null) {
this.instanceGroups = new ArrayList<InstanceGroupConfig>();
}
this.instanceGroups.add(instanceGroup);
return this;
} | class class_name[name] begin[{]
method[withInstanceGroup, return_type[type[CreateClusterRequest]], modifier[public], parameter[instanceGroup]] begin[{]
if[binary_operation[THIS[member[None.instanceGroups]], ==, literal[null]]] begin[{]
assign[THIS[member[None.instanceGroups]], 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=InstanceGroupConfig, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
THIS[member[None.instanceGroups]call[None.add, parameter[member[.instanceGroup]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[CreateClusterRequest] identifier[withInstanceGroup] operator[SEP] identifier[InstanceGroupConfig] identifier[instanceGroup] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[instanceGroups] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[instanceGroups] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[InstanceGroupConfig] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[instanceGroups] operator[SEP] identifier[add] operator[SEP] identifier[instanceGroup] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.