code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public void perform() {
for (int i = 0; i < operations.size(); i++) {
operations.get(i).process();
}
} | class class_name[name] begin[{]
method[perform, return_type[void], modifier[public], parameter[]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=operations, selectors=[MethodInvocation(arguments=[], member=process, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=operations, 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)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[perform] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[operations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[operations] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[process] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public USCBYPSIDEN createUSCBYPSIDENFromString(EDataType eDataType, String initialValue) {
USCBYPSIDEN result = USCBYPSIDEN.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | class class_name[name] begin[{]
method[createUSCBYPSIDENFromString, return_type[type[USCBYPSIDEN]], modifier[public], parameter[eDataType, initialValue]] begin[{]
local_variable[type[USCBYPSIDEN], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), 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[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[USCBYPSIDEN] identifier[createUSCBYPSIDENFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] {
identifier[USCBYPSIDEN] identifier[result] operator[=] identifier[USCBYPSIDEN] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
private void putFrame() {
final int nLocal = currentFrame[1];
final int nStack = currentFrame[2];
if (symbolTable.getMajorVersion() < Opcodes.V1_6) {
// Generate a StackMap attribute entry, which are always uncompressed.
stackMapTableEntries.putShort(currentFrame[0]).putShort(nLocal);
putAbstractTypes(3, 3 + nLocal);
stackMapTableEntries.putShort(nStack);
putAbstractTypes(3 + nLocal, 3 + nLocal + nStack);
return;
}
final int offsetDelta =
stackMapTableNumberOfEntries == 0
? currentFrame[0]
: currentFrame[0] - previousFrame[0] - 1;
final int previousNlocal = previousFrame[1];
final int nLocalDelta = nLocal - previousNlocal;
int type = Frame.FULL_FRAME;
if (nStack == 0) {
switch (nLocalDelta) {
case -3:
case -2:
case -1:
type = Frame.CHOP_FRAME;
break;
case 0:
type = offsetDelta < 64 ? Frame.SAME_FRAME : Frame.SAME_FRAME_EXTENDED;
break;
case 1:
case 2:
case 3:
type = Frame.APPEND_FRAME;
break;
default:
// Keep the FULL_FRAME type.
break;
}
} else if (nLocalDelta == 0 && nStack == 1) {
type =
offsetDelta < 63
? Frame.SAME_LOCALS_1_STACK_ITEM_FRAME
: Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
}
if (type != Frame.FULL_FRAME) {
// Verify if locals are the same as in the previous frame.
int frameIndex = 3;
for (int i = 0; i < previousNlocal && i < nLocal; i++) {
if (currentFrame[frameIndex] != previousFrame[frameIndex]) {
type = Frame.FULL_FRAME;
break;
}
frameIndex++;
}
}
switch (type) {
case Frame.SAME_FRAME:
stackMapTableEntries.putByte(offsetDelta);
break;
case Frame.SAME_LOCALS_1_STACK_ITEM_FRAME:
stackMapTableEntries.putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME + offsetDelta);
putAbstractTypes(3 + nLocal, 4 + nLocal);
break;
case Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
stackMapTableEntries
.putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
.putShort(offsetDelta);
putAbstractTypes(3 + nLocal, 4 + nLocal);
break;
case Frame.SAME_FRAME_EXTENDED:
stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED).putShort(offsetDelta);
break;
case Frame.CHOP_FRAME:
stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED + nLocalDelta).putShort(offsetDelta);
break;
case Frame.APPEND_FRAME:
stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED + nLocalDelta).putShort(offsetDelta);
putAbstractTypes(3 + previousNlocal, 3 + nLocal);
break;
case Frame.FULL_FRAME:
default:
stackMapTableEntries.putByte(Frame.FULL_FRAME).putShort(offsetDelta).putShort(nLocal);
putAbstractTypes(3, 3 + nLocal);
stackMapTableEntries.putShort(nStack);
putAbstractTypes(3 + nLocal, 3 + nLocal + nStack);
}
} | class class_name[name] begin[{]
method[putFrame, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[int], nLocal]
local_variable[type[int], nStack]
if[binary_operation[call[symbolTable.getMajorVersion, parameter[]], <, member[Opcodes.V1_6]]] begin[{]
call[stackMapTableEntries.putShort, parameter[member[.currentFrame]]]
call[.putAbstractTypes, parameter[literal[3], binary_operation[literal[3], +, member[.nLocal]]]]
call[stackMapTableEntries.putShort, parameter[member[.nStack]]]
call[.putAbstractTypes, parameter[binary_operation[literal[3], +, member[.nLocal]], binary_operation[binary_operation[literal[3], +, member[.nLocal]], +, member[.nStack]]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[int], offsetDelta]
local_variable[type[int], previousNlocal]
local_variable[type[int], nLocalDelta]
local_variable[type[int], type]
if[binary_operation[member[.nStack], ==, literal[0]]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=3), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=CHOP_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64), operator=<), if_false=MemberReference(member=SAME_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[]), if_true=MemberReference(member=SAME_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[]))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=APPEND_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=nLocalDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
if[binary_operation[binary_operation[member[.nLocalDelta], ==, literal[0]], &&, binary_operation[member[.nStack], ==, literal[1]]]] begin[{]
assign[member[.type], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=63), operator=<), if_false=MemberReference(member=SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[]), if_true=MemberReference(member=SAME_LOCALS_1_STACK_ITEM_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[]))]
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.type], !=, member[Frame.FULL_FRAME]]] begin[{]
local_variable[type[int], frameIndex]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentFrame, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=frameIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=previousFrame, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=frameIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=FULL_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MemberReference(member=frameIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=previousNlocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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)
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SAME_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putByte, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=SAME_LOCALS_1_STACK_ITEM_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=SAME_LOCALS_1_STACK_ITEM_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[]), operandr=MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putByte, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putAbstractTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], member=putByte, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[MethodInvocation(arguments=[MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putShort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putAbstractTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=SAME_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SAME_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], member=putByte, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[MethodInvocation(arguments=[MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putShort, 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=[MemberReference(member=CHOP_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=SAME_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[]), operandr=MemberReference(member=nLocalDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putByte, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[MethodInvocation(arguments=[MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putShort, 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=[MemberReference(member=APPEND_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=SAME_FRAME_EXTENDED, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[]), operandr=MemberReference(member=nLocalDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putByte, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[MethodInvocation(arguments=[MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putShort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=previousNlocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putAbstractTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=FULL_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FULL_FRAME, postfix_operators=[], prefix_operators=[], qualifier=Frame, selectors=[])], member=putByte, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[MethodInvocation(arguments=[MemberReference(member=offsetDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putShort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putShort, 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=3), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putAbstractTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nStack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putShort, postfix_operators=[], prefix_operators=[], qualifier=stackMapTableEntries, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=nLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=nStack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=putAbstractTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[putFrame] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[nLocal] operator[=] identifier[currentFrame] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[nStack] operator[=] identifier[currentFrame] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[symbolTable] operator[SEP] identifier[getMajorVersion] operator[SEP] operator[SEP] operator[<] identifier[Opcodes] operator[SEP] identifier[V1_6] operator[SEP] {
identifier[stackMapTableEntries] operator[SEP] identifier[putShort] operator[SEP] identifier[currentFrame] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[putShort] operator[SEP] identifier[nLocal] operator[SEP] operator[SEP] identifier[putAbstractTypes] operator[SEP] Other[3] , Other[3] operator[+] identifier[nLocal] operator[SEP] operator[SEP] identifier[stackMapTableEntries] operator[SEP] identifier[putShort] operator[SEP] identifier[nStack] operator[SEP] operator[SEP] identifier[putAbstractTypes] operator[SEP] Other[3] operator[+] identifier[nLocal] , Other[3] operator[+] identifier[nLocal] operator[+] identifier[nStack] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[final] Keyword[int] identifier[offsetDelta] operator[=] identifier[stackMapTableNumberOfEntries] operator[==] Other[0] operator[?] identifier[currentFrame] operator[SEP] Other[0] operator[SEP] operator[:] identifier[currentFrame] operator[SEP] Other[0] operator[SEP] operator[-] identifier[previousFrame] operator[SEP] Other[0] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[final] Keyword[int] identifier[previousNlocal] operator[=] identifier[previousFrame] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[nLocalDelta] operator[=] identifier[nLocal] operator[-] identifier[previousNlocal] operator[SEP] Keyword[int] identifier[type] operator[=] identifier[Frame] operator[SEP] identifier[FULL_FRAME] operator[SEP] Keyword[if] operator[SEP] identifier[nStack] operator[==] Other[0] operator[SEP] {
Keyword[switch] operator[SEP] identifier[nLocalDelta] operator[SEP] {
Keyword[case] operator[-] Other[3] operator[:] Keyword[case] operator[-] Other[2] operator[:] Keyword[case] operator[-] Other[1] operator[:] identifier[type] operator[=] identifier[Frame] operator[SEP] identifier[CHOP_FRAME] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[0] operator[:] identifier[type] operator[=] identifier[offsetDelta] operator[<] Other[64] operator[?] identifier[Frame] operator[SEP] identifier[SAME_FRAME] operator[:] identifier[Frame] operator[SEP] identifier[SAME_FRAME_EXTENDED] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[1] operator[:] Keyword[case] Other[2] operator[:] Keyword[case] Other[3] operator[:] identifier[type] operator[=] identifier[Frame] operator[SEP] identifier[APPEND_FRAME] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[nLocalDelta] operator[==] Other[0] operator[&&] identifier[nStack] operator[==] Other[1] operator[SEP] {
identifier[type] operator[=] identifier[offsetDelta] operator[<] Other[63] operator[?] identifier[Frame] operator[SEP] identifier[SAME_LOCALS_1_STACK_ITEM_FRAME] operator[:] identifier[Frame] operator[SEP] identifier[SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED] operator[SEP]
}
Keyword[if] operator[SEP] identifier[type] operator[!=] identifier[Frame] operator[SEP] identifier[FULL_FRAME] operator[SEP] {
Keyword[int] identifier[frameIndex] operator[=] Other[3] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[previousNlocal] operator[&&] identifier[i] operator[<] identifier[nLocal] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentFrame] operator[SEP] identifier[frameIndex] operator[SEP] operator[!=] identifier[previousFrame] operator[SEP] identifier[frameIndex] operator[SEP] operator[SEP] {
identifier[type] operator[=] identifier[Frame] operator[SEP] identifier[FULL_FRAME] operator[SEP] Keyword[break] operator[SEP]
}
identifier[frameIndex] operator[++] operator[SEP]
}
}
Keyword[switch] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] identifier[Frame] operator[SEP] identifier[SAME_FRAME] operator[:] identifier[stackMapTableEntries] operator[SEP] identifier[putByte] operator[SEP] identifier[offsetDelta] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Frame] operator[SEP] identifier[SAME_LOCALS_1_STACK_ITEM_FRAME] operator[:] identifier[stackMapTableEntries] operator[SEP] identifier[putByte] operator[SEP] identifier[Frame] operator[SEP] identifier[SAME_LOCALS_1_STACK_ITEM_FRAME] operator[+] identifier[offsetDelta] operator[SEP] operator[SEP] identifier[putAbstractTypes] operator[SEP] Other[3] operator[+] identifier[nLocal] , Other[4] operator[+] identifier[nLocal] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Frame] operator[SEP] identifier[SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED] operator[:] identifier[stackMapTableEntries] operator[SEP] identifier[putByte] operator[SEP] identifier[Frame] operator[SEP] identifier[SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED] operator[SEP] operator[SEP] identifier[putShort] operator[SEP] identifier[offsetDelta] operator[SEP] operator[SEP] identifier[putAbstractTypes] operator[SEP] Other[3] operator[+] identifier[nLocal] , Other[4] operator[+] identifier[nLocal] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Frame] operator[SEP] identifier[SAME_FRAME_EXTENDED] operator[:] identifier[stackMapTableEntries] operator[SEP] identifier[putByte] operator[SEP] identifier[Frame] operator[SEP] identifier[SAME_FRAME_EXTENDED] operator[SEP] operator[SEP] identifier[putShort] operator[SEP] identifier[offsetDelta] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Frame] operator[SEP] identifier[CHOP_FRAME] operator[:] identifier[stackMapTableEntries] operator[SEP] identifier[putByte] operator[SEP] identifier[Frame] operator[SEP] identifier[SAME_FRAME_EXTENDED] operator[+] identifier[nLocalDelta] operator[SEP] operator[SEP] identifier[putShort] operator[SEP] identifier[offsetDelta] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Frame] operator[SEP] identifier[APPEND_FRAME] operator[:] identifier[stackMapTableEntries] operator[SEP] identifier[putByte] operator[SEP] identifier[Frame] operator[SEP] identifier[SAME_FRAME_EXTENDED] operator[+] identifier[nLocalDelta] operator[SEP] operator[SEP] identifier[putShort] operator[SEP] identifier[offsetDelta] operator[SEP] operator[SEP] identifier[putAbstractTypes] operator[SEP] Other[3] operator[+] identifier[previousNlocal] , Other[3] operator[+] identifier[nLocal] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Frame] operator[SEP] identifier[FULL_FRAME] operator[:] Keyword[default] operator[:] identifier[stackMapTableEntries] operator[SEP] identifier[putByte] operator[SEP] identifier[Frame] operator[SEP] identifier[FULL_FRAME] operator[SEP] operator[SEP] identifier[putShort] operator[SEP] identifier[offsetDelta] operator[SEP] operator[SEP] identifier[putShort] operator[SEP] identifier[nLocal] operator[SEP] operator[SEP] identifier[putAbstractTypes] operator[SEP] Other[3] , Other[3] operator[+] identifier[nLocal] operator[SEP] operator[SEP] identifier[stackMapTableEntries] operator[SEP] identifier[putShort] operator[SEP] identifier[nStack] operator[SEP] operator[SEP] identifier[putAbstractTypes] operator[SEP] Other[3] operator[+] identifier[nLocal] , Other[3] operator[+] identifier[nLocal] operator[+] identifier[nStack] operator[SEP] operator[SEP]
}
}
|
private List<CmsResource> getResources() {
List<CmsResource> result = new LinkedList<CmsResource>();
CmsObject cms = getCms();
CmsResourceFilter filter = CmsResourceFilter.ALL;
try {
for (String path : m_paths) {
List<CmsResource> resources = cms.readResources(path, filter, true);
// filter out any resource that is no XML content:
for (CmsResource resource : resources) {
if (resource.isFile()) {
if (CmsResourceTypeXmlContent.isXmlContent(resource)) {
result.add(resource);
} else if (CmsResourceTypeXmlPage.isXmlPage(resource)) {
result.add(resource);
}
}
}
}
} catch (CmsException e) {
LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_LANGUAGECOPY_READRESOURCES_0), e);
result = Collections.emptyList();
}
return result;
} | class class_name[name] begin[{]
method[getResources, return_type[type[List]], modifier[private], parameter[]] begin[{]
local_variable[type[List], result]
local_variable[type[CmsObject], cms]
local_variable[type[CmsResourceFilter], filter]
TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=readResources, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), name=resources)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isXmlContent, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceTypeXmlContent, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isXmlPage, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceTypeXmlPage, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=m_paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_ERR_LANGUAGECOPY_READRESOURCES_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), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[getResources] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[CmsResource] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[CmsObject] identifier[cms] operator[=] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[CmsResourceFilter] identifier[filter] operator[=] identifier[CmsResourceFilter] operator[SEP] identifier[ALL] operator[SEP] Keyword[try] {
Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[m_paths] operator[SEP] {
identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[resources] operator[=] identifier[cms] operator[SEP] identifier[readResources] operator[SEP] identifier[path] , identifier[filter] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsResource] identifier[resource] operator[:] identifier[resources] operator[SEP] {
Keyword[if] operator[SEP] identifier[resource] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[CmsResourceTypeXmlContent] operator[SEP] identifier[isXmlContent] operator[SEP] identifier[resource] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[resource] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[CmsResourceTypeXmlPage] operator[SEP] identifier[isXmlPage] operator[SEP] identifier[resource] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[resource] operator[SEP] operator[SEP]
}
}
}
}
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_ERR_LANGUAGECOPY_READRESOURCES_0] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
KJoin newJoin(final KJoin join) {
return new KJoin() {
@Override
public boolean isEnabled(KProcess process) {
return !process.getElementsInError().contains(KWhileLoop.this) && predicate.verify(process)
&& (started.contains(process) || join
.isEnabled(process));
}
@Override
public void join(KCall call) {
if (!started.contains(call.getProcess())) {
join.join(call);
started.produce(call.getProcess());
}
diff.produce(call.getProcess());
KWhileLoop.this.iterating(call);
}
@Override
public KElement getProcedure() {
return KWhileLoop.this;
}
};
} | class class_name[name] begin[{]
method[newJoin, return_type[type[KJoin]], modifier[default], parameter[join]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getElementsInError, postfix_operators=[], prefix_operators=['!'], qualifier=process, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=KWhileLoop, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=verify, postfix_operators=[], prefix_operators=[], qualifier=predicate, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=started, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEnabled, postfix_operators=[], prefix_operators=[], qualifier=join, selectors=[], type_arguments=None), operator=||), operator=&&), label=None)], documentation=None, modifiers={'public'}, name=isEnabled, parameters=[FormalParameter(annotations=[], modifiers=set(), name=process, type=ReferenceType(arguments=None, dimensions=[], name=KProcess, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProcess, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=started, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=call, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=join, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProcess, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[], type_arguments=None)], member=produce, postfix_operators=[], prefix_operators=[], qualifier=started, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProcess, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[], type_arguments=None)], member=produce, postfix_operators=[], prefix_operators=[], qualifier=diff, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=KWhileLoop, selectors=[MethodInvocation(arguments=[MemberReference(member=call, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=iterating, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], documentation=None, modifiers={'public'}, name=join, parameters=[FormalParameter(annotations=[], modifiers=set(), name=call, type=ReferenceType(arguments=None, dimensions=[], name=KCall, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=KWhileLoop, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getProcedure, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=KElement, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KJoin, sub_type=None))]
end[}]
END[}] | identifier[KJoin] identifier[newJoin] operator[SEP] Keyword[final] identifier[KJoin] identifier[join] operator[SEP] {
Keyword[return] Keyword[new] identifier[KJoin] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isEnabled] operator[SEP] identifier[KProcess] identifier[process] operator[SEP] {
Keyword[return] operator[!] identifier[process] operator[SEP] identifier[getElementsInError] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[KWhileLoop] operator[SEP] Keyword[this] operator[SEP] operator[&&] identifier[predicate] operator[SEP] identifier[verify] operator[SEP] identifier[process] operator[SEP] operator[&&] operator[SEP] identifier[started] operator[SEP] identifier[contains] operator[SEP] identifier[process] operator[SEP] operator[||] identifier[join] operator[SEP] identifier[isEnabled] operator[SEP] identifier[process] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[join] operator[SEP] identifier[KCall] identifier[call] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[started] operator[SEP] identifier[contains] operator[SEP] identifier[call] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[join] operator[SEP] identifier[join] operator[SEP] identifier[call] operator[SEP] operator[SEP] identifier[started] operator[SEP] identifier[produce] operator[SEP] identifier[call] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[diff] operator[SEP] identifier[produce] operator[SEP] identifier[call] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[KWhileLoop] operator[SEP] Keyword[this] operator[SEP] identifier[iterating] operator[SEP] identifier[call] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] identifier[KElement] identifier[getProcedure] operator[SEP] operator[SEP] {
Keyword[return] identifier[KWhileLoop] operator[SEP] Keyword[this] operator[SEP]
}
} operator[SEP]
}
|
@Programmatic
public ApplicationTenancy newTenancy(
final String name,
final String path,
final ApplicationTenancy parent) {
ApplicationTenancy tenancy = findByPath(path);
if (tenancy == null) {
tenancy = getApplicationTenancyFactory().newApplicationTenancy();
tenancy.setName(name);
tenancy.setPath(path);
tenancy.setParent(parent);
container.persist(tenancy);
}
return tenancy;
} | class class_name[name] begin[{]
method[newTenancy, return_type[type[ApplicationTenancy]], modifier[public], parameter[name, path, parent]] begin[{]
local_variable[type[ApplicationTenancy], tenancy]
if[binary_operation[member[.tenancy], ==, literal[null]]] begin[{]
assign[member[.tenancy], call[.getApplicationTenancyFactory, parameter[]]]
call[tenancy.setName, parameter[member[.name]]]
call[tenancy.setPath, parameter[member[.path]]]
call[tenancy.setParent, parameter[member[.parent]]]
call[container.persist, parameter[member[.tenancy]]]
else begin[{]
None
end[}]
return[member[.tenancy]]
end[}]
END[}] | annotation[@] identifier[Programmatic] Keyword[public] identifier[ApplicationTenancy] identifier[newTenancy] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[path] , Keyword[final] identifier[ApplicationTenancy] identifier[parent] operator[SEP] {
identifier[ApplicationTenancy] identifier[tenancy] operator[=] identifier[findByPath] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tenancy] operator[==] Other[null] operator[SEP] {
identifier[tenancy] operator[=] identifier[getApplicationTenancyFactory] operator[SEP] operator[SEP] operator[SEP] identifier[newApplicationTenancy] operator[SEP] operator[SEP] operator[SEP] identifier[tenancy] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[tenancy] operator[SEP] identifier[setPath] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[tenancy] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[persist] operator[SEP] identifier[tenancy] operator[SEP] operator[SEP]
}
Keyword[return] identifier[tenancy] operator[SEP]
}
|
void setPathToNamesInternal(Set<GeneralNameInterface> names) {
// set names to non-null dummy value
// this breaks getPathToNames()
pathToNames = Collections.<List<?>>emptySet();
pathToGeneralNames = names;
} | class class_name[name] begin[{]
method[setPathToNamesInternal, return_type[void], modifier[default], parameter[names]] begin[{]
assign[member[.pathToNames], call[.Collections, parameter[]]]
assign[member[.pathToGeneralNames], member[.names]]
end[}]
END[}] | Keyword[void] identifier[setPathToNamesInternal] operator[SEP] identifier[Set] operator[<] identifier[GeneralNameInterface] operator[>] identifier[names] operator[SEP] {
identifier[pathToNames] operator[=] identifier[Collections] operator[SEP] operator[<] identifier[List] operator[<] operator[?] operator[>] operator[>] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP] identifier[pathToGeneralNames] operator[=] identifier[names] operator[SEP]
}
|
public static Map<String, String> jsonize(String msgFormat, Object... args)
{
return ImmutableMap.of("error", StringUtils.nonStrictFormat(msgFormat, args));
} | class class_name[name] begin[{]
method[jsonize, return_type[type[Map]], modifier[public static], parameter[msgFormat, args]] begin[{]
return[call[ImmutableMap.of, parameter[literal["error"], call[StringUtils.nonStrictFormat, parameter[member[.msgFormat], member[.args]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[jsonize] operator[SEP] identifier[String] identifier[msgFormat] , identifier[Object] operator[...] identifier[args] operator[SEP] {
Keyword[return] identifier[ImmutableMap] operator[SEP] identifier[of] operator[SEP] literal[String] , identifier[StringUtils] operator[SEP] identifier[nonStrictFormat] operator[SEP] identifier[msgFormat] , identifier[args] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public long getLogFileTimestamp(File file) {
String name = file.getName();
// Check name for extension
if (name == null || name.length() == 0 || !name.startsWith(TEXTLOGPREF) || !name.endsWith(TEXTLOGEXT)) {
return -1L;
}
long result = -1L;
try {
Date date = DATEFORMAT.parse(name.substring(TEXTLOGPREF.length(), name.length() - TEXTLOGEXT.length()));
result = date.getTime();
} catch (ParseException ex) {
// Fall through to return -1L;
}
return result;
} | class class_name[name] begin[{]
method[getLogFileTimestamp, return_type[type[long]], modifier[public], parameter[file]] begin[{]
local_variable[type[String], name]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.name], ==, literal[null]], ||, binary_operation[call[name.length, parameter[]], ==, literal[0]]], ||, call[name.startsWith, parameter[member[.TEXTLOGPREF]]]], ||, call[name.endsWith, parameter[member[.TEXTLOGEXT]]]]] begin[{]
return[literal[1L]]
else begin[{]
None
end[}]
local_variable[type[long], result]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=TEXTLOGPREF, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=TEXTLOGEXT, selectors=[], type_arguments=None), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)], member=parse, postfix_operators=[], prefix_operators=[], qualifier=DATEFORMAT, selectors=[], type_arguments=None), name=date)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['ParseException']))], finally_block=None, label=None, resources=None)
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[getLogFileTimestamp] operator[SEP] identifier[File] identifier[file] operator[SEP] {
identifier[String] identifier[name] operator[=] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[||] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[||] operator[!] identifier[name] operator[SEP] identifier[startsWith] operator[SEP] identifier[TEXTLOGPREF] operator[SEP] operator[||] operator[!] identifier[name] operator[SEP] identifier[endsWith] operator[SEP] identifier[TEXTLOGEXT] operator[SEP] operator[SEP] {
Keyword[return] operator[-] Other[1L] operator[SEP]
}
Keyword[long] identifier[result] operator[=] operator[-] Other[1L] operator[SEP] Keyword[try] {
identifier[Date] identifier[date] operator[=] identifier[DATEFORMAT] operator[SEP] identifier[parse] operator[SEP] identifier[name] operator[SEP] identifier[substring] operator[SEP] identifier[TEXTLOGPREF] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[TEXTLOGEXT] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[date] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[ex] operator[SEP] {
}
Keyword[return] identifier[result] operator[SEP]
}
|
public ListenableFuture<Boolean> deleteAsync(final TwilioRestClient client) {
return Twilio.getExecutorService().submit(new Callable<Boolean>() {
public Boolean call() {
return delete(client);
}
});
} | class class_name[name] begin[{]
method[deleteAsync, return_type[type[ListenableFuture]], modifier[public], parameter[client]] begin[{]
return[call[Twilio.getExecutorService, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[ListenableFuture] operator[<] identifier[Boolean] operator[>] identifier[deleteAsync] operator[SEP] Keyword[final] identifier[TwilioRestClient] identifier[client] operator[SEP] {
Keyword[return] identifier[Twilio] operator[SEP] identifier[getExecutorService] operator[SEP] operator[SEP] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Callable] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] {
Keyword[public] identifier[Boolean] identifier[call] operator[SEP] operator[SEP] {
Keyword[return] identifier[delete] operator[SEP] identifier[client] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public Result<MoveAlongSurfaceResult> moveAlongSurface(long startRef, float[] startPos, float[] endPos,
QueryFilter filter) {
// Validate input
if (!m_nav.isValidPolyRef(startRef) || Objects.isNull(startPos) || !vIsFinite(startPos)
|| Objects.isNull(endPos) || !vIsFinite(endPos) || Objects.isNull(filter)) {
return Result.invalidParam();
}
m_tinyNodePool.clear();
Node startNode = m_tinyNodePool.getNode(startRef);
startNode.pidx = 0;
startNode.cost = 0;
startNode.total = 0;
startNode.id = startRef;
startNode.flags = Node.DT_NODE_CLOSED;
LinkedList<Node> stack = new LinkedList<>();
stack.add(startNode);
float[] bestPos = new float[3];
float bestDist = Float.MAX_VALUE;
Node bestNode = null;
vCopy(bestPos, startPos);
// Search constraints
float[] searchPos = vLerp(startPos, endPos, 0.5f);
float searchRadSqr = sqr(vDist(startPos, endPos) / 2.0f + 0.001f);
float[] verts = new float[m_nav.getMaxVertsPerPoly() * 3];
while (!stack.isEmpty()) {
// Pop front.
Node curNode = stack.pop();
// Get poly and tile.
// The API input has been cheked already, skip checking internal data.
long curRef = curNode.id;
Tupple2<MeshTile, Poly> tileAndPoly = m_nav.getTileAndPolyByRefUnsafe(curRef);
MeshTile curTile = tileAndPoly.first;
Poly curPoly = tileAndPoly.second;
// Collect vertices.
int nverts = curPoly.vertCount;
for (int i = 0; i < nverts; ++i) {
System.arraycopy(curTile.data.verts, curPoly.verts[i] * 3, verts, i * 3, 3);
}
// If target is inside the poly, stop search.
if (pointInPolygon(endPos, verts, nverts)) {
bestNode = curNode;
vCopy(bestPos, endPos);
break;
}
// Find wall edges and find nearest point inside the walls.
for (int i = 0, j = curPoly.vertCount - 1; i < curPoly.vertCount; j = i++) {
// Find links to neighbours.
int MAX_NEIS = 8;
int nneis = 0;
long[] neis = new long[MAX_NEIS];
if ((curPoly.neis[j] & NavMesh.DT_EXT_LINK) != 0) {
// Tile border.
for (int k = curPoly.firstLink; k != NavMesh.DT_NULL_LINK; k = curTile.links.get(k).next) {
Link link = curTile.links.get(k);
if (link.edge == j) {
if (link.ref != 0) {
tileAndPoly = m_nav.getTileAndPolyByRefUnsafe(link.ref);
MeshTile neiTile = tileAndPoly.first;
Poly neiPoly = tileAndPoly.second;
if (filter.passFilter(link.ref, neiTile, neiPoly)) {
if (nneis < MAX_NEIS) {
neis[nneis++] = link.ref;
}
}
}
}
}
} else if (curPoly.neis[j] != 0) {
int idx = curPoly.neis[j] - 1;
long ref = m_nav.getPolyRefBase(curTile) | idx;
if (filter.passFilter(ref, curTile, curTile.data.polys[idx])) {
// Internal edge, encode id.
neis[nneis++] = ref;
}
}
if (nneis == 0) {
// Wall edge, calc distance.
int vj = j * 3;
int vi = i * 3;
Tupple2<Float, Float> distSeg = distancePtSegSqr2D(endPos, verts, vj, vi);
float distSqr = distSeg.first;
float tseg = distSeg.second;
if (distSqr < bestDist) {
// Update nearest distance.
bestPos = vLerp(verts, vj, vi, tseg);
bestDist = distSqr;
bestNode = curNode;
}
} else {
for (int k = 0; k < nneis; ++k) {
Node neighbourNode = m_tinyNodePool.getNode(neis[k]);
// Skip if already visited.
if ((neighbourNode.flags & Node.DT_NODE_CLOSED) != 0) {
continue;
}
// Skip the link if it is too far from search constraint.
// TODO: Maybe should use getPortalPoints(), but this one is way faster.
int vj = j * 3;
int vi = i * 3;
Tupple2<Float, Float> distseg = distancePtSegSqr2D(searchPos, verts, vj, vi);
float distSqr = distseg.first;
if (distSqr > searchRadSqr) {
continue;
}
// Mark as the node as visited and push to queue.
neighbourNode.pidx = m_tinyNodePool.getNodeIdx(curNode);
neighbourNode.flags |= Node.DT_NODE_CLOSED;
stack.add(neighbourNode);
}
}
}
}
List<Long> visited = new ArrayList<>();
if (bestNode != null) {
// Reverse the path.
Node prev = null;
Node node = bestNode;
do {
Node next = m_tinyNodePool.getNodeAtIdx(node.pidx);
node.pidx = m_tinyNodePool.getNodeIdx(prev);
prev = node;
node = next;
} while (node != null);
// Store result
node = prev;
do {
visited.add(node.id);
node = m_tinyNodePool.getNodeAtIdx(node.pidx);
} while (node != null);
}
return Result.success(new MoveAlongSurfaceResult(bestPos, visited));
} | class class_name[name] begin[{]
method[moveAlongSurface, return_type[type[Result]], modifier[public], parameter[startRef, startPos, endPos, filter]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[m_nav.isValidPolyRef, parameter[member[.startRef]]], ||, call[Objects.isNull, parameter[member[.startPos]]]], ||, call[.vIsFinite, parameter[member[.startPos]]]], ||, call[Objects.isNull, parameter[member[.endPos]]]], ||, call[.vIsFinite, parameter[member[.endPos]]]], ||, call[Objects.isNull, parameter[member[.filter]]]]] begin[{]
return[call[Result.invalidParam, parameter[]]]
else begin[{]
None
end[}]
call[m_tinyNodePool.clear, parameter[]]
local_variable[type[Node], startNode]
assign[member[startNode.pidx], literal[0]]
assign[member[startNode.cost], literal[0]]
assign[member[startNode.total], literal[0]]
assign[member[startNode.id], member[.startRef]]
assign[member[startNode.flags], member[Node.DT_NODE_CLOSED]]
local_variable[type[LinkedList], stack]
call[stack.add, parameter[member[.startNode]]]
local_variable[type[float], bestPos]
local_variable[type[float], bestDist]
local_variable[type[Node], bestNode]
call[.vCopy, parameter[member[.bestPos], member[.startPos]]]
local_variable[type[float], searchPos]
local_variable[type[float], searchRadSqr]
local_variable[type[float], verts]
while[call[stack.isEmpty, parameter[]]] begin[{]
local_variable[type[Node], curNode]
local_variable[type[long], curRef]
local_variable[type[Tupple2], tileAndPoly]
local_variable[type[MeshTile], curTile]
local_variable[type[Poly], curPoly]
local_variable[type[int], nverts]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=curTile.data, selectors=[]), BinaryOperation(operandl=MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=curPoly, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nverts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
if[call[.pointInPolygon, parameter[member[.endPos], member[.verts], member[.nverts]]]] begin[{]
assign[member[.bestNode], member[.curNode]]
call[.vCopy, parameter[member[.bestPos], member[.endPos]]]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), name=MAX_NEIS)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=nneis)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=MAX_NEIS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long)), name=neis)], modifiers=set(), type=BasicType(dimensions=[None], name=long)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=neis, postfix_operators=[], prefix_operators=[], qualifier=curPoly, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=DT_EXT_LINK, postfix_operators=[], prefix_operators=[], qualifier=NavMesh, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=neis, postfix_operators=[], prefix_operators=[], qualifier=curPoly, selectors=[ArraySelector(index=MemberReference(member=j, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=neis, postfix_operators=[], prefix_operators=[], qualifier=curPoly, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=curTile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPolyRefBase, postfix_operators=[], prefix_operators=[], qualifier=m_nav, selectors=[], type_arguments=None), operandr=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), name=ref)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=curTile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=polys, postfix_operators=[], prefix_operators=[], qualifier=curTile.data, selectors=[ArraySelector(index=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=passFilter, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=neis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nneis, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=curTile.links, selectors=[], type_arguments=None), name=link)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Link, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=edge, postfix_operators=[], prefix_operators=[], qualifier=link, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=link, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tileAndPoly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=link, selectors=[])], member=getTileAndPolyByRefUnsafe, postfix_operators=[], prefix_operators=[], qualifier=m_nav, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=tileAndPoly, selectors=[]), name=neiTile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MeshTile, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=second, postfix_operators=[], prefix_operators=[], qualifier=tileAndPoly, selectors=[]), name=neiPoly)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Poly, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=link, selectors=[]), MemberReference(member=neiTile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=neiPoly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=passFilter, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nneis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_NEIS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=neis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nneis, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=link, selectors=[])), label=None)]))]))]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DT_NULL_LINK, postfix_operators=[], prefix_operators=[], qualifier=NavMesh, selectors=[]), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=firstLink, postfix_operators=[], prefix_operators=[], qualifier=curPoly, selectors=[]), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=curTile.links, selectors=[MemberReference(member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None))]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nneis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=neis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=m_tinyNodePool, selectors=[], type_arguments=None), name=neighbourNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=neighbourNode, selectors=[]), operandr=MemberReference(member=DT_NODE_CLOSED, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), name=vj)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), name=vi)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=searchPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=distancePtSegSqr2D, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=distseg)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], dimensions=[], name=Tupple2, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=distseg, selectors=[]), name=distSqr)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=distSqr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=searchRadSqr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pidx, postfix_operators=[], prefix_operators=[], qualifier=neighbourNode, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=curNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNodeIdx, postfix_operators=[], prefix_operators=[], qualifier=m_tinyNodePool, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=neighbourNode, selectors=[]), type=|=, value=MemberReference(member=DT_NODE_CLOSED, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=neighbourNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nneis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), name=vj)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), name=vi)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=endPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=distancePtSegSqr2D, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=distSeg)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], dimensions=[], name=Tupple2, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=distSeg, selectors=[]), name=distSqr)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=second, postfix_operators=[], prefix_operators=[], qualifier=distSeg, selectors=[]), name=tseg)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=distSqr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bestDist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tseg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vLerp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestDist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=distSqr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=curNode, 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=vertCount, postfix_operators=[], prefix_operators=[], qualifier=curPoly, 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=BinaryOperation(operandl=MemberReference(member=vertCount, postfix_operators=[], prefix_operators=[], qualifier=curPoly, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), label=None)
end[}]
local_variable[type[List], visited]
if[binary_operation[member[.bestNode], !=, literal[null]]] begin[{]
local_variable[type[Node], prev]
local_variable[type[Node], node]
do[binary_operation[member[.node], !=, literal[null]]] begin[{]
local_variable[type[Node], next]
assign[member[node.pidx], call[m_tinyNodePool.getNodeIdx, parameter[member[.prev]]]]
assign[member[.prev], member[.node]]
assign[member[.node], member[.next]]
end[}]
assign[member[.node], member[.prev]]
do[binary_operation[member[.node], !=, literal[null]]] begin[{]
call[visited.add, parameter[member[node.id]]]
assign[member[.node], call[m_tinyNodePool.getNodeAtIdx, parameter[member[node.pidx]]]]
end[}]
else begin[{]
None
end[}]
return[call[Result.success, parameter[ClassCreator(arguments=[MemberReference(member=bestPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=visited, 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=MoveAlongSurfaceResult, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Result] operator[<] identifier[MoveAlongSurfaceResult] operator[>] identifier[moveAlongSurface] operator[SEP] Keyword[long] identifier[startRef] , Keyword[float] operator[SEP] operator[SEP] identifier[startPos] , Keyword[float] operator[SEP] operator[SEP] identifier[endPos] , identifier[QueryFilter] identifier[filter] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[m_nav] operator[SEP] identifier[isValidPolyRef] operator[SEP] identifier[startRef] operator[SEP] operator[||] identifier[Objects] operator[SEP] identifier[isNull] operator[SEP] identifier[startPos] operator[SEP] operator[||] operator[!] identifier[vIsFinite] operator[SEP] identifier[startPos] operator[SEP] operator[||] identifier[Objects] operator[SEP] identifier[isNull] operator[SEP] identifier[endPos] operator[SEP] operator[||] operator[!] identifier[vIsFinite] operator[SEP] identifier[endPos] operator[SEP] operator[||] identifier[Objects] operator[SEP] identifier[isNull] operator[SEP] identifier[filter] operator[SEP] operator[SEP] {
Keyword[return] identifier[Result] operator[SEP] identifier[invalidParam] operator[SEP] operator[SEP] operator[SEP]
}
identifier[m_tinyNodePool] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[startNode] operator[=] identifier[m_tinyNodePool] operator[SEP] identifier[getNode] operator[SEP] identifier[startRef] operator[SEP] operator[SEP] identifier[startNode] operator[SEP] identifier[pidx] operator[=] Other[0] operator[SEP] identifier[startNode] operator[SEP] identifier[cost] operator[=] Other[0] operator[SEP] identifier[startNode] operator[SEP] identifier[total] operator[=] Other[0] operator[SEP] identifier[startNode] operator[SEP] identifier[id] operator[=] identifier[startRef] operator[SEP] identifier[startNode] operator[SEP] identifier[flags] operator[=] identifier[Node] operator[SEP] identifier[DT_NODE_CLOSED] operator[SEP] identifier[LinkedList] operator[<] identifier[Node] operator[>] identifier[stack] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[add] operator[SEP] identifier[startNode] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[bestPos] operator[=] Keyword[new] Keyword[float] operator[SEP] Other[3] operator[SEP] operator[SEP] Keyword[float] identifier[bestDist] operator[=] identifier[Float] operator[SEP] identifier[MAX_VALUE] operator[SEP] identifier[Node] identifier[bestNode] operator[=] Other[null] operator[SEP] identifier[vCopy] operator[SEP] identifier[bestPos] , identifier[startPos] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[searchPos] operator[=] identifier[vLerp] operator[SEP] identifier[startPos] , identifier[endPos] , literal[Float] operator[SEP] operator[SEP] Keyword[float] identifier[searchRadSqr] operator[=] identifier[sqr] operator[SEP] identifier[vDist] operator[SEP] identifier[startPos] , identifier[endPos] operator[SEP] operator[/] literal[Float] operator[+] literal[Float] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[verts] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[m_nav] operator[SEP] identifier[getMaxVertsPerPoly] operator[SEP] operator[SEP] operator[*] Other[3] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[stack] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[Node] identifier[curNode] operator[=] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[curRef] operator[=] identifier[curNode] operator[SEP] identifier[id] operator[SEP] identifier[Tupple2] operator[<] identifier[MeshTile] , identifier[Poly] operator[>] identifier[tileAndPoly] operator[=] identifier[m_nav] operator[SEP] identifier[getTileAndPolyByRefUnsafe] operator[SEP] identifier[curRef] operator[SEP] operator[SEP] identifier[MeshTile] identifier[curTile] operator[=] identifier[tileAndPoly] operator[SEP] identifier[first] operator[SEP] identifier[Poly] identifier[curPoly] operator[=] identifier[tileAndPoly] operator[SEP] identifier[second] operator[SEP] Keyword[int] identifier[nverts] operator[=] identifier[curPoly] operator[SEP] identifier[vertCount] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nverts] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[curTile] operator[SEP] identifier[data] operator[SEP] identifier[verts] , identifier[curPoly] operator[SEP] identifier[verts] operator[SEP] identifier[i] operator[SEP] operator[*] Other[3] , identifier[verts] , identifier[i] operator[*] Other[3] , Other[3] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pointInPolygon] operator[SEP] identifier[endPos] , identifier[verts] , identifier[nverts] operator[SEP] operator[SEP] {
identifier[bestNode] operator[=] identifier[curNode] operator[SEP] identifier[vCopy] operator[SEP] identifier[bestPos] , identifier[endPos] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[j] operator[=] identifier[curPoly] operator[SEP] identifier[vertCount] operator[-] Other[1] operator[SEP] identifier[i] operator[<] identifier[curPoly] operator[SEP] identifier[vertCount] operator[SEP] identifier[j] operator[=] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[MAX_NEIS] operator[=] Other[8] operator[SEP] Keyword[int] identifier[nneis] operator[=] Other[0] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[neis] operator[=] Keyword[new] Keyword[long] operator[SEP] identifier[MAX_NEIS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[curPoly] operator[SEP] identifier[neis] operator[SEP] identifier[j] operator[SEP] operator[&] identifier[NavMesh] operator[SEP] identifier[DT_EXT_LINK] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] identifier[curPoly] operator[SEP] identifier[firstLink] operator[SEP] identifier[k] operator[!=] identifier[NavMesh] operator[SEP] identifier[DT_NULL_LINK] operator[SEP] identifier[k] operator[=] identifier[curTile] operator[SEP] identifier[links] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[next] operator[SEP] {
identifier[Link] identifier[link] operator[=] identifier[curTile] operator[SEP] identifier[links] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[link] operator[SEP] identifier[edge] operator[==] identifier[j] operator[SEP] {
Keyword[if] operator[SEP] identifier[link] operator[SEP] identifier[ref] operator[!=] Other[0] operator[SEP] {
identifier[tileAndPoly] operator[=] identifier[m_nav] operator[SEP] identifier[getTileAndPolyByRefUnsafe] operator[SEP] identifier[link] operator[SEP] identifier[ref] operator[SEP] operator[SEP] identifier[MeshTile] identifier[neiTile] operator[=] identifier[tileAndPoly] operator[SEP] identifier[first] operator[SEP] identifier[Poly] identifier[neiPoly] operator[=] identifier[tileAndPoly] operator[SEP] identifier[second] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[passFilter] operator[SEP] identifier[link] operator[SEP] identifier[ref] , identifier[neiTile] , identifier[neiPoly] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[nneis] operator[<] identifier[MAX_NEIS] operator[SEP] {
identifier[neis] operator[SEP] identifier[nneis] operator[++] operator[SEP] operator[=] identifier[link] operator[SEP] identifier[ref] operator[SEP]
}
}
}
}
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[curPoly] operator[SEP] identifier[neis] operator[SEP] identifier[j] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[int] identifier[idx] operator[=] identifier[curPoly] operator[SEP] identifier[neis] operator[SEP] identifier[j] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[long] identifier[ref] operator[=] identifier[m_nav] operator[SEP] identifier[getPolyRefBase] operator[SEP] identifier[curTile] operator[SEP] operator[|] identifier[idx] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[passFilter] operator[SEP] identifier[ref] , identifier[curTile] , identifier[curTile] operator[SEP] identifier[data] operator[SEP] identifier[polys] operator[SEP] identifier[idx] operator[SEP] operator[SEP] operator[SEP] {
identifier[neis] operator[SEP] identifier[nneis] operator[++] operator[SEP] operator[=] identifier[ref] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[nneis] operator[==] Other[0] operator[SEP] {
Keyword[int] identifier[vj] operator[=] identifier[j] operator[*] Other[3] operator[SEP] Keyword[int] identifier[vi] operator[=] identifier[i] operator[*] Other[3] operator[SEP] identifier[Tupple2] operator[<] identifier[Float] , identifier[Float] operator[>] identifier[distSeg] operator[=] identifier[distancePtSegSqr2D] operator[SEP] identifier[endPos] , identifier[verts] , identifier[vj] , identifier[vi] operator[SEP] operator[SEP] Keyword[float] identifier[distSqr] operator[=] identifier[distSeg] operator[SEP] identifier[first] operator[SEP] Keyword[float] identifier[tseg] operator[=] identifier[distSeg] operator[SEP] identifier[second] operator[SEP] Keyword[if] operator[SEP] identifier[distSqr] operator[<] identifier[bestDist] operator[SEP] {
identifier[bestPos] operator[=] identifier[vLerp] operator[SEP] identifier[verts] , identifier[vj] , identifier[vi] , identifier[tseg] operator[SEP] operator[SEP] identifier[bestDist] operator[=] identifier[distSqr] operator[SEP] identifier[bestNode] operator[=] identifier[curNode] operator[SEP]
}
}
Keyword[else] {
Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[nneis] operator[SEP] operator[++] identifier[k] operator[SEP] {
identifier[Node] identifier[neighbourNode] operator[=] identifier[m_tinyNodePool] operator[SEP] identifier[getNode] operator[SEP] identifier[neis] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[neighbourNode] operator[SEP] identifier[flags] operator[&] identifier[Node] operator[SEP] identifier[DT_NODE_CLOSED] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[int] identifier[vj] operator[=] identifier[j] operator[*] Other[3] operator[SEP] Keyword[int] identifier[vi] operator[=] identifier[i] operator[*] Other[3] operator[SEP] identifier[Tupple2] operator[<] identifier[Float] , identifier[Float] operator[>] identifier[distseg] operator[=] identifier[distancePtSegSqr2D] operator[SEP] identifier[searchPos] , identifier[verts] , identifier[vj] , identifier[vi] operator[SEP] operator[SEP] Keyword[float] identifier[distSqr] operator[=] identifier[distseg] operator[SEP] identifier[first] operator[SEP] Keyword[if] operator[SEP] identifier[distSqr] operator[>] identifier[searchRadSqr] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[neighbourNode] operator[SEP] identifier[pidx] operator[=] identifier[m_tinyNodePool] operator[SEP] identifier[getNodeIdx] operator[SEP] identifier[curNode] operator[SEP] operator[SEP] identifier[neighbourNode] operator[SEP] identifier[flags] operator[|=] identifier[Node] operator[SEP] identifier[DT_NODE_CLOSED] operator[SEP] identifier[stack] operator[SEP] identifier[add] operator[SEP] identifier[neighbourNode] operator[SEP] operator[SEP]
}
}
}
}
identifier[List] operator[<] identifier[Long] operator[>] identifier[visited] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bestNode] operator[!=] Other[null] operator[SEP] {
identifier[Node] identifier[prev] operator[=] Other[null] operator[SEP] identifier[Node] identifier[node] operator[=] identifier[bestNode] operator[SEP] Keyword[do] {
identifier[Node] identifier[next] operator[=] identifier[m_tinyNodePool] operator[SEP] identifier[getNodeAtIdx] operator[SEP] identifier[node] operator[SEP] identifier[pidx] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[pidx] operator[=] identifier[m_tinyNodePool] operator[SEP] identifier[getNodeIdx] operator[SEP] identifier[prev] operator[SEP] operator[SEP] identifier[prev] operator[=] identifier[node] operator[SEP] identifier[node] operator[=] identifier[next] operator[SEP]
}
Keyword[while] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[node] operator[=] identifier[prev] operator[SEP] Keyword[do] {
identifier[visited] operator[SEP] identifier[add] operator[SEP] identifier[node] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[node] operator[=] identifier[m_tinyNodePool] operator[SEP] identifier[getNodeAtIdx] operator[SEP] identifier[node] operator[SEP] identifier[pidx] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] Keyword[new] identifier[MoveAlongSurfaceResult] operator[SEP] identifier[bestPos] , identifier[visited] operator[SEP] operator[SEP] operator[SEP]
}
|
public Optional<AlertCondition> update(AlertCondition condition)
{
return HTTP.PUT(String.format("/v2/alerts_conditions/%d.json", condition.getId()), condition, ALERT_CONDITION);
} | class class_name[name] begin[{]
method[update, return_type[type[Optional]], modifier[public], parameter[condition]] begin[{]
return[call[HTTP.PUT, parameter[call[String.format, parameter[literal["/v2/alerts_conditions/%d.json"], call[condition.getId, parameter[]]]], member[.condition], member[.ALERT_CONDITION]]]]
end[}]
END[}] | Keyword[public] identifier[Optional] operator[<] identifier[AlertCondition] operator[>] identifier[update] operator[SEP] identifier[AlertCondition] identifier[condition] operator[SEP] {
Keyword[return] identifier[HTTP] operator[SEP] identifier[PUT] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[condition] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] , identifier[condition] , identifier[ALERT_CONDITION] operator[SEP] operator[SEP]
}
|
private void ensureColumn(FieldDescriptorDef fieldDef, String checkLevel)
{
if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_COLUMN))
{
String javaname = fieldDef.getName();
if (fieldDef.isNested())
{
int pos = javaname.indexOf("::");
// we convert nested names ('_' for '::')
if (pos > 0)
{
StringBuffer newJavaname = new StringBuffer(javaname.substring(0, pos));
int lastPos = pos + 2;
do
{
pos = javaname.indexOf("::", lastPos);
newJavaname.append("_");
if (pos > 0)
{
newJavaname.append(javaname.substring(lastPos, pos));
lastPos = pos + 2;
}
else
{
newJavaname.append(javaname.substring(lastPos));
}
}
while (pos > 0);
javaname = newJavaname.toString();
}
}
fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_COLUMN, javaname);
}
} | class class_name[name] begin[{]
method[ensureColumn, return_type[void], modifier[private], parameter[fieldDef, checkLevel]] begin[{]
if[call[fieldDef.hasProperty, parameter[member[PropertyHelper.OJB_PROPERTY_COLUMN]]]] begin[{]
local_variable[type[String], javaname]
if[call[fieldDef.isNested, parameter[]]] begin[{]
local_variable[type[int], pos]
if[binary_operation[member[.pos], >, literal[0]]] begin[{]
local_variable[type[StringBuffer], newJavaname]
local_variable[type[int], lastPos]
do[binary_operation[member[.pos], >, literal[0]]] begin[{]
assign[member[.pos], call[javaname.indexOf, parameter[literal["::"], member[.lastPos]]]]
call[newJavaname.append, parameter[literal["_"]]]
if[binary_operation[member[.pos], >, literal[0]]] begin[{]
call[newJavaname.append, parameter[call[javaname.substring, parameter[member[.lastPos], member[.pos]]]]]
assign[member[.lastPos], binary_operation[member[.pos], +, literal[2]]]
else begin[{]
call[newJavaname.append, parameter[call[javaname.substring, parameter[member[.lastPos]]]]]
end[}]
end[}]
assign[member[.javaname], call[newJavaname.toString, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[fieldDef.setProperty, parameter[member[PropertyHelper.OJB_PROPERTY_COLUMN], member[.javaname]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[ensureColumn] operator[SEP] identifier[FieldDescriptorDef] identifier[fieldDef] , identifier[String] identifier[checkLevel] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[fieldDef] operator[SEP] identifier[hasProperty] operator[SEP] identifier[PropertyHelper] operator[SEP] identifier[OJB_PROPERTY_COLUMN] operator[SEP] operator[SEP] {
identifier[String] identifier[javaname] operator[=] identifier[fieldDef] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldDef] operator[SEP] identifier[isNested] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[pos] operator[=] identifier[javaname] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[>] Other[0] operator[SEP] {
identifier[StringBuffer] identifier[newJavaname] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[javaname] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pos] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lastPos] operator[=] identifier[pos] operator[+] Other[2] operator[SEP] Keyword[do] {
identifier[pos] operator[=] identifier[javaname] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[lastPos] operator[SEP] operator[SEP] identifier[newJavaname] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[>] Other[0] operator[SEP] {
identifier[newJavaname] operator[SEP] identifier[append] operator[SEP] identifier[javaname] operator[SEP] identifier[substring] operator[SEP] identifier[lastPos] , identifier[pos] operator[SEP] operator[SEP] operator[SEP] identifier[lastPos] operator[=] identifier[pos] operator[+] Other[2] operator[SEP]
}
Keyword[else] {
identifier[newJavaname] operator[SEP] identifier[append] operator[SEP] identifier[javaname] operator[SEP] identifier[substring] operator[SEP] identifier[lastPos] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] identifier[pos] operator[>] Other[0] operator[SEP] operator[SEP] identifier[javaname] operator[=] identifier[newJavaname] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[fieldDef] operator[SEP] identifier[setProperty] operator[SEP] identifier[PropertyHelper] operator[SEP] identifier[OJB_PROPERTY_COLUMN] , identifier[javaname] operator[SEP] operator[SEP]
}
}
|
private static void addFunctionDependence(Function function, Procedure procedure, Statement catalogStmt) {
String funcDeps = function.getStmtdependers();
Set<String> stmtSet = new TreeSet<>();
for (String stmtName : funcDeps.split(",")) {
if (! stmtName.isEmpty()) {
stmtSet.add(stmtName);
}
}
String statementName = procedure.getTypeName() + ":" + catalogStmt.getTypeName();
if (stmtSet.contains(statementName)) {
return;
}
stmtSet.add(statementName);
StringBuilder sb = new StringBuilder();
// We will add this procedure:statement pair. So make sure we have
// an initial comma. Note that an empty set must be represented
// by an empty string. We represent the set {pp:ss, qq:tt},
// where "pp" and "qq" are procedures and "ss" and "tt" are
// statements in their procedures respectively, with
// the string ",pp:ss,qq:tt,". If we search for "pp:ss" we will
// never find "ppp:sss" by accident.
//
// Do to this, when we add something to string we start with a single
// comma, and then add "qq:tt," at the end.
sb.append(",");
for (String stmtName : stmtSet) {
sb.append(stmtName + ",");
}
function.setStmtdependers(sb.toString());
} | class class_name[name] begin[{]
method[addFunctionDependence, return_type[void], modifier[private static], parameter[function, procedure, catalogStmt]] begin[{]
local_variable[type[String], funcDeps]
local_variable[type[Set], stmtSet]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=stmtName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stmtName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=stmtSet, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=split, postfix_operators=[], prefix_operators=[], qualifier=funcDeps, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stmtName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
local_variable[type[String], statementName]
if[call[stmtSet.contains, parameter[member[.statementName]]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[stmtSet.add, parameter[member[.statementName]]]
local_variable[type[StringBuilder], sb]
call[sb.append, parameter[literal[","]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=stmtName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=stmtSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stmtName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[function.setStmtdependers, parameter[call[sb.toString, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[addFunctionDependence] operator[SEP] identifier[Function] identifier[function] , identifier[Procedure] identifier[procedure] , identifier[Statement] identifier[catalogStmt] operator[SEP] {
identifier[String] identifier[funcDeps] operator[=] identifier[function] operator[SEP] identifier[getStmtdependers] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[stmtSet] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[stmtName] operator[:] identifier[funcDeps] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[stmtName] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[stmtSet] operator[SEP] identifier[add] operator[SEP] identifier[stmtName] operator[SEP] operator[SEP]
}
}
identifier[String] identifier[statementName] operator[=] identifier[procedure] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[catalogStmt] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stmtSet] operator[SEP] identifier[contains] operator[SEP] identifier[statementName] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[stmtSet] operator[SEP] identifier[add] operator[SEP] identifier[statementName] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[stmtName] operator[:] identifier[stmtSet] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[stmtName] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[function] operator[SEP] identifier[setStmtdependers] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void cleanFlagReactiveCenter(IAtomContainer ac) {
for (int j = 0; j < ac.getAtomCount(); j++)
ac.getAtom(j).setFlag(CDKConstants.REACTIVE_CENTER, false);
for (int j = 0; j < ac.getBondCount(); j++)
ac.getBond(j).setFlag(CDKConstants.REACTIVE_CENTER, false);
} | class class_name[name] begin[{]
method[cleanFlagReactiveCenter, return_type[void], modifier[private], parameter[ac]] begin[{]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[MethodInvocation(arguments=[MemberReference(member=REACTIVE_CENTER, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setFlag, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBond, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[MethodInvocation(arguments=[MemberReference(member=REACTIVE_CENTER, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setFlag, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getBondCount, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[cleanFlagReactiveCenter] operator[SEP] identifier[IAtomContainer] identifier[ac] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[ac] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[ac] operator[SEP] identifier[getAtom] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[setFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[REACTIVE_CENTER] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[ac] operator[SEP] identifier[getBondCount] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[ac] operator[SEP] identifier[getBond] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[setFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[REACTIVE_CENTER] , literal[boolean] operator[SEP] operator[SEP]
}
|
private PGPKeyRingGenerator createKeyRingGenerator(String userId, String password, int keySize) {
LOGGER.trace("createKeyRingGenerator(String, String, int)");
LOGGER.trace("User ID: {}, Password: {}, Key Size: {}", userId, password == null ? "not set" : "********", keySize);
PGPKeyRingGenerator generator = null;
try {
LOGGER.debug("Creating RSA key pair generator");
RSAKeyPairGenerator generator1 = new RSAKeyPairGenerator();
generator1.init(new RSAKeyGenerationParameters(BigInteger.valueOf(0x10001), getSecureRandom(), keySize, 12));
LOGGER.debug("Generating Signing Key Pair");
BcPGPKeyPair signingKeyPair = new BcPGPKeyPair(PGPPublicKey.RSA_SIGN, generator1.generateKeyPair(), new Date());
LOGGER.debug("Generating Encyption Key Pair");
BcPGPKeyPair encryptionKeyPair = new BcPGPKeyPair(PGPPublicKey.RSA_ENCRYPT, generator1.generateKeyPair(), new Date());
LOGGER.debug("Generating Signature Key Properties");
PGPSignatureSubpacketGenerator signatureSubpacketGenerator = new PGPSignatureSubpacketGenerator();
signatureSubpacketGenerator.setKeyFlags(false, KeyFlags.SIGN_DATA | KeyFlags.CERTIFY_OTHER);
signatureSubpacketGenerator.setPreferredSymmetricAlgorithms(false, getPreferredEncryptionAlgorithms());
signatureSubpacketGenerator.setPreferredHashAlgorithms(false, getPreferredHashingAlgorithms());
signatureSubpacketGenerator.setPreferredCompressionAlgorithms(false, getPreferredCompressionAlgorithms());
LOGGER.debug("Generating Encyption Key Properties");
PGPSignatureSubpacketGenerator encryptionSubpacketGenerator = new PGPSignatureSubpacketGenerator();
encryptionSubpacketGenerator.setKeyFlags(false, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE);
LOGGER.info("Creating PGP Key Ring Generator");
generator = new PGPKeyRingGenerator(PGPPublicKey.RSA_SIGN, signingKeyPair, userId, new BcPGPDigestCalculatorProvider().get(HashAlgorithmTags.SHA1), signatureSubpacketGenerator.generate(), null, new BcPGPContentSignerBuilder(PGPPublicKey.RSA_SIGN, HashAlgorithmTags.SHA256), new BcPBESecretKeyEncryptorBuilder(getEncryptionAlgorithm()).build(password.toCharArray()));
generator.addSubKey(encryptionKeyPair, encryptionSubpacketGenerator.generate(), null);
} catch (PGPException e) {
LOGGER.error("{}", e.getMessage());
generator = null;
}
return generator;
} | class class_name[name] begin[{]
method[createKeyRingGenerator, return_type[type[PGPKeyRingGenerator]], modifier[private], parameter[userId, password, keySize]] begin[{]
call[LOGGER.trace, parameter[literal["createKeyRingGenerator(String, String, int)"]]]
call[LOGGER.trace, parameter[literal["User ID: {}, Password: {}, Key Size: {}"], member[.userId], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=password, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="********"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not set")), member[.keySize]]]
local_variable[type[PGPKeyRingGenerator], generator]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Creating RSA key pair generator")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RSAKeyPairGenerator, sub_type=None)), name=generator1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RSAKeyPairGenerator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x10001)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=BigInteger, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSecureRandom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=keySize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RSAKeyGenerationParameters, sub_type=None))], member=init, postfix_operators=[], prefix_operators=[], qualifier=generator1, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Generating Signing Key Pair")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=RSA_SIGN, postfix_operators=[], prefix_operators=[], qualifier=PGPPublicKey, selectors=[]), MethodInvocation(arguments=[], member=generateKeyPair, postfix_operators=[], prefix_operators=[], qualifier=generator1, selectors=[], type_arguments=None), 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))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BcPGPKeyPair, sub_type=None)), name=signingKeyPair)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BcPGPKeyPair, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Generating Encyption Key Pair")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=RSA_ENCRYPT, postfix_operators=[], prefix_operators=[], qualifier=PGPPublicKey, selectors=[]), MethodInvocation(arguments=[], member=generateKeyPair, postfix_operators=[], prefix_operators=[], qualifier=generator1, selectors=[], type_arguments=None), 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))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BcPGPKeyPair, sub_type=None)), name=encryptionKeyPair)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BcPGPKeyPair, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Generating Signature Key Properties")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PGPSignatureSubpacketGenerator, sub_type=None)), name=signatureSubpacketGenerator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PGPSignatureSubpacketGenerator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), BinaryOperation(operandl=MemberReference(member=SIGN_DATA, postfix_operators=[], prefix_operators=[], qualifier=KeyFlags, selectors=[]), operandr=MemberReference(member=CERTIFY_OTHER, postfix_operators=[], prefix_operators=[], qualifier=KeyFlags, selectors=[]), operator=|)], member=setKeyFlags, postfix_operators=[], prefix_operators=[], qualifier=signatureSubpacketGenerator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MethodInvocation(arguments=[], member=getPreferredEncryptionAlgorithms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setPreferredSymmetricAlgorithms, postfix_operators=[], prefix_operators=[], qualifier=signatureSubpacketGenerator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MethodInvocation(arguments=[], member=getPreferredHashingAlgorithms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setPreferredHashAlgorithms, postfix_operators=[], prefix_operators=[], qualifier=signatureSubpacketGenerator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MethodInvocation(arguments=[], member=getPreferredCompressionAlgorithms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setPreferredCompressionAlgorithms, postfix_operators=[], prefix_operators=[], qualifier=signatureSubpacketGenerator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Generating Encyption Key Properties")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PGPSignatureSubpacketGenerator, sub_type=None)), name=encryptionSubpacketGenerator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PGPSignatureSubpacketGenerator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), BinaryOperation(operandl=MemberReference(member=ENCRYPT_COMMS, postfix_operators=[], prefix_operators=[], qualifier=KeyFlags, selectors=[]), operandr=MemberReference(member=ENCRYPT_STORAGE, postfix_operators=[], prefix_operators=[], qualifier=KeyFlags, selectors=[]), operator=|)], member=setKeyFlags, postfix_operators=[], prefix_operators=[], qualifier=encryptionSubpacketGenerator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Creating PGP Key Ring Generator")], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=generator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=RSA_SIGN, postfix_operators=[], prefix_operators=[], qualifier=PGPPublicKey, selectors=[]), MemberReference(member=signingKeyPair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=SHA1, postfix_operators=[], prefix_operators=[], qualifier=HashAlgorithmTags, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BcPGPDigestCalculatorProvider, sub_type=None)), MethodInvocation(arguments=[], member=generate, postfix_operators=[], prefix_operators=[], qualifier=signatureSubpacketGenerator, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[MemberReference(member=RSA_SIGN, postfix_operators=[], prefix_operators=[], qualifier=PGPPublicKey, selectors=[]), MemberReference(member=SHA256, postfix_operators=[], prefix_operators=[], qualifier=HashAlgorithmTags, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BcPGPContentSignerBuilder, sub_type=None)), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getEncryptionAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=password, selectors=[], type_arguments=None)], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BcPBESecretKeyEncryptorBuilder, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PGPKeyRingGenerator, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=encryptionKeyPair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=generate, postfix_operators=[], prefix_operators=[], qualifier=encryptionSubpacketGenerator, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=addSubKey, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=generator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PGPException']))], finally_block=None, label=None, resources=None)
return[member[.generator]]
end[}]
END[}] | Keyword[private] identifier[PGPKeyRingGenerator] identifier[createKeyRingGenerator] operator[SEP] identifier[String] identifier[userId] , identifier[String] identifier[password] , Keyword[int] identifier[keySize] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[userId] , identifier[password] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] , identifier[keySize] operator[SEP] operator[SEP] identifier[PGPKeyRingGenerator] identifier[generator] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[RSAKeyPairGenerator] identifier[generator1] operator[=] Keyword[new] identifier[RSAKeyPairGenerator] operator[SEP] operator[SEP] operator[SEP] identifier[generator1] operator[SEP] identifier[init] operator[SEP] Keyword[new] identifier[RSAKeyGenerationParameters] operator[SEP] identifier[BigInteger] operator[SEP] identifier[valueOf] operator[SEP] literal[Integer] operator[SEP] , identifier[getSecureRandom] operator[SEP] operator[SEP] , identifier[keySize] , Other[12] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[BcPGPKeyPair] identifier[signingKeyPair] operator[=] Keyword[new] identifier[BcPGPKeyPair] operator[SEP] identifier[PGPPublicKey] operator[SEP] identifier[RSA_SIGN] , identifier[generator1] operator[SEP] identifier[generateKeyPair] operator[SEP] operator[SEP] , Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[BcPGPKeyPair] identifier[encryptionKeyPair] operator[=] Keyword[new] identifier[BcPGPKeyPair] operator[SEP] identifier[PGPPublicKey] operator[SEP] identifier[RSA_ENCRYPT] , identifier[generator1] operator[SEP] identifier[generateKeyPair] operator[SEP] operator[SEP] , Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PGPSignatureSubpacketGenerator] identifier[signatureSubpacketGenerator] operator[=] Keyword[new] identifier[PGPSignatureSubpacketGenerator] operator[SEP] operator[SEP] operator[SEP] identifier[signatureSubpacketGenerator] operator[SEP] identifier[setKeyFlags] operator[SEP] literal[boolean] , identifier[KeyFlags] operator[SEP] identifier[SIGN_DATA] operator[|] identifier[KeyFlags] operator[SEP] identifier[CERTIFY_OTHER] operator[SEP] operator[SEP] identifier[signatureSubpacketGenerator] operator[SEP] identifier[setPreferredSymmetricAlgorithms] operator[SEP] literal[boolean] , identifier[getPreferredEncryptionAlgorithms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[signatureSubpacketGenerator] operator[SEP] identifier[setPreferredHashAlgorithms] operator[SEP] literal[boolean] , identifier[getPreferredHashingAlgorithms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[signatureSubpacketGenerator] operator[SEP] identifier[setPreferredCompressionAlgorithms] operator[SEP] literal[boolean] , identifier[getPreferredCompressionAlgorithms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PGPSignatureSubpacketGenerator] identifier[encryptionSubpacketGenerator] operator[=] Keyword[new] identifier[PGPSignatureSubpacketGenerator] operator[SEP] operator[SEP] operator[SEP] identifier[encryptionSubpacketGenerator] operator[SEP] identifier[setKeyFlags] operator[SEP] literal[boolean] , identifier[KeyFlags] operator[SEP] identifier[ENCRYPT_COMMS] operator[|] identifier[KeyFlags] operator[SEP] identifier[ENCRYPT_STORAGE] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[generator] operator[=] Keyword[new] identifier[PGPKeyRingGenerator] operator[SEP] identifier[PGPPublicKey] operator[SEP] identifier[RSA_SIGN] , identifier[signingKeyPair] , identifier[userId] , Keyword[new] identifier[BcPGPDigestCalculatorProvider] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[HashAlgorithmTags] operator[SEP] identifier[SHA1] operator[SEP] , identifier[signatureSubpacketGenerator] operator[SEP] identifier[generate] operator[SEP] operator[SEP] , Other[null] , Keyword[new] identifier[BcPGPContentSignerBuilder] operator[SEP] identifier[PGPPublicKey] operator[SEP] identifier[RSA_SIGN] , identifier[HashAlgorithmTags] operator[SEP] identifier[SHA256] operator[SEP] , Keyword[new] identifier[BcPBESecretKeyEncryptorBuilder] operator[SEP] identifier[getEncryptionAlgorithm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] identifier[password] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[generator] operator[SEP] identifier[addSubKey] operator[SEP] identifier[encryptionKeyPair] , identifier[encryptionSubpacketGenerator] operator[SEP] identifier[generate] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[PGPException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[generator] operator[=] Other[null] operator[SEP]
}
Keyword[return] identifier[generator] operator[SEP]
}
|
public void addSite(String siteKey) {
ValueMap gv = new ValueMap(siteKey);
if (!this.valueMaps.contains(gv)) {
this.valueMaps.add(gv);
}
} | class class_name[name] begin[{]
method[addSite, return_type[void], modifier[public], parameter[siteKey]] begin[{]
local_variable[type[ValueMap], gv]
if[THIS[member[None.valueMaps]call[None.contains, parameter[member[.gv]]]]] begin[{]
THIS[member[None.valueMaps]call[None.add, parameter[member[.gv]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addSite] operator[SEP] identifier[String] identifier[siteKey] operator[SEP] {
identifier[ValueMap] identifier[gv] operator[=] Keyword[new] identifier[ValueMap] operator[SEP] identifier[siteKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[valueMaps] operator[SEP] identifier[contains] operator[SEP] identifier[gv] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[valueMaps] operator[SEP] identifier[add] operator[SEP] identifier[gv] operator[SEP] operator[SEP]
}
}
|
public static void dec_lag3( /* Decode the pitch lag */
int index, /* input : received pitch index */
int pit_min, /* input : minimum pitch lag */
int pit_max, /* input : maximum pitch lag */
int i_subfr, /* input : subframe flag */
IntegerPointer T0, /* output: integer part of pitch lag */
IntegerPointer T0_frac /* output: fractional part of pitch lag */
)
{
int i;
int T0_min, T0_max;
if (i_subfr == 0) /* if 1st subframe */
{
if (index < 197)
{
T0.value = (index+2)/3 + 19;
T0_frac.value = index - T0.value*3 + 58;
}
else
{
T0.value = index - 112;
T0_frac.value = 0;
}
}
else /* second subframe */
{
/* find T0_min and T0_max for 2nd subframe */
T0_min = T0.value - 5;
if (T0_min < pit_min)
T0_min = pit_min;
T0_max = T0_min + 9;
if(T0_max > pit_max)
{
T0_max = pit_max;
T0_min = T0_max -9;
}
i = (index+2)/3 - 1;
T0.value = i + T0_min;
T0_frac.value = index - 2 - i*3;
}
return;
} | class class_name[name] begin[{]
method[dec_lag3, return_type[void], modifier[public static], parameter[index, pit_min, pit_max, i_subfr, T0, T0_frac]] begin[{]
local_variable[type[int], i]
local_variable[type[int], T0_min]
if[binary_operation[member[.i_subfr], ==, literal[0]]] begin[{]
if[binary_operation[member[.index], <, literal[197]]] begin[{]
assign[member[T0.value], binary_operation[binary_operation[binary_operation[member[.index], +, literal[2]], /, literal[3]], +, literal[19]]]
assign[member[T0_frac.value], binary_operation[binary_operation[member[.index], -, binary_operation[member[T0.value], *, literal[3]]], +, literal[58]]]
else begin[{]
assign[member[T0.value], binary_operation[member[.index], -, literal[112]]]
assign[member[T0_frac.value], literal[0]]
end[}]
else begin[{]
assign[member[.T0_min], binary_operation[member[T0.value], -, literal[5]]]
if[binary_operation[member[.T0_min], <, member[.pit_min]]] begin[{]
assign[member[.T0_min], member[.pit_min]]
else begin[{]
None
end[}]
assign[member[.T0_max], binary_operation[member[.T0_min], +, literal[9]]]
if[binary_operation[member[.T0_max], >, member[.pit_max]]] begin[{]
assign[member[.T0_max], member[.pit_max]]
assign[member[.T0_min], binary_operation[member[.T0_max], -, literal[9]]]
else begin[{]
None
end[}]
assign[member[.i], binary_operation[binary_operation[binary_operation[member[.index], +, literal[2]], /, literal[3]], -, literal[1]]]
assign[member[T0.value], binary_operation[member[.i], +, member[.T0_min]]]
assign[member[T0_frac.value], binary_operation[binary_operation[member[.index], -, literal[2]], -, binary_operation[member[.i], *, literal[3]]]]
end[}]
return[None]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[dec_lag3] operator[SEP] Keyword[int] identifier[index] , Keyword[int] identifier[pit_min] , Keyword[int] identifier[pit_max] , Keyword[int] identifier[i_subfr] , identifier[IntegerPointer] identifier[T0] , identifier[IntegerPointer] identifier[T0_frac] operator[SEP] {
Keyword[int] identifier[i] operator[SEP] Keyword[int] identifier[T0_min] , identifier[T0_max] operator[SEP] Keyword[if] operator[SEP] identifier[i_subfr] operator[==] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[<] Other[197] operator[SEP] {
identifier[T0] operator[SEP] identifier[value] operator[=] operator[SEP] identifier[index] operator[+] Other[2] operator[SEP] operator[/] Other[3] operator[+] Other[19] operator[SEP] identifier[T0_frac] operator[SEP] identifier[value] operator[=] identifier[index] operator[-] identifier[T0] operator[SEP] identifier[value] operator[*] Other[3] operator[+] Other[58] operator[SEP]
}
Keyword[else] {
identifier[T0] operator[SEP] identifier[value] operator[=] identifier[index] operator[-] Other[112] operator[SEP] identifier[T0_frac] operator[SEP] identifier[value] operator[=] Other[0] operator[SEP]
}
}
Keyword[else] {
identifier[T0_min] operator[=] identifier[T0] operator[SEP] identifier[value] operator[-] Other[5] operator[SEP] Keyword[if] operator[SEP] identifier[T0_min] operator[<] identifier[pit_min] operator[SEP] identifier[T0_min] operator[=] identifier[pit_min] operator[SEP] identifier[T0_max] operator[=] identifier[T0_min] operator[+] Other[9] operator[SEP] Keyword[if] operator[SEP] identifier[T0_max] operator[>] identifier[pit_max] operator[SEP] {
identifier[T0_max] operator[=] identifier[pit_max] operator[SEP] identifier[T0_min] operator[=] identifier[T0_max] operator[-] Other[9] operator[SEP]
}
identifier[i] operator[=] operator[SEP] identifier[index] operator[+] Other[2] operator[SEP] operator[/] Other[3] operator[-] Other[1] operator[SEP] identifier[T0] operator[SEP] identifier[value] operator[=] identifier[i] operator[+] identifier[T0_min] operator[SEP] identifier[T0_frac] operator[SEP] identifier[value] operator[=] identifier[index] operator[-] Other[2] operator[-] identifier[i] operator[*] Other[3] operator[SEP]
}
Keyword[return] operator[SEP]
}
|
public static final ThreadHistoryEvent created(long threadId, String threadName){
return new ThreadHistoryEvent(threadId, threadName, OPERATION.CREATED);
} | class class_name[name] begin[{]
method[created, return_type[type[ThreadHistoryEvent]], modifier[final public static], parameter[threadId, threadName]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=threadId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=threadName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CREATED, postfix_operators=[], prefix_operators=[], qualifier=OPERATION, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThreadHistoryEvent, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[ThreadHistoryEvent] identifier[created] operator[SEP] Keyword[long] identifier[threadId] , identifier[String] identifier[threadName] operator[SEP] {
Keyword[return] Keyword[new] identifier[ThreadHistoryEvent] operator[SEP] identifier[threadId] , identifier[threadName] , identifier[OPERATION] operator[SEP] identifier[CREATED] operator[SEP] operator[SEP]
}
|
void switchTwoRows(int rowIndex, int rowToIndex) {
checkForInit();
int cellData = mRowHeights[rowToIndex];
mRowHeights[rowToIndex] = mRowHeights[rowIndex];
mRowHeights[rowIndex] = cellData;
} | class class_name[name] begin[{]
method[switchTwoRows, return_type[void], modifier[default], parameter[rowIndex, rowToIndex]] begin[{]
call[.checkForInit, parameter[]]
local_variable[type[int], cellData]
assign[member[.mRowHeights], member[.mRowHeights]]
assign[member[.mRowHeights], member[.cellData]]
end[}]
END[}] | Keyword[void] identifier[switchTwoRows] operator[SEP] Keyword[int] identifier[rowIndex] , Keyword[int] identifier[rowToIndex] operator[SEP] {
identifier[checkForInit] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[cellData] operator[=] identifier[mRowHeights] operator[SEP] identifier[rowToIndex] operator[SEP] operator[SEP] identifier[mRowHeights] operator[SEP] identifier[rowToIndex] operator[SEP] operator[=] identifier[mRowHeights] operator[SEP] identifier[rowIndex] operator[SEP] operator[SEP] identifier[mRowHeights] operator[SEP] identifier[rowIndex] operator[SEP] operator[=] identifier[cellData] operator[SEP]
}
|
public Observable<DatabaseInner> pauseAsync(String resourceGroupName, String serverName, String databaseName) {
return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() {
@Override
public DatabaseInner call(ServiceResponse<DatabaseInner> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[pauseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, serverName, databaseName]] begin[{]
return[call[.pauseWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.databaseName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[DatabaseInner] operator[>] identifier[pauseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[databaseName] operator[SEP] {
Keyword[return] identifier[pauseWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[databaseName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[DatabaseInner] operator[>] , identifier[DatabaseInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[DatabaseInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[DatabaseInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static boolean cs_happly(DZcs V, int i, double beta, DZcsa x)
{
int p, Vp[], Vi[] ;
DZcsa Vx = new DZcsa() ;
double[] tau = cs_czero() ;
if (!CS_CSC (V) || x == null) return (false) ; /* check inputs */
Vp = V.p ; Vi = V.i ; Vx.x = V.x ;
for (p = Vp [i] ; p < Vp [i+1] ; p++) /* tau = v'*x */
{
tau = cs_cplus(tau, cs_cmult(cs_conj(Vx.get(p)), x.get(Vi [p]))) ;
}
tau = cs_cmult(tau, beta) ; /* tau = beta*(v'*x) */
for (p = Vp [i] ; p < Vp [i+1] ; p++) /* x = x - v*tau */
{
x.set(Vi [p], cs_cminus(x.get(Vi [p]), cs_cmult(Vx.get(p), tau))) ;
}
return (true) ;
} | class class_name[name] begin[{]
method[cs_happly, return_type[type[boolean]], modifier[public static], parameter[V, i, beta, x]] begin[{]
local_variable[type[int], p]
local_variable[type[DZcsa], Vx]
local_variable[type[double], tau]
if[binary_operation[call[.CS_CSC, parameter[member[.V]]], ||, binary_operation[member[.x], ==, literal[null]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.Vp], member[V.p]]
assign[member[.Vi], member[V.i]]
assign[member[Vx.x], member[V.x]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tau, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tau, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=Vx, selectors=[], type_arguments=None)], member=cs_conj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=Vi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None)], member=cs_cmult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=cs_cplus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=Vp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operator=<), init=[Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=Vp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))], update=[MemberReference(member=p, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.tau], call[.cs_cmult, parameter[member[.tau], member[.beta]]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=Vi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=Vi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=Vx, selectors=[], type_arguments=None), MemberReference(member=tau, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cs_cmult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=cs_cminus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=Vp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operator=<), init=[Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=Vp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))], update=[MemberReference(member=p, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[cs_happly] operator[SEP] identifier[DZcs] identifier[V] , Keyword[int] identifier[i] , Keyword[double] identifier[beta] , identifier[DZcsa] identifier[x] operator[SEP] {
Keyword[int] identifier[p] , identifier[Vp] operator[SEP] operator[SEP] , identifier[Vi] operator[SEP] operator[SEP] operator[SEP] identifier[DZcsa] identifier[Vx] operator[=] Keyword[new] identifier[DZcsa] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[tau] operator[=] identifier[cs_czero] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[CS_CSC] operator[SEP] identifier[V] operator[SEP] operator[||] identifier[x] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Vp] operator[=] identifier[V] operator[SEP] identifier[p] operator[SEP] identifier[Vi] operator[=] identifier[V] operator[SEP] identifier[i] operator[SEP] identifier[Vx] operator[SEP] identifier[x] operator[=] identifier[V] operator[SEP] identifier[x] operator[SEP] Keyword[for] operator[SEP] identifier[p] operator[=] identifier[Vp] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[p] operator[<] identifier[Vp] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[p] operator[++] operator[SEP] {
identifier[tau] operator[=] identifier[cs_cplus] operator[SEP] identifier[tau] , identifier[cs_cmult] operator[SEP] identifier[cs_conj] operator[SEP] identifier[Vx] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] operator[SEP] , identifier[x] operator[SEP] identifier[get] operator[SEP] identifier[Vi] operator[SEP] identifier[p] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[tau] operator[=] identifier[cs_cmult] operator[SEP] identifier[tau] , identifier[beta] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[p] operator[=] identifier[Vp] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[p] operator[<] identifier[Vp] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[p] operator[++] operator[SEP] {
identifier[x] operator[SEP] identifier[set] operator[SEP] identifier[Vi] operator[SEP] identifier[p] operator[SEP] , identifier[cs_cminus] operator[SEP] identifier[x] operator[SEP] identifier[get] operator[SEP] identifier[Vi] operator[SEP] identifier[p] operator[SEP] operator[SEP] , identifier[cs_cmult] operator[SEP] identifier[Vx] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] , identifier[tau] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
|
public static List<Pattern> getNoProxyHostPatterns(String noProxyHost) {
if (noProxyHost==null) return Collections.emptyList();
List<Pattern> r = Lists.newArrayList();
for (String s : noProxyHost.split("[ \t\n,|]+")) {
if (s.length()==0) continue;
r.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*")));
}
return r;
} | class class_name[name] begin[{]
method[getNoProxyHostPatterns, return_type[type[List]], modifier[public static], parameter[noProxyHost]] begin[{]
if[binary_operation[member[.noProxyHost], ==, literal[null]]] begin[{]
return[call[Collections.emptyList, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[List], r]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\.")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".*")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[ \t\n,|]+")], member=split, postfix_operators=[], prefix_operators=[], qualifier=noProxyHost, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.r]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Pattern] operator[>] identifier[getNoProxyHostPatterns] operator[SEP] identifier[String] identifier[noProxyHost] operator[SEP] {
Keyword[if] operator[SEP] identifier[noProxyHost] operator[==] Other[null] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Pattern] operator[>] identifier[r] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[noProxyHost] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[continue] operator[SEP] identifier[r] operator[SEP] identifier[add] operator[SEP] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[s] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[r] operator[SEP]
}
|
private VoltTable[] aggregateProcedureStats(VoltTable[] baseStats)
{
if (baseStats == null || baseStats.length != 1) {
return baseStats;
}
VoltTable result = new VoltTable(
new ColumnInfo("TIMESTAMP", VoltType.BIGINT),
new ColumnInfo(VoltSystemProcedure.CNAME_HOST_ID, VoltSystemProcedure.CTYPE_ID),
new ColumnInfo("HOSTNAME", VoltType.STRING),
new ColumnInfo(VoltSystemProcedure.CNAME_SITE_ID, VoltSystemProcedure.CTYPE_ID),
new ColumnInfo("PARTITION_ID", VoltType.INTEGER),
new ColumnInfo("PROCEDURE", VoltType.STRING),
new ColumnInfo("INVOCATIONS", VoltType.BIGINT),
new ColumnInfo("TIMED_INVOCATIONS", VoltType.BIGINT),
new ColumnInfo("MIN_EXECUTION_TIME", VoltType.BIGINT),
new ColumnInfo("MAX_EXECUTION_TIME", VoltType.BIGINT),
new ColumnInfo("AVG_EXECUTION_TIME", VoltType.BIGINT),
new ColumnInfo("MIN_RESULT_SIZE", VoltType.INTEGER),
new ColumnInfo("MAX_RESULT_SIZE", VoltType.INTEGER),
new ColumnInfo("AVG_RESULT_SIZE", VoltType.INTEGER),
new ColumnInfo("MIN_PARAMETER_SET_SIZE", VoltType.INTEGER),
new ColumnInfo("MAX_PARAMETER_SET_SIZE", VoltType.INTEGER),
new ColumnInfo("AVG_PARAMETER_SET_SIZE", VoltType.INTEGER),
new ColumnInfo("ABORTS", VoltType.BIGINT),
new ColumnInfo("FAILURES", VoltType.BIGINT),
new ColumnInfo("TRANSACTIONAL", VoltType.TINYINT));
baseStats[0].resetRowPosition();
while (baseStats[0].advanceRow()) {
if (baseStats[0].getString("STATEMENT").equalsIgnoreCase("<ALL>")) {
result.addRow(
baseStats[0].getLong("TIMESTAMP"),
baseStats[0].getLong(VoltSystemProcedure.CNAME_HOST_ID),
baseStats[0].getString("HOSTNAME"),
baseStats[0].getLong(VoltSystemProcedure.CNAME_SITE_ID),
baseStats[0].getLong("PARTITION_ID"),
baseStats[0].getString("PROCEDURE"),
baseStats[0].getLong("INVOCATIONS"),
baseStats[0].getLong("TIMED_INVOCATIONS"),
baseStats[0].getLong("MIN_EXECUTION_TIME"),
baseStats[0].getLong("MAX_EXECUTION_TIME"),
baseStats[0].getLong("AVG_EXECUTION_TIME"),
baseStats[0].getLong("MIN_RESULT_SIZE"),
baseStats[0].getLong("MAX_RESULT_SIZE"),
baseStats[0].getLong("AVG_RESULT_SIZE"),
baseStats[0].getLong("MIN_PARAMETER_SET_SIZE"),
baseStats[0].getLong("MAX_PARAMETER_SET_SIZE"),
baseStats[0].getLong("AVG_PARAMETER_SET_SIZE"),
baseStats[0].getLong("ABORTS"),
baseStats[0].getLong("FAILURES"),
(byte) baseStats[0].getLong("TRANSACTIONAL"));
}
}
return new VoltTable[] { result };
} | class class_name[name] begin[{]
method[aggregateProcedureStats, return_type[type[VoltTable]], modifier[private], parameter[baseStats]] begin[{]
if[binary_operation[binary_operation[member[.baseStats], ==, literal[null]], ||, binary_operation[member[baseStats.length], !=, literal[1]]]] begin[{]
return[member[.baseStats]]
else begin[{]
None
end[}]
local_variable[type[VoltTable], result]
member[.baseStats]
while[member[.baseStats]] begin[{]
if[member[.baseStats]] begin[{]
call[result.addRow, parameter[member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], member[.baseStats], Cast(expression=MemberReference(member=baseStats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TRANSACTIONAL")], member=getLong, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=BasicType(dimensions=[], name=byte))]]
else begin[{]
None
end[}]
end[}]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VoltTable, sub_type=None))]
end[}]
END[}] | Keyword[private] identifier[VoltTable] operator[SEP] operator[SEP] identifier[aggregateProcedureStats] operator[SEP] identifier[VoltTable] operator[SEP] operator[SEP] identifier[baseStats] operator[SEP] {
Keyword[if] operator[SEP] identifier[baseStats] operator[==] Other[null] operator[||] identifier[baseStats] operator[SEP] identifier[length] operator[!=] Other[1] operator[SEP] {
Keyword[return] identifier[baseStats] operator[SEP]
}
identifier[VoltTable] identifier[result] operator[=] Keyword[new] identifier[VoltTable] operator[SEP] Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] identifier[VoltSystemProcedure] operator[SEP] identifier[CNAME_HOST_ID] , identifier[VoltSystemProcedure] operator[SEP] identifier[CTYPE_ID] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[STRING] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] identifier[VoltSystemProcedure] operator[SEP] identifier[CNAME_SITE_ID] , identifier[VoltSystemProcedure] operator[SEP] identifier[CTYPE_ID] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[INTEGER] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[STRING] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[INTEGER] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[INTEGER] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[INTEGER] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[INTEGER] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[INTEGER] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[INTEGER] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[BIGINT] operator[SEP] , Keyword[new] identifier[ColumnInfo] operator[SEP] literal[String] , identifier[VoltType] operator[SEP] identifier[TINYINT] operator[SEP] operator[SEP] operator[SEP] identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[resetRowPosition] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[advanceRow] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[addRow] operator[SEP] identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] identifier[VoltSystemProcedure] operator[SEP] identifier[CNAME_HOST_ID] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] identifier[VoltSystemProcedure] operator[SEP] identifier[CNAME_SITE_ID] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] identifier[baseStats] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[VoltTable] operator[SEP] operator[SEP] {
identifier[result]
} operator[SEP]
}
|
public static Polynomial wrap( double ...coefficients ) {
Polynomial p = new Polynomial(coefficients.length);
p.setTo(coefficients,coefficients.length);
return p;
} | class class_name[name] begin[{]
method[wrap, return_type[type[Polynomial]], modifier[public static], parameter[coefficients]] begin[{]
local_variable[type[Polynomial], p]
call[p.setTo, parameter[member[.coefficients], member[coefficients.length]]]
return[member[.p]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Polynomial] identifier[wrap] operator[SEP] Keyword[double] operator[...] identifier[coefficients] operator[SEP] {
identifier[Polynomial] identifier[p] operator[=] Keyword[new] identifier[Polynomial] operator[SEP] identifier[coefficients] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[setTo] operator[SEP] identifier[coefficients] , identifier[coefficients] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[p] operator[SEP]
}
|
private static boolean matchesPrototypeInstanceVar(Node node, NodeMetadata metadata,
String name) {
String[] parts = name.split(".prototype.");
String className = parts[0];
String propertyName = parts[1];
JSType providedJsType = getJsType(metadata, className);
if (providedJsType == null) {
return false;
}
JSType jsType = null;
if (node.hasChildren()) {
jsType = node.getFirstChild().getJSType();
}
if (jsType == null) {
return false;
}
jsType = jsType.restrictByNotNullOrUndefined();
if (!jsType.isUnknownType()
&& !jsType.isAllType()
&& jsType.isSubtypeOf(providedJsType)) {
if (node.isName() && propertyName.equals(node.getString())) {
return true;
} else if (node.isGetProp()
&& propertyName.equals(node.getLastChild().getString())) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[matchesPrototypeInstanceVar, return_type[type[boolean]], modifier[private static], parameter[node, metadata, name]] begin[{]
local_variable[type[String], parts]
local_variable[type[String], className]
local_variable[type[String], propertyName]
local_variable[type[JSType], providedJsType]
if[binary_operation[member[.providedJsType], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[JSType], jsType]
if[call[node.hasChildren, parameter[]]] begin[{]
assign[member[.jsType], call[node.getFirstChild, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[member[.jsType], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.jsType], call[jsType.restrictByNotNullOrUndefined, parameter[]]]
if[binary_operation[binary_operation[call[jsType.isUnknownType, parameter[]], &&, call[jsType.isAllType, parameter[]]], &&, call[jsType.isSubtypeOf, parameter[member[.providedJsType]]]]] begin[{]
if[binary_operation[call[node.isName, parameter[]], &&, call[propertyName.equals, parameter[call[node.getString, parameter[]]]]]] begin[{]
return[literal[true]]
else begin[{]
if[binary_operation[call[node.isGetProp, parameter[]], &&, call[propertyName.equals, parameter[call[node.getLastChild, parameter[]]]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[matchesPrototypeInstanceVar] operator[SEP] identifier[Node] identifier[node] , identifier[NodeMetadata] identifier[metadata] , identifier[String] identifier[name] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[name] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[className] operator[=] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[propertyName] operator[=] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[JSType] identifier[providedJsType] operator[=] identifier[getJsType] operator[SEP] identifier[metadata] , identifier[className] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[providedJsType] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[JSType] identifier[jsType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[hasChildren] operator[SEP] operator[SEP] operator[SEP] {
identifier[jsType] operator[=] identifier[node] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[getJSType] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[jsType] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[jsType] operator[=] identifier[jsType] operator[SEP] identifier[restrictByNotNullOrUndefined] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[jsType] operator[SEP] identifier[isUnknownType] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[jsType] operator[SEP] identifier[isAllType] operator[SEP] operator[SEP] operator[&&] identifier[jsType] operator[SEP] identifier[isSubtypeOf] operator[SEP] identifier[providedJsType] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[isName] operator[SEP] operator[SEP] operator[&&] identifier[propertyName] operator[SEP] identifier[equals] operator[SEP] identifier[node] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[isGetProp] operator[SEP] operator[SEP] operator[&&] identifier[propertyName] operator[SEP] identifier[equals] operator[SEP] identifier[node] operator[SEP] identifier[getLastChild] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void setProxyClass(Class newProxyClass)
{
proxyClass = newProxyClass;
if (proxyClass == null)
{
setProxyClassName(null);
}
else
{
proxyClassName = proxyClass.getName();
}
} | class class_name[name] begin[{]
method[setProxyClass, return_type[void], modifier[public], parameter[newProxyClass]] begin[{]
assign[member[.proxyClass], member[.newProxyClass]]
if[binary_operation[member[.proxyClass], ==, literal[null]]] begin[{]
call[.setProxyClassName, parameter[literal[null]]]
else begin[{]
assign[member[.proxyClassName], call[proxyClass.getName, parameter[]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setProxyClass] operator[SEP] identifier[Class] identifier[newProxyClass] operator[SEP] {
identifier[proxyClass] operator[=] identifier[newProxyClass] operator[SEP] Keyword[if] operator[SEP] identifier[proxyClass] operator[==] Other[null] operator[SEP] {
identifier[setProxyClassName] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[proxyClassName] operator[=] identifier[proxyClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
}
|
void addTransactionManager(TransactionManager transactionManager) {
if (transactionManager == null) return;
this.transactionManagers.add(new TransactionManagerDefinition(transactionManager.name()));
} | class class_name[name] begin[{]
method[addTransactionManager, return_type[void], modifier[default], parameter[transactionManager]] begin[{]
if[binary_operation[member[.transactionManager], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
THIS[member[None.transactionManagers]call[None.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=transactionManager, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TransactionManagerDefinition, sub_type=None))]]]
end[}]
END[}] | Keyword[void] identifier[addTransactionManager] operator[SEP] identifier[TransactionManager] identifier[transactionManager] operator[SEP] {
Keyword[if] operator[SEP] identifier[transactionManager] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[this] operator[SEP] identifier[transactionManagers] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[TransactionManagerDefinition] operator[SEP] identifier[transactionManager] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private boolean matches6004( ApiDifference apiDiff )
{
throwIfMissing( true, false, true, true );
if ( !SelectorUtils.matchPath( field, apiDiff.getAffectedField() ) )
{
return false;
}
String[] args = getArgs( apiDiff );
String diffFrom = args[0];
String diffTo = args[1];
return SelectorUtils.matchPath( from, diffFrom ) && SelectorUtils.matchPath( to, diffTo );
} | class class_name[name] begin[{]
method[matches6004, return_type[type[boolean]], modifier[private], parameter[apiDiff]] begin[{]
call[.throwIfMissing, parameter[literal[true], literal[false], literal[true], literal[true]]]
if[call[SelectorUtils.matchPath, parameter[member[.field], call[apiDiff.getAffectedField, parameter[]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[String], args]
local_variable[type[String], diffFrom]
local_variable[type[String], diffTo]
return[binary_operation[call[SelectorUtils.matchPath, parameter[member[.from], member[.diffFrom]]], &&, call[SelectorUtils.matchPath, parameter[member[.to], member[.diffTo]]]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[matches6004] operator[SEP] identifier[ApiDifference] identifier[apiDiff] operator[SEP] {
identifier[throwIfMissing] operator[SEP] literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[SelectorUtils] operator[SEP] identifier[matchPath] operator[SEP] identifier[field] , identifier[apiDiff] operator[SEP] identifier[getAffectedField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[args] operator[=] identifier[getArgs] operator[SEP] identifier[apiDiff] operator[SEP] operator[SEP] identifier[String] identifier[diffFrom] operator[=] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[diffTo] operator[=] identifier[args] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[SelectorUtils] operator[SEP] identifier[matchPath] operator[SEP] identifier[from] , identifier[diffFrom] operator[SEP] operator[&&] identifier[SelectorUtils] operator[SEP] identifier[matchPath] operator[SEP] identifier[to] , identifier[diffTo] operator[SEP] operator[SEP]
}
|
public <R> R doInContext(SearchContext context, Supplier<R> action) {
R result;
if (context == null) {
result = action.get();
} else {
// store current context (without triggering exception if it was stale)
SearchContext currentSearchContext = currentContext;
boolean contextIsStale = currentContextIsStale;
setCurrentContext(context);
try {
result = action.get();
} finally {
// make original current context active again
currentContext = currentSearchContext;
currentContextIsStale = contextIsStale;
}
}
return result;
} | class class_name[name] begin[{]
method[doInContext, return_type[type[R]], modifier[public], parameter[context, action]] begin[{]
local_variable[type[R], result]
if[binary_operation[member[.context], ==, literal[null]]] begin[{]
assign[member[.result], call[action.get, parameter[]]]
else begin[{]
local_variable[type[SearchContext], currentSearchContext]
local_variable[type[boolean], contextIsStale]
call[.setCurrentContext, parameter[member[.context]]]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=currentSearchContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentContextIsStale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=contextIsStale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, resources=None)
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] operator[<] identifier[R] operator[>] identifier[R] identifier[doInContext] operator[SEP] identifier[SearchContext] identifier[context] , identifier[Supplier] operator[<] identifier[R] operator[>] identifier[action] operator[SEP] {
identifier[R] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[==] Other[null] operator[SEP] {
identifier[result] operator[=] identifier[action] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[SearchContext] identifier[currentSearchContext] operator[=] identifier[currentContext] operator[SEP] Keyword[boolean] identifier[contextIsStale] operator[=] identifier[currentContextIsStale] operator[SEP] identifier[setCurrentContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[try] {
identifier[result] operator[=] identifier[action] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[currentContext] operator[=] identifier[currentSearchContext] operator[SEP] identifier[currentContextIsStale] operator[=] identifier[contextIsStale] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static synchronized void loadLibrary(File jar) throws NoAvailableBackendException {
try {
/*We are using reflection here to circumvent encapsulation; addURL is not public*/
java.net.URLClassLoader loader = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
java.net.URL url = jar.toURI().toURL();
/*Disallow if already loaded*/
for (java.net.URL it : java.util.Arrays.asList(loader.getURLs())) {
if (it.equals(url)) {
return;
}
}
java.lang.reflect.Method method =
java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] {java.net.URL.class});
method.setAccessible(true); /*promote the method to public access*/
method.invoke(loader, new Object[] {url});
} catch (final java.lang.NoSuchMethodException | java.lang.IllegalAccessException
| java.net.MalformedURLException | java.lang.reflect.InvocationTargetException e) {
throw new NoAvailableBackendException(e);
}
} | class class_name[name] begin[{]
method[loadLibrary, return_type[void], modifier[synchronized public static], parameter[jar]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getSystemClassLoader, postfix_operators=[], prefix_operators=[], qualifier=ClassLoader, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=URLClassLoader, sub_type=None)))), name=loader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=URLClassLoader, sub_type=None)))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=jar, selectors=[MethodInvocation(arguments=[], member=toURL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None)))), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getURLs, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=java.util.Arrays, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None))))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=java.net, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="addURL"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=java.net, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))], member=getDeclaredMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=URLClassLoader, sub_type=None)), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=lang, sub_type=ReferenceType(arguments=None, dimensions=None, name=reflect, sub_type=ReferenceType(arguments=None, dimensions=None, name=Method, sub_type=None))))), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=loader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, 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=NoAvailableBackendException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['java.lang.NoSuchMethodException', 'java.lang.IllegalAccessException', 'java.net.MalformedURLException', 'java.lang.reflect.InvocationTargetException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[synchronized] Keyword[void] identifier[loadLibrary] operator[SEP] identifier[File] identifier[jar] operator[SEP] Keyword[throws] identifier[NoAvailableBackendException] {
Keyword[try] {
identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URLClassLoader] identifier[loader] operator[=] operator[SEP] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URLClassLoader] operator[SEP] identifier[ClassLoader] operator[SEP] identifier[getSystemClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URL] identifier[url] operator[=] identifier[jar] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URL] identifier[it] operator[:] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[loader] operator[SEP] identifier[getURLs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[it] operator[SEP] identifier[equals] operator[SEP] identifier[url] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
}
identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[Method] identifier[method] operator[=] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URLClassLoader] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredMethod] operator[SEP] literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] {
identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URL] operator[SEP] Keyword[class]
} operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[loader] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[url]
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[NoSuchMethodException] operator[|] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[IllegalAccessException] operator[|] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[MalformedURLException] operator[|] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NoAvailableBackendException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "maximalComplex")
public JAXBElement<TopoComplexMemberType> createMaximalComplex(TopoComplexMemberType value) {
return new JAXBElement<TopoComplexMemberType>(_MaximalComplex_QNAME, TopoComplexMemberType.class, null, value);
} | class class_name[name] begin[{]
method[createMaximalComplex, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_MaximalComplex_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TopoComplexMemberType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TopoComplexMemberType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[TopoComplexMemberType] operator[>] identifier[createMaximalComplex] operator[SEP] identifier[TopoComplexMemberType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[TopoComplexMemberType] operator[>] operator[SEP] identifier[_MaximalComplex_QNAME] , identifier[TopoComplexMemberType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action) {
return createRetentionPolicy(api, name, type, length, action, null);
} | class class_name[name] begin[{]
method[createRetentionPolicy, return_type[type[BoxRetentionPolicy]], modifier[private static], parameter[api, name, type, length, action]] begin[{]
return[call[.createRetentionPolicy, parameter[member[.api], member[.name], member[.type], member[.length], member[.action], literal[null]]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[BoxRetentionPolicy] operator[SEP] identifier[Info] identifier[createRetentionPolicy] operator[SEP] identifier[BoxAPIConnection] identifier[api] , identifier[String] identifier[name] , identifier[String] identifier[type] , Keyword[int] identifier[length] , identifier[String] identifier[action] operator[SEP] {
Keyword[return] identifier[createRetentionPolicy] operator[SEP] identifier[api] , identifier[name] , identifier[type] , identifier[length] , identifier[action] , Other[null] operator[SEP] operator[SEP]
}
|
public void setBooleanParameter(BooleanParameterType newBooleanParameter) {
((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__BOOLEAN_PARAMETER, newBooleanParameter);
} | class class_name[name] begin[{]
method[setBooleanParameter, return_type[void], modifier[public], parameter[newBooleanParameter]] begin[{]
Cast(expression=MethodInvocation(arguments=[], member=getMixed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FeatureMap, sub_type=ReferenceType(arguments=None, dimensions=None, name=Internal, sub_type=None)))
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setBooleanParameter] operator[SEP] identifier[BooleanParameterType] identifier[newBooleanParameter] operator[SEP] {
operator[SEP] operator[SEP] identifier[FeatureMap] operator[SEP] identifier[Internal] operator[SEP] identifier[getMixed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[BpsimPackage] operator[SEP] identifier[Literals] operator[SEP] identifier[DOCUMENT_ROOT__BOOLEAN_PARAMETER] , identifier[newBooleanParameter] operator[SEP] operator[SEP]
}
|
public void setDeveloperUserIdentifierList(java.util.Collection<String> developerUserIdentifierList) {
if (developerUserIdentifierList == null) {
this.developerUserIdentifierList = null;
return;
}
this.developerUserIdentifierList = new java.util.ArrayList<String>(developerUserIdentifierList);
} | class class_name[name] begin[{]
method[setDeveloperUserIdentifierList, return_type[void], modifier[public], parameter[developerUserIdentifierList]] begin[{]
if[binary_operation[member[.developerUserIdentifierList], ==, literal[null]]] begin[{]
assign[THIS[member[None.developerUserIdentifierList]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.developerUserIdentifierList]], ClassCreator(arguments=[MemberReference(member=developerUserIdentifierList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDeveloperUserIdentifierList] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[developerUserIdentifierList] operator[SEP] {
Keyword[if] operator[SEP] identifier[developerUserIdentifierList] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[developerUserIdentifierList] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[developerUserIdentifierList] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[developerUserIdentifierList] operator[SEP] operator[SEP]
}
|
public static Point2D_F64 closestPoint( LineSegment2D_F64 line,
Point2D_F64 p,
Point2D_F64 output ) {
if( output == null )
output = new Point2D_F64();
double slopeX = line.b.x - line.a.x;
double slopeY = line.b.y - line.a.y;
double t = slopeX * ( p.x - line.a.x ) + slopeY * ( p.y - line.a.y );
t /= slopeX*slopeX + slopeY*slopeY;
if( t < 0 )
t = 0;
else if( t > 1 )
t = 1;
output.x = line.a.x + slopeX * t;
output.y = line.a.y + slopeY * t;
return output;
} | class class_name[name] begin[{]
method[closestPoint, return_type[type[Point2D_F64]], modifier[public static], parameter[line, p, output]] begin[{]
if[binary_operation[member[.output], ==, literal[null]]] begin[{]
assign[member[.output], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point2D_F64, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[double], slopeX]
local_variable[type[double], slopeY]
local_variable[type[double], t]
assign[member[.t], binary_operation[binary_operation[member[.slopeX], *, member[.slopeX]], +, binary_operation[member[.slopeY], *, member[.slopeY]]]]
if[binary_operation[member[.t], <, literal[0]]] begin[{]
assign[member[.t], literal[0]]
else begin[{]
if[binary_operation[member[.t], >, literal[1]]] begin[{]
assign[member[.t], literal[1]]
else begin[{]
None
end[}]
end[}]
assign[member[output.x], binary_operation[member[line.a.x], +, binary_operation[member[.slopeX], *, member[.t]]]]
assign[member[output.y], binary_operation[member[line.a.y], +, binary_operation[member[.slopeY], *, member[.t]]]]
return[member[.output]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Point2D_F64] identifier[closestPoint] operator[SEP] identifier[LineSegment2D_F64] identifier[line] , identifier[Point2D_F64] identifier[p] , identifier[Point2D_F64] identifier[output] operator[SEP] {
Keyword[if] operator[SEP] identifier[output] operator[==] Other[null] operator[SEP] identifier[output] operator[=] Keyword[new] identifier[Point2D_F64] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[slopeX] operator[=] identifier[line] operator[SEP] identifier[b] operator[SEP] identifier[x] operator[-] identifier[line] operator[SEP] identifier[a] operator[SEP] identifier[x] operator[SEP] Keyword[double] identifier[slopeY] operator[=] identifier[line] operator[SEP] identifier[b] operator[SEP] identifier[y] operator[-] identifier[line] operator[SEP] identifier[a] operator[SEP] identifier[y] operator[SEP] Keyword[double] identifier[t] operator[=] identifier[slopeX] operator[*] operator[SEP] identifier[p] operator[SEP] identifier[x] operator[-] identifier[line] operator[SEP] identifier[a] operator[SEP] identifier[x] operator[SEP] operator[+] identifier[slopeY] operator[*] operator[SEP] identifier[p] operator[SEP] identifier[y] operator[-] identifier[line] operator[SEP] identifier[a] operator[SEP] identifier[y] operator[SEP] operator[SEP] identifier[t] operator[/=] identifier[slopeX] operator[*] identifier[slopeX] operator[+] identifier[slopeY] operator[*] identifier[slopeY] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[<] Other[0] operator[SEP] identifier[t] operator[=] Other[0] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[t] operator[>] Other[1] operator[SEP] identifier[t] operator[=] Other[1] operator[SEP] identifier[output] operator[SEP] identifier[x] operator[=] identifier[line] operator[SEP] identifier[a] operator[SEP] identifier[x] operator[+] identifier[slopeX] operator[*] identifier[t] operator[SEP] identifier[output] operator[SEP] identifier[y] operator[=] identifier[line] operator[SEP] identifier[a] operator[SEP] identifier[y] operator[+] identifier[slopeY] operator[*] identifier[t] operator[SEP] Keyword[return] identifier[output] operator[SEP]
}
|
@NotNull
public Map<String,Integer> extractCountedGrams(@NotNull CharSequence text) {
text = applyPadding(text);
int len = text.length();
int initialCapacity = 0;
for (Integer gramLength : gramLengths) {
initialCapacity += guessNumDistinctiveGrams(len, gramLength);
}
Map<String,Integer> grams = new LinkedHashMap<>(initialCapacity);
for (Integer gramLength : gramLengths) {
_extractCounted(text, gramLength, len, grams);
}
return grams;
} | class class_name[name] begin[{]
method[extractCountedGrams, return_type[type[Map]], modifier[public], parameter[text]] begin[{]
assign[member[.text], call[.applyPadding, parameter[member[.text]]]]
local_variable[type[int], len]
local_variable[type[int], initialCapacity]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=initialCapacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gramLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=guessNumDistinctiveGrams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=gramLengths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=gramLength)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None)
local_variable[type[Map], grams]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gramLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=grams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=_extractCounted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=gramLengths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=gramLength)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None)
return[member[.grams]]
end[}]
END[}] | annotation[@] identifier[NotNull] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[extractCountedGrams] operator[SEP] annotation[@] identifier[NotNull] identifier[CharSequence] identifier[text] operator[SEP] {
identifier[text] operator[=] identifier[applyPadding] operator[SEP] identifier[text] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[initialCapacity] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[gramLength] operator[:] identifier[gramLengths] operator[SEP] {
identifier[initialCapacity] operator[+=] identifier[guessNumDistinctiveGrams] operator[SEP] identifier[len] , identifier[gramLength] operator[SEP] operator[SEP]
}
identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[grams] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] identifier[initialCapacity] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[gramLength] operator[:] identifier[gramLengths] operator[SEP] {
identifier[_extractCounted] operator[SEP] identifier[text] , identifier[gramLength] , identifier[len] , identifier[grams] operator[SEP] operator[SEP]
}
Keyword[return] identifier[grams] operator[SEP]
}
|
public StringClauses append(Enum name, StringClauses subclauses) {
return this.append(name.name(), subclauses);
} | class class_name[name] begin[{]
method[append, return_type[type[StringClauses]], modifier[public], parameter[name, subclauses]] begin[{]
return[THIS[call[None.append, parameter[call[name.name, parameter[]], member[.subclauses]]]]]
end[}]
END[}] | Keyword[public] identifier[StringClauses] identifier[append] operator[SEP] identifier[Enum] identifier[name] , identifier[StringClauses] identifier[subclauses] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[append] operator[SEP] identifier[name] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[subclauses] operator[SEP] operator[SEP]
}
|
public static String replaceFullRequestContent(
String requestContentTemplate, String replacementString) {
return (requestContentTemplate.replace(
PcConstants.COMMAND_VAR_DEFAULT_REQUEST_CONTENT,
replacementString));
} | class class_name[name] begin[{]
method[replaceFullRequestContent, return_type[type[String]], modifier[public static], parameter[requestContentTemplate, replacementString]] begin[{]
return[call[requestContentTemplate.replace, parameter[member[PcConstants.COMMAND_VAR_DEFAULT_REQUEST_CONTENT], member[.replacementString]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[replaceFullRequestContent] operator[SEP] identifier[String] identifier[requestContentTemplate] , identifier[String] identifier[replacementString] operator[SEP] {
Keyword[return] operator[SEP] identifier[requestContentTemplate] operator[SEP] identifier[replace] operator[SEP] identifier[PcConstants] operator[SEP] identifier[COMMAND_VAR_DEFAULT_REQUEST_CONTENT] , identifier[replacementString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void setAdditionalPreference(CmsObject cms, String key, String value) {
CmsUser user = cms.getRequestContext().getCurrentUser();
CmsUserSettings settings = new CmsUserSettings(user);
settings.setAdditionalPreference(key, value);
try {
settings.save(cms);
} catch (CmsException e) {
LOG.error("Could not store preference " + key + ": " + e.getLocalizedMessage(), e);
}
} | class class_name[name] begin[{]
method[setAdditionalPreference, return_type[void], modifier[public static], parameter[cms, key, value]] begin[{]
local_variable[type[CmsUser], user]
local_variable[type[CmsUserSettings], settings]
call[settings.setAdditionalPreference, parameter[member[.key], member[.value]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=save, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not store preference "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=['CmsException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setAdditionalPreference] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[String] identifier[key] , identifier[String] identifier[value] operator[SEP] {
identifier[CmsUser] identifier[user] operator[=] identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentUser] operator[SEP] operator[SEP] operator[SEP] identifier[CmsUserSettings] identifier[settings] operator[=] Keyword[new] identifier[CmsUserSettings] operator[SEP] identifier[user] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setAdditionalPreference] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[try] {
identifier[settings] operator[SEP] identifier[save] operator[SEP] identifier[cms] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@NullSafe
private File validateDirectory(File directory) {
return Optional.ofNullable(directory).filter(File::isDirectory)
.orElseThrow(() -> newIllegalArgumentException("File [%s] is not a valid directory", directory));
} | class class_name[name] begin[{]
method[validateDirectory, return_type[type[File]], modifier[private], parameter[directory]] begin[{]
return[call[Optional.ofNullable, parameter[member[.directory]]]]
end[}]
END[}] | annotation[@] identifier[NullSafe] Keyword[private] identifier[File] identifier[validateDirectory] operator[SEP] identifier[File] identifier[directory] operator[SEP] {
Keyword[return] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[directory] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[File] operator[::] identifier[isDirectory] operator[SEP] operator[SEP] identifier[orElseThrow] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[newIllegalArgumentException] operator[SEP] literal[String] , identifier[directory] operator[SEP] operator[SEP] operator[SEP]
}
|
public Object getRepeatedField(final FieldDescriptorType descriptor,
final int index) {
if (!descriptor.isRepeated()) {
throw new IllegalArgumentException(
"getRepeatedField() can only be called on repeated fields.");
}
final Object value = getField(descriptor);
if (value == null) {
throw new IndexOutOfBoundsException();
} else {
return ((List<?>) value).get(index);
}
} | class class_name[name] begin[{]
method[getRepeatedField, return_type[type[Object]], modifier[public], parameter[descriptor, index]] begin[{]
if[call[descriptor.isRepeated, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getRepeatedField() can only be called on repeated fields.")], 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[Object], value]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None)
else begin[{]
return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=List, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[getRepeatedField] operator[SEP] Keyword[final] identifier[FieldDescriptorType] identifier[descriptor] , Keyword[final] Keyword[int] identifier[index] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[descriptor] operator[SEP] identifier[isRepeated] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[Object] identifier[value] operator[=] identifier[getField] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] operator[SEP] operator[SEP] identifier[List] operator[<] operator[?] operator[>] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
}
|
public void setAll(Map<String, String> params) {
for (Map.Entry<String, String> entry : params.entrySet()) {
setParameter(entry.getKey(), entry.getValue());
}
} | class class_name[name] begin[{]
method[setAll, return_type[void], modifier[public], parameter[params]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setAll] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[params] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[setParameter] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public List<GanttDesignerRemark.Task> getTask()
{
if (task == null)
{
task = new ArrayList<GanttDesignerRemark.Task>();
}
return this.task;
} | class class_name[name] begin[{]
method[getTask, return_type[type[List]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.task], ==, literal[null]]] begin[{]
assign[member[.task], 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=GanttDesignerRemark, sub_type=ReferenceType(arguments=None, dimensions=None, name=Task, sub_type=None)))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
return[THIS[member[None.task]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[GanttDesignerRemark] operator[SEP] identifier[Task] operator[>] identifier[getTask] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[task] operator[==] Other[null] operator[SEP] {
identifier[task] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[GanttDesignerRemark] operator[SEP] identifier[Task] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP] identifier[task] operator[SEP]
}
|
public static Endpoint update(final String domainId, final String endpointId, final String password,
final String applicationId, final String description, final boolean enabled) throws AppPlatformException, ParseException, Exception {
final BandwidthClient client = BandwidthClient.getInstance();
assert(domainId != null);
assert(endpointId != null);
assert(password != null);
final Map<String, Object> params = new HashMap<String, Object>();
final Map<String, String> credentials = new HashMap<String, String>();
credentials.put("password", password);
params.put("credentials", credentials);
if(applicationId != null) {
params.put("applicationId", applicationId);
}
if(description != null) {
params.put("description", description);
}
params.put("enabled", Boolean.toString(enabled));
final String domainsUri = String.format(client.getUserResourceUri(BandwidthConstants.ENDPOINTS_URI_PATH), domainId)+ "/"+endpointId;
final RestResponse response = client.post(domainsUri, params);
final JSONObject jsonObject = toJSONObject(client.get(domainsUri, null));
return new Endpoint(client, jsonObject);
} | class class_name[name] begin[{]
method[update, return_type[type[Endpoint]], modifier[public static], parameter[domainId, endpointId, password, applicationId, description, enabled]] begin[{]
local_variable[type[BandwidthClient], client]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=domainId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=endpointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=password, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
local_variable[type[Map], params]
local_variable[type[Map], credentials]
call[credentials.put, parameter[literal["password"], member[.password]]]
call[params.put, parameter[literal["credentials"], member[.credentials]]]
if[binary_operation[member[.applicationId], !=, literal[null]]] begin[{]
call[params.put, parameter[literal["applicationId"], member[.applicationId]]]
else begin[{]
None
end[}]
if[binary_operation[member[.description], !=, literal[null]]] begin[{]
call[params.put, parameter[literal["description"], member[.description]]]
else begin[{]
None
end[}]
call[params.put, parameter[literal["enabled"], call[Boolean.toString, parameter[member[.enabled]]]]]
local_variable[type[String], domainsUri]
local_variable[type[RestResponse], response]
local_variable[type[JSONObject], jsonObject]
return[ClassCreator(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonObject, 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=Endpoint, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Endpoint] identifier[update] operator[SEP] Keyword[final] identifier[String] identifier[domainId] , Keyword[final] identifier[String] identifier[endpointId] , Keyword[final] identifier[String] identifier[password] , Keyword[final] identifier[String] identifier[applicationId] , Keyword[final] identifier[String] identifier[description] , Keyword[final] Keyword[boolean] identifier[enabled] operator[SEP] Keyword[throws] identifier[AppPlatformException] , identifier[ParseException] , identifier[Exception] {
Keyword[final] identifier[BandwidthClient] identifier[client] operator[=] identifier[BandwidthClient] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[domainId] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[endpointId] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[password] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[credentials] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[credentials] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[password] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[credentials] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[applicationId] operator[!=] Other[null] operator[SEP] {
identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[applicationId] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[description] operator[!=] Other[null] operator[SEP] {
identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[description] operator[SEP] operator[SEP]
}
identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[domainsUri] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[client] operator[SEP] identifier[getUserResourceUri] operator[SEP] identifier[BandwidthConstants] operator[SEP] identifier[ENDPOINTS_URI_PATH] operator[SEP] , identifier[domainId] operator[SEP] operator[+] literal[String] operator[+] identifier[endpointId] operator[SEP] Keyword[final] identifier[RestResponse] identifier[response] operator[=] identifier[client] operator[SEP] identifier[post] operator[SEP] identifier[domainsUri] , identifier[params] operator[SEP] operator[SEP] Keyword[final] identifier[JSONObject] identifier[jsonObject] operator[=] identifier[toJSONObject] operator[SEP] identifier[client] operator[SEP] identifier[get] operator[SEP] identifier[domainsUri] , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Endpoint] operator[SEP] identifier[client] , identifier[jsonObject] operator[SEP] operator[SEP]
}
|
public static <T extends View> T mount(T v, Renderable r) {
Mount m = new Mount(v, r);
mounts.put(v, m);
render(v);
return v;
} | class class_name[name] begin[{]
method[mount, return_type[type[T]], modifier[public static], parameter[v, r]] begin[{]
local_variable[type[Mount], m]
call[mounts.put, parameter[member[.v], member[.m]]]
call[.render, parameter[member[.v]]]
return[member[.v]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[View] operator[>] identifier[T] identifier[mount] operator[SEP] identifier[T] identifier[v] , identifier[Renderable] identifier[r] operator[SEP] {
identifier[Mount] identifier[m] operator[=] Keyword[new] identifier[Mount] operator[SEP] identifier[v] , identifier[r] operator[SEP] operator[SEP] identifier[mounts] operator[SEP] identifier[put] operator[SEP] identifier[v] , identifier[m] operator[SEP] operator[SEP] identifier[render] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[return] identifier[v] operator[SEP]
}
|
public BaseField setupField(int iFieldSeq)
{
BaseField field = null;
//if (iFieldSeq == 0)
//{
// field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
// field.setHidden(true);
//}
//if (iFieldSeq == 1)
//{
// field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
// field.setHidden(true);
//}
//if (iFieldSeq == 2)
//{
// field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
// field.setHidden(true);
//}
if (iFieldSeq == 3)
field = new ProjectTaskField(this, PROJECT_TASK_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
if (iFieldSeq == 4)
field = new ProjectTaskField(this, PROJECT_TASK_PREDECESSOR_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
if (iFieldSeq == 5)
{
field = new PredecessorTypeField(this, PREDECESSOR_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.addListener(new InitOnceFieldHandler(null));
}
if (iFieldSeq == 6)
field = new IntegerField(this, PREDECESSOR_DELAY, Constants.DEFAULT_FIELD_LENGTH, null, null);
if (field == null)
field = super.setupField(iFieldSeq);
return field;
} | class class_name[name] begin[{]
method[setupField, return_type[type[BaseField]], modifier[public], parameter[iFieldSeq]] begin[{]
local_variable[type[BaseField], field]
if[binary_operation[member[.iFieldSeq], ==, literal[3]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PROJECT_TASK_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProjectTaskField, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.iFieldSeq], ==, literal[4]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PROJECT_TASK_PREDECESSOR_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProjectTaskField, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.iFieldSeq], ==, literal[5]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PREDECESSOR_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PredecessorTypeField, sub_type=None))]
call[field.addListener, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitOnceFieldHandler, sub_type=None))]]
else begin[{]
None
end[}]
if[binary_operation[member[.iFieldSeq], ==, literal[6]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PREDECESSOR_DELAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerField, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.field], ==, literal[null]]] begin[{]
assign[member[.field], SuperMethodInvocation(arguments=[MemberReference(member=iFieldSeq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setupField, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
else begin[{]
None
end[}]
return[member[.field]]
end[}]
END[}] | Keyword[public] identifier[BaseField] identifier[setupField] operator[SEP] Keyword[int] identifier[iFieldSeq] operator[SEP] {
identifier[BaseField] identifier[field] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[3] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ProjectTaskField] operator[SEP] Keyword[this] , identifier[PROJECT_TASK_ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[4] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ProjectTaskField] operator[SEP] Keyword[this] , identifier[PROJECT_TASK_PREDECESSOR_ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[5] operator[SEP] {
identifier[field] operator[=] Keyword[new] identifier[PredecessorTypeField] operator[SEP] Keyword[this] , identifier[PREDECESSOR_TYPE] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[InitOnceFieldHandler] operator[SEP] Other[null] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[6] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[IntegerField] operator[SEP] Keyword[this] , identifier[PREDECESSOR_DELAY] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] identifier[field] operator[=] Keyword[super] operator[SEP] identifier[setupField] operator[SEP] identifier[iFieldSeq] operator[SEP] operator[SEP] Keyword[return] identifier[field] operator[SEP]
}
|
public String toFirstUpper(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
} | class class_name[name] begin[{]
method[toFirstUpper, return_type[type[String]], modifier[public], parameter[name]] begin[{]
if[binary_operation[call[name.length, parameter[]], ==, literal[0]]] begin[{]
return[member[.name]]
else begin[{]
return[binary_operation[call[name.substring, parameter[literal[0], literal[1]]], +, call[name.substring, parameter[literal[1]]]]]
end[}]
end[}]
END[}] | Keyword[public] identifier[String] identifier[toFirstUpper] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[name] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[+] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
}
|
public static DbArtifact createDbArtifact(final String gavc) {
final DbArtifact artifact = new DbArtifact();
final String[] artifactInfo = gavc.split(":");
if(artifactInfo.length > 0){
artifact.setGroupId(artifactInfo[0]);
}
if(artifactInfo.length > 1){
artifact.setArtifactId(artifactInfo[1]);
}
if(artifactInfo.length > 2){
artifact.setVersion(artifactInfo[2]);
}
if(artifactInfo.length > 3){
artifact.setClassifier(artifactInfo[3]);
}
if(artifactInfo.length > 4){
artifact.setExtension(artifactInfo[4]);
}
if(artifactInfo.length > 5){
artifact.setOrigin(artifactInfo[5]);
}
return artifact;
} | class class_name[name] begin[{]
method[createDbArtifact, return_type[type[DbArtifact]], modifier[public static], parameter[gavc]] begin[{]
local_variable[type[DbArtifact], artifact]
local_variable[type[String], artifactInfo]
if[binary_operation[member[artifactInfo.length], >, literal[0]]] begin[{]
call[artifact.setGroupId, parameter[member[.artifactInfo]]]
else begin[{]
None
end[}]
if[binary_operation[member[artifactInfo.length], >, literal[1]]] begin[{]
call[artifact.setArtifactId, parameter[member[.artifactInfo]]]
else begin[{]
None
end[}]
if[binary_operation[member[artifactInfo.length], >, literal[2]]] begin[{]
call[artifact.setVersion, parameter[member[.artifactInfo]]]
else begin[{]
None
end[}]
if[binary_operation[member[artifactInfo.length], >, literal[3]]] begin[{]
call[artifact.setClassifier, parameter[member[.artifactInfo]]]
else begin[{]
None
end[}]
if[binary_operation[member[artifactInfo.length], >, literal[4]]] begin[{]
call[artifact.setExtension, parameter[member[.artifactInfo]]]
else begin[{]
None
end[}]
if[binary_operation[member[artifactInfo.length], >, literal[5]]] begin[{]
call[artifact.setOrigin, parameter[member[.artifactInfo]]]
else begin[{]
None
end[}]
return[member[.artifact]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[DbArtifact] identifier[createDbArtifact] operator[SEP] Keyword[final] identifier[String] identifier[gavc] operator[SEP] {
Keyword[final] identifier[DbArtifact] identifier[artifact] operator[=] Keyword[new] identifier[DbArtifact] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[artifactInfo] operator[=] identifier[gavc] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[artifactInfo] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[artifact] operator[SEP] identifier[setGroupId] operator[SEP] identifier[artifactInfo] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[artifactInfo] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] {
identifier[artifact] operator[SEP] identifier[setArtifactId] operator[SEP] identifier[artifactInfo] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[artifactInfo] operator[SEP] identifier[length] operator[>] Other[2] operator[SEP] {
identifier[artifact] operator[SEP] identifier[setVersion] operator[SEP] identifier[artifactInfo] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[artifactInfo] operator[SEP] identifier[length] operator[>] Other[3] operator[SEP] {
identifier[artifact] operator[SEP] identifier[setClassifier] operator[SEP] identifier[artifactInfo] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[artifactInfo] operator[SEP] identifier[length] operator[>] Other[4] operator[SEP] {
identifier[artifact] operator[SEP] identifier[setExtension] operator[SEP] identifier[artifactInfo] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[artifactInfo] operator[SEP] identifier[length] operator[>] Other[5] operator[SEP] {
identifier[artifact] operator[SEP] identifier[setOrigin] operator[SEP] identifier[artifactInfo] operator[SEP] Other[5] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[artifact] operator[SEP]
}
|
private static byte[] deobfuscateBytes(byte[] source) {
byte[] result = new byte[source.length - 1];
System.arraycopy(source, 1, result, 0, source.length - 1);
for (int i = 0; i < result.length; i++) {
result[i] = (byte)(0xFF & (result[i] ^ source[0]));
}
return result;
} | class class_name[name] begin[{]
method[deobfuscateBytes, return_type[type[byte]], modifier[private static], parameter[source]] begin[{]
local_variable[type[byte], result]
call[System.arraycopy, parameter[member[.source], literal[1], member[.result], literal[0], binary_operation[member[source.length], -, literal[1]]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operandr=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=^), operator=&), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[deobfuscateBytes] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[source] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[source] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[source] , Other[1] , identifier[result] , Other[0] , identifier[source] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[result] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] literal[Integer] operator[&] operator[SEP] identifier[result] operator[SEP] identifier[i] operator[SEP] operator[^] identifier[source] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
protected void adjustPositionY(int velocityY) {
int childCount = getChildCount();
if (childCount > 0) {
int curPosition = ViewUtils.getCenterYChildPosition(this);
int childHeight = getHeight() - getPaddingTop() - getPaddingBottom();
int flingCount = getFlingCount(velocityY, childHeight);
int targetPosition = curPosition + flingCount;
if (mSinglePageFling) {
flingCount = Math.max(-1, Math.min(1, flingCount));
targetPosition = flingCount == 0 ? curPosition : mPositionOnTouchDown + flingCount;
}
targetPosition = Math.max(targetPosition, 0);
targetPosition = Math.min(targetPosition, mViewPagerAdapter.getItemCount() - 1);
if (targetPosition == curPosition
&& ((mSinglePageFling
&& mPositionOnTouchDown == curPosition)
|| !mSinglePageFling)) {
View centerYChild = ViewUtils.getCenterYChild(this);
if (centerYChild != null) {
if (mTouchSpan > centerYChild.getHeight() * mTriggerOffset && targetPosition != 0) {
targetPosition--;
} else if (mTouchSpan < centerYChild.getHeight() * -mTriggerOffset && targetPosition != mViewPagerAdapter.getItemCount() - 1) {
targetPosition++;
}
}
}
if (DEBUG) {
Log.d("RecyclerViewPager", "mTouchSpan:" + mTouchSpan);
Log.d("RecyclerViewPager", "adjustPositionY:" + targetPosition);
}
smoothScrollToPosition(safeTargetPosition(targetPosition, mViewPagerAdapter.getItemCount()));
}
} | class class_name[name] begin[{]
method[adjustPositionY, return_type[void], modifier[protected], parameter[velocityY]] begin[{]
local_variable[type[int], childCount]
if[binary_operation[member[.childCount], >, literal[0]]] begin[{]
local_variable[type[int], curPosition]
local_variable[type[int], childHeight]
local_variable[type[int], flingCount]
local_variable[type[int], targetPosition]
if[member[.mSinglePageFling]] begin[{]
assign[member[.flingCount], call[Math.max, parameter[literal[1], call[Math.min, parameter[literal[1], member[.flingCount]]]]]]
assign[member[.targetPosition], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=flingCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=BinaryOperation(operandl=MemberReference(member=mPositionOnTouchDown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=flingCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), if_true=MemberReference(member=curPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
None
end[}]
assign[member[.targetPosition], call[Math.max, parameter[member[.targetPosition], literal[0]]]]
assign[member[.targetPosition], call[Math.min, parameter[member[.targetPosition], binary_operation[call[mViewPagerAdapter.getItemCount, parameter[]], -, literal[1]]]]]
if[binary_operation[binary_operation[member[.targetPosition], ==, member[.curPosition]], &&, binary_operation[binary_operation[member[.mSinglePageFling], &&, binary_operation[member[.mPositionOnTouchDown], ==, member[.curPosition]]], ||, member[.mSinglePageFling]]]] begin[{]
local_variable[type[View], centerYChild]
if[binary_operation[member[.centerYChild], !=, literal[null]]] begin[{]
if[binary_operation[binary_operation[member[.mTouchSpan], >, binary_operation[call[centerYChild.getHeight, parameter[]], *, member[.mTriggerOffset]]], &&, binary_operation[member[.targetPosition], !=, literal[0]]]] begin[{]
member[.targetPosition]
else begin[{]
if[binary_operation[binary_operation[member[.mTouchSpan], <, binary_operation[call[centerYChild.getHeight, parameter[]], *, member[.mTriggerOffset]]], &&, binary_operation[member[.targetPosition], !=, binary_operation[call[mViewPagerAdapter.getItemCount, parameter[]], -, literal[1]]]]] begin[{]
member[.targetPosition]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[member[.DEBUG]] begin[{]
call[Log.d, parameter[literal["RecyclerViewPager"], binary_operation[literal["mTouchSpan:"], +, member[.mTouchSpan]]]]
call[Log.d, parameter[literal["RecyclerViewPager"], binary_operation[literal["adjustPositionY:"], +, member[.targetPosition]]]]
else begin[{]
None
end[}]
call[.smoothScrollToPosition, parameter[call[.safeTargetPosition, parameter[member[.targetPosition], call[mViewPagerAdapter.getItemCount, parameter[]]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[adjustPositionY] operator[SEP] Keyword[int] identifier[velocityY] operator[SEP] {
Keyword[int] identifier[childCount] operator[=] identifier[getChildCount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childCount] operator[>] Other[0] operator[SEP] {
Keyword[int] identifier[curPosition] operator[=] identifier[ViewUtils] operator[SEP] identifier[getCenterYChildPosition] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[int] identifier[childHeight] operator[=] identifier[getHeight] operator[SEP] operator[SEP] operator[-] identifier[getPaddingTop] operator[SEP] operator[SEP] operator[-] identifier[getPaddingBottom] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[flingCount] operator[=] identifier[getFlingCount] operator[SEP] identifier[velocityY] , identifier[childHeight] operator[SEP] operator[SEP] Keyword[int] identifier[targetPosition] operator[=] identifier[curPosition] operator[+] identifier[flingCount] operator[SEP] Keyword[if] operator[SEP] identifier[mSinglePageFling] operator[SEP] {
identifier[flingCount] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] operator[-] Other[1] , identifier[Math] operator[SEP] identifier[min] operator[SEP] Other[1] , identifier[flingCount] operator[SEP] operator[SEP] operator[SEP] identifier[targetPosition] operator[=] identifier[flingCount] operator[==] Other[0] operator[?] identifier[curPosition] operator[:] identifier[mPositionOnTouchDown] operator[+] identifier[flingCount] operator[SEP]
}
identifier[targetPosition] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[targetPosition] , Other[0] operator[SEP] operator[SEP] identifier[targetPosition] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[targetPosition] , identifier[mViewPagerAdapter] operator[SEP] identifier[getItemCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetPosition] operator[==] identifier[curPosition] operator[&&] operator[SEP] operator[SEP] identifier[mSinglePageFling] operator[&&] identifier[mPositionOnTouchDown] operator[==] identifier[curPosition] operator[SEP] operator[||] operator[!] identifier[mSinglePageFling] operator[SEP] operator[SEP] {
identifier[View] identifier[centerYChild] operator[=] identifier[ViewUtils] operator[SEP] identifier[getCenterYChild] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[centerYChild] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[mTouchSpan] operator[>] identifier[centerYChild] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[*] identifier[mTriggerOffset] operator[&&] identifier[targetPosition] operator[!=] Other[0] operator[SEP] {
identifier[targetPosition] operator[--] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[mTouchSpan] operator[<] identifier[centerYChild] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[*] operator[-] identifier[mTriggerOffset] operator[&&] identifier[targetPosition] operator[!=] identifier[mViewPagerAdapter] operator[SEP] identifier[getItemCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] {
identifier[targetPosition] operator[++] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] literal[String] , literal[String] operator[+] identifier[mTouchSpan] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[d] operator[SEP] literal[String] , literal[String] operator[+] identifier[targetPosition] operator[SEP] operator[SEP]
}
identifier[smoothScrollToPosition] operator[SEP] identifier[safeTargetPosition] operator[SEP] identifier[targetPosition] , identifier[mViewPagerAdapter] operator[SEP] identifier[getItemCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public Rectangular hsplit(Rectangular other)
{
if (this.intersects(other))
{
Rectangular a = new Rectangular(this);
Rectangular b = new Rectangular(this);
if (a.x2 > other.x1 - 1) a.x2 = other.x1 - 1;
if (b.x1 < other.x2 + 1) b.x1 = other.x2 + 1;
if (a.isEmpty())
{
x1 = b.x1;
return null;
}
else
{
x2 = a.x2;
if (b.isEmpty())
return null;
else
return b;
}
}
else
return null;
} | class class_name[name] begin[{]
method[hsplit, return_type[type[Rectangular]], modifier[public], parameter[other]] begin[{]
if[THIS[call[None.intersects, parameter[member[.other]]]]] begin[{]
local_variable[type[Rectangular], a]
local_variable[type[Rectangular], b]
if[binary_operation[member[a.x2], >, binary_operation[member[other.x1], -, literal[1]]]] begin[{]
assign[member[a.x2], binary_operation[member[other.x1], -, literal[1]]]
else begin[{]
None
end[}]
if[binary_operation[member[b.x1], <, binary_operation[member[other.x2], +, literal[1]]]] begin[{]
assign[member[b.x1], binary_operation[member[other.x2], +, literal[1]]]
else begin[{]
None
end[}]
if[call[a.isEmpty, parameter[]]] begin[{]
assign[member[.x1], member[b.x1]]
return[literal[null]]
else begin[{]
assign[member[.x2], member[a.x2]]
if[call[b.isEmpty, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
return[member[.b]]
end[}]
end[}]
else begin[{]
return[literal[null]]
end[}]
end[}]
END[}] | Keyword[public] identifier[Rectangular] identifier[hsplit] operator[SEP] identifier[Rectangular] identifier[other] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[intersects] operator[SEP] identifier[other] operator[SEP] operator[SEP] {
identifier[Rectangular] identifier[a] operator[=] Keyword[new] identifier[Rectangular] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[Rectangular] identifier[b] operator[=] Keyword[new] identifier[Rectangular] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[x2] operator[>] identifier[other] operator[SEP] identifier[x1] operator[-] Other[1] operator[SEP] identifier[a] operator[SEP] identifier[x2] operator[=] identifier[other] operator[SEP] identifier[x1] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[x1] operator[<] identifier[other] operator[SEP] identifier[x2] operator[+] Other[1] operator[SEP] identifier[b] operator[SEP] identifier[x1] operator[=] identifier[other] operator[SEP] identifier[x2] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[x1] operator[=] identifier[b] operator[SEP] identifier[x1] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
identifier[x2] operator[=] identifier[a] operator[SEP] identifier[x2] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[else] Keyword[return] identifier[b] operator[SEP]
}
}
Keyword[else] Keyword[return] Other[null] operator[SEP]
}
|
public final void doFilter(final ServletRequest pRequest, final ServletResponse pResponse, final FilterChain pFilterChain) throws IOException, ServletException {
// If request filter and already run, continue chain and return fast
if (oncePerRequest && isRunOnce(pRequest)) {
pFilterChain.doFilter(pRequest, pResponse);
return;
}
// Do real filter
doFilterImpl(pRequest, pResponse, pFilterChain);
} | class class_name[name] begin[{]
method[doFilter, return_type[void], modifier[final public], parameter[pRequest, pResponse, pFilterChain]] begin[{]
if[binary_operation[member[.oncePerRequest], &&, call[.isRunOnce, parameter[member[.pRequest]]]]] begin[{]
call[pFilterChain.doFilter, parameter[member[.pRequest], member[.pResponse]]]
return[None]
else begin[{]
None
end[}]
call[.doFilterImpl, parameter[member[.pRequest], member[.pResponse], member[.pFilterChain]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[doFilter] operator[SEP] Keyword[final] identifier[ServletRequest] identifier[pRequest] , Keyword[final] identifier[ServletResponse] identifier[pResponse] , Keyword[final] identifier[FilterChain] identifier[pFilterChain] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] {
Keyword[if] operator[SEP] identifier[oncePerRequest] operator[&&] identifier[isRunOnce] operator[SEP] identifier[pRequest] operator[SEP] operator[SEP] {
identifier[pFilterChain] operator[SEP] identifier[doFilter] operator[SEP] identifier[pRequest] , identifier[pResponse] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[doFilterImpl] operator[SEP] identifier[pRequest] , identifier[pResponse] , identifier[pFilterChain] operator[SEP] operator[SEP]
}
|
public <T> Converter<T, RequestBody> nextRequestBodyConverter(
@Nullable Converter.Factory skipPast, Type type, Annotation[] parameterAnnotations,
Annotation[] methodAnnotations) {
checkNotNull(type, "type == null");
checkNotNull(parameterAnnotations, "parameterAnnotations == null");
checkNotNull(methodAnnotations, "methodAnnotations == null");
int start = converterFactories.indexOf(skipPast) + 1;
for (int i = start, count = converterFactories.size(); i < count; i++) {
Converter.Factory factory = converterFactories.get(i);
Converter<?, RequestBody> converter =
factory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, this);
if (converter != null) {
//noinspection unchecked
return (Converter<T, RequestBody>) converter;
}
}
StringBuilder builder = new StringBuilder("Could not locate RequestBody converter for ")
.append(type)
.append(".\n");
if (skipPast != null) {
builder.append(" Skipped:");
for (int i = 0; i < start; i++) {
builder.append("\n * ").append(converterFactories.get(i).getClass().getName());
}
builder.append('\n');
}
builder.append(" Tried:");
for (int i = start, count = converterFactories.size(); i < count; i++) {
builder.append("\n * ").append(converterFactories.get(i).getClass().getName());
}
throw new IllegalArgumentException(builder.toString());
} | class class_name[name] begin[{]
method[nextRequestBodyConverter, return_type[type[Converter]], modifier[public], parameter[skipPast, type, parameterAnnotations, methodAnnotations]] begin[{]
call[.checkNotNull, parameter[member[.type], literal["type == null"]]]
call[.checkNotNull, parameter[member[.parameterAnnotations], literal["parameterAnnotations == null"]]]
call[.checkNotNull, parameter[member[.methodAnnotations], literal["methodAnnotations == null"]]]
local_variable[type[int], start]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=converterFactories, selectors=[], type_arguments=None), name=factory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Converter, sub_type=ReferenceType(arguments=None, dimensions=None, name=Factory, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=requestBodyConverter, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=converter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RequestBody, sub_type=None))], dimensions=[], name=Converter, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=converter, 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=[ReturnStatement(expression=Cast(expression=MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RequestBody, sub_type=None))], dimensions=[], name=Converter, sub_type=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=converterFactories, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[StringBuilder], builder]
if[binary_operation[member[.skipPast], !=, literal[null]]] begin[{]
call[builder.append, parameter[literal[" Skipped:"]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n * ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=converterFactories, selectors=[MethodInvocation(arguments=[], member=getClass, 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)], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[builder.append, parameter[literal['\n']]]
else begin[{]
None
end[}]
call[builder.append, parameter[literal[" Tried:"]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n * ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=converterFactories, selectors=[MethodInvocation(arguments=[], member=getClass, 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)], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=converterFactories, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[Converter] operator[<] identifier[T] , identifier[RequestBody] operator[>] identifier[nextRequestBodyConverter] operator[SEP] annotation[@] identifier[Nullable] identifier[Converter] operator[SEP] identifier[Factory] identifier[skipPast] , identifier[Type] identifier[type] , identifier[Annotation] operator[SEP] operator[SEP] identifier[parameterAnnotations] , identifier[Annotation] operator[SEP] operator[SEP] identifier[methodAnnotations] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[parameterAnnotations] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[methodAnnotations] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[start] operator[=] identifier[converterFactories] operator[SEP] identifier[indexOf] operator[SEP] identifier[skipPast] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[start] , identifier[count] operator[=] identifier[converterFactories] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Converter] operator[SEP] identifier[Factory] identifier[factory] operator[=] identifier[converterFactories] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Converter] operator[<] operator[?] , identifier[RequestBody] operator[>] identifier[converter] operator[=] identifier[factory] operator[SEP] identifier[requestBodyConverter] operator[SEP] identifier[type] , identifier[parameterAnnotations] , identifier[methodAnnotations] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[converter] operator[!=] Other[null] operator[SEP] {
Keyword[return] operator[SEP] identifier[Converter] operator[<] identifier[T] , identifier[RequestBody] operator[>] operator[SEP] identifier[converter] operator[SEP]
}
}
identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[skipPast] operator[!=] Other[null] operator[SEP] {
identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[start] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[converterFactories] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[start] , identifier[count] operator[=] identifier[converterFactories] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[converterFactories] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private List<CmsSelectWidgetOption> getFieldList() {
List<CmsSelectWidgetOption> retVal = new ArrayList<CmsSelectWidgetOption>();
try {
Iterator<CmsSearchField> i = getSearchFields().iterator();
while (i.hasNext()) {
CmsLuceneField field = (CmsLuceneField)i.next();
retVal.add(
new CmsSelectWidgetOption(
field.getName(),
true,
getMacroResolver().resolveMacros(field.getDisplayName())));
}
} catch (Exception e) {
// noop
}
return retVal;
} | class class_name[name] begin[{]
method[getFieldList, return_type[type[List]], modifier[private], parameter[]] begin[{]
local_variable[type[List], retVal]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSearchFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsSearchField, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CmsLuceneField, sub_type=None)), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsLuceneField, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MethodInvocation(arguments=[], member=getMacroResolver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDisplayName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=resolveMacros, 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=CmsSelectWidgetOption, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=retVal, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.retVal]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[CmsSelectWidgetOption] operator[>] identifier[getFieldList] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[CmsSelectWidgetOption] operator[>] identifier[retVal] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsSelectWidgetOption] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Iterator] operator[<] identifier[CmsSearchField] operator[>] identifier[i] operator[=] identifier[getSearchFields] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsLuceneField] identifier[field] operator[=] operator[SEP] identifier[CmsLuceneField] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[retVal] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsSelectWidgetOption] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[boolean] , identifier[getMacroResolver] operator[SEP] operator[SEP] operator[SEP] identifier[resolveMacros] operator[SEP] identifier[field] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
}
Keyword[return] identifier[retVal] operator[SEP]
}
|
public SearchResult<WorkflowSummary> searchWorkflowsByTasks(int start, int size, String sort, String freeText, String query) {
return executionService.searchWorkflowByTasks(query, freeText, start, size, ServiceUtils.convertStringToList(sort));
} | class class_name[name] begin[{]
method[searchWorkflowsByTasks, return_type[type[SearchResult]], modifier[public], parameter[start, size, sort, freeText, query]] begin[{]
return[call[executionService.searchWorkflowByTasks, parameter[member[.query], member[.freeText], member[.start], member[.size], call[ServiceUtils.convertStringToList, parameter[member[.sort]]]]]]
end[}]
END[}] | Keyword[public] identifier[SearchResult] operator[<] identifier[WorkflowSummary] operator[>] identifier[searchWorkflowsByTasks] operator[SEP] Keyword[int] identifier[start] , Keyword[int] identifier[size] , identifier[String] identifier[sort] , identifier[String] identifier[freeText] , identifier[String] identifier[query] operator[SEP] {
Keyword[return] identifier[executionService] operator[SEP] identifier[searchWorkflowByTasks] operator[SEP] identifier[query] , identifier[freeText] , identifier[start] , identifier[size] , identifier[ServiceUtils] operator[SEP] identifier[convertStringToList] operator[SEP] identifier[sort] operator[SEP] operator[SEP] operator[SEP]
}
|
public void rollback() throws HibernateException {
Transaction tr = (Transaction) SessionFactoryHolder.getTransaction();
if (tr != null) {
tr.rollback();
}
SessionFactoryHolder.setTransaction(null);
} | class class_name[name] begin[{]
method[rollback, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Transaction], tr]
if[binary_operation[member[.tr], !=, literal[null]]] begin[{]
call[tr.rollback, parameter[]]
else begin[{]
None
end[}]
call[SessionFactoryHolder.setTransaction, parameter[literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[rollback] operator[SEP] operator[SEP] Keyword[throws] identifier[HibernateException] {
identifier[Transaction] identifier[tr] operator[=] operator[SEP] identifier[Transaction] operator[SEP] identifier[SessionFactoryHolder] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tr] operator[!=] Other[null] operator[SEP] {
identifier[tr] operator[SEP] identifier[rollback] operator[SEP] operator[SEP] operator[SEP]
}
identifier[SessionFactoryHolder] operator[SEP] identifier[setTransaction] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
|
@Override
public Object evaluate(TaskRequest req, TaskResponse res) {
final String seqName = (String) this.seqNamePhrase.evaluate(req, res);
final ICounterStore counterStore = CounterStoreLocator.getCounterStore();
try {
return counterStore.getNextId(seqName);
} catch (Exception e) {
throw new RuntimeException(
"Failed to retrieve next sequence in for sequance '" + seqName + "'", e);
}
} | class class_name[name] begin[{]
method[evaluate, return_type[type[Object]], modifier[public], parameter[req, res]] begin[{]
local_variable[type[String], seqName]
local_variable[type[ICounterStore], counterStore]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=seqName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNextId, postfix_operators=[], prefix_operators=[], qualifier=counterStore, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to retrieve next sequence in for sequance '"), operandr=MemberReference(member=seqName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[evaluate] operator[SEP] identifier[TaskRequest] identifier[req] , identifier[TaskResponse] identifier[res] operator[SEP] {
Keyword[final] identifier[String] identifier[seqName] operator[=] operator[SEP] identifier[String] operator[SEP] Keyword[this] operator[SEP] identifier[seqNamePhrase] operator[SEP] identifier[evaluate] operator[SEP] identifier[req] , identifier[res] operator[SEP] operator[SEP] Keyword[final] identifier[ICounterStore] identifier[counterStore] operator[=] identifier[CounterStoreLocator] operator[SEP] identifier[getCounterStore] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[counterStore] operator[SEP] identifier[getNextId] operator[SEP] identifier[seqName] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[seqName] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
void init() throws V4L4JException{
try {
super.init();
} catch (ImageFormatException ife){
if(format == -1){
String msg =
"v4l4j was unable to find image format supported by the"
+ " \nvideo device and that can be converted to YUV420.\n"
+ "Please let the author know about this, so that support\n"
+ "for this video device can be improved. See \nREADME file"
+ " on how to submit v4l4j reports.";
System.err.println(msg);
ife = new ImageFormatException(msg);
}
throw ife;
}
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[default], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=SuperMethodInvocation(arguments=[], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="v4l4j was unable to find image format supported by the"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" \nvideo device and that can be converted to YUV420.\n"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Please let the author know about this, so that support\n"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="for this video device can be improved. See \nREADME file"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on how to submit v4l4j reports."), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ife, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=msg, 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=ImageFormatException, sub_type=None))), label=None)])), ThrowStatement(expression=MemberReference(member=ife, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ife, types=['ImageFormatException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[void] identifier[init] operator[SEP] operator[SEP] Keyword[throws] identifier[V4L4JException] {
Keyword[try] {
Keyword[super] operator[SEP] identifier[init] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ImageFormatException] identifier[ife] operator[SEP] {
Keyword[if] operator[SEP] identifier[format] operator[==] operator[-] Other[1] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[ife] operator[=] Keyword[new] identifier[ImageFormatException] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[ife] operator[SEP]
}
}
|
public Javalin delete(@NotNull String path, @NotNull Handler handler) {
return addHandler(HandlerType.DELETE, path, handler);
} | class class_name[name] begin[{]
method[delete, return_type[type[Javalin]], modifier[public], parameter[path, handler]] begin[{]
return[call[.addHandler, parameter[member[HandlerType.DELETE], member[.path], member[.handler]]]]
end[}]
END[}] | Keyword[public] identifier[Javalin] identifier[delete] operator[SEP] annotation[@] identifier[NotNull] identifier[String] identifier[path] , annotation[@] identifier[NotNull] identifier[Handler] identifier[handler] operator[SEP] {
Keyword[return] identifier[addHandler] operator[SEP] identifier[HandlerType] operator[SEP] identifier[DELETE] , identifier[path] , identifier[handler] operator[SEP] operator[SEP]
}
|
protected void updatePropertyFile() {
final String methodName = "updatePropertyFile()";
final File f = new File(htodPropertyFileName);
final CacheOnDisk cod = this;
traceDebug(methodName, "cacheName=" + this.cacheName);
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
FileOutputStream fos = null;
Properties htodProp = new Properties();
try {
fos = new FileOutputStream(f);
htodProp.put(HTOD_VERSION, HTOD_VERSION_NUM);
htodProp.put(DISABLE_DEPENDENCY_ID, Boolean.toString(disableDependencyId));
htodProp.put(DISABLE_TEMPLATE_SUPPORT, Boolean.toString(disableTemplatesSupport));
long cacheSizeInBytes = 0;
int fieldCheck = 0;
if (cod.enableCacheSizeInBytes) {
if (cod.currentCacheSizeInBytes < cod.htod.minDiskCacheSizeInBytes) {
cod.currentCacheSizeInBytes = cod.htod.minDiskCacheSizeInBytes;
}
cacheSizeInBytes = cod.currentCacheSizeInBytes;
htodProp.put(CACHE_SIZE_IN_BYTES, Long.toString(cacheSizeInBytes));
String s = String.valueOf(cacheSizeInBytes);
byte[] b = s.getBytes("UTF-8");
fieldCheck = 0;
for (int i = 0; i < b.length; i++) {
fieldCheck += (int) b[i];
}
fieldCheck = fieldCheck * 3;
htodProp.put(FIELD_CHECK, String.valueOf(fieldCheck));
htodProp.put(DATA_GB, String.valueOf(cod.diskCacheSizeInfo.currentDataGB));
htodProp.put(DEPID_GB, String.valueOf(cod.diskCacheSizeInfo.currentDependencyIdGB));
htodProp.put(TEMPLATE_GB, String.valueOf(cod.diskCacheSizeInfo.currentTemplateGB));
traceDebug(methodName, "cacheName=" + cod.cacheName + " disableDependencyId=" + disableDependencyId
+ " disableTemplatesSupport=" + disableTemplatesSupport + " cacheSizeInBytes=" + cacheSizeInBytes + " fieldCheck="
+ fieldCheck + " dataGB=" + cod.diskCacheSizeInfo.currentDataGB + " dependencyIdGB="
+ cod.diskCacheSizeInfo.currentDependencyIdGB + " templateGB=" + cod.diskCacheSizeInfo.currentTemplateGB);
} else {
traceDebug(methodName, "cacheName=" + cod.cacheName + " disableDependencyId=" + disableDependencyId
+ " disableTemplatesSupport=" + disableTemplatesSupport);
}
htodProp.store(fos, "HTOD properties - Do not modify the properties");
} catch (Throwable t) {
com.ibm.ws.ffdc.FFDCFilter.processException(t, "com.ibm.ws.cache.CacheOnDisk.updatePropertyFile", "651", cod);
traceDebug(methodName, "cacheName=" + cod.cacheName + "\nException: " + ExceptionUtility.getStackTrace(t));
} finally {
try {
if (fos != null) {
fos.close();
}
} catch (Throwable t) {
com.ibm.ws.ffdc.FFDCFilter.processException(t, "com.ibm.ws.cache.CacheOnDisk.updatePropertyFile", "859", cod);
traceDebug(methodName, "cacheName=" + cod.cacheName + "\nException: " + ExceptionUtility.getStackTrace(t));
}
}
return null;
}
});
} | class class_name[name] begin[{]
method[updatePropertyFile, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[String], methodName]
local_variable[type[File], f]
local_variable[type[CacheOnDisk], cod]
call[.traceDebug, parameter[member[.methodName], binary_operation[literal["cacheName="], +, THIS[member[None.cacheName]]]]]
call[AccessController.doPrivileged, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=fos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None)), name=htodProp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=HTOD_VERSION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=HTOD_VERSION_NUM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DISABLE_DEPENDENCY_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=disableDependencyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DISABLE_TEMPLATE_SUPPORT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=disableTemplatesSupport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=cacheSizeInBytes)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=fieldCheck)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MemberReference(member=enableCacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cacheName="), operandr=MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" disableDependencyId="), operator=+), operandr=MemberReference(member=disableDependencyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" disableTemplatesSupport="), operator=+), operandr=MemberReference(member=disableTemplatesSupport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=traceDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentCacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), operandr=MemberReference(member=minDiskCacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=cod.htod, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentCacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), type==, value=MemberReference(member=minDiskCacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=cod.htod, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=currentCacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CACHE_SIZE_IN_BYTES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=cacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=b)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fieldCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fieldCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Cast(expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int))), 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=b, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fieldCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=fieldCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FIELD_CHECK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=fieldCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DATA_GB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=currentDataGB, postfix_operators=[], prefix_operators=[], qualifier=cod.diskCacheSizeInfo, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEPID_GB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=currentDependencyIdGB, postfix_operators=[], prefix_operators=[], qualifier=cod.diskCacheSizeInfo, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TEMPLATE_GB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=currentTemplateGB, postfix_operators=[], prefix_operators=[], qualifier=cod.diskCacheSizeInfo, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cacheName="), operandr=MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" disableDependencyId="), operator=+), operandr=MemberReference(member=disableDependencyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" disableTemplatesSupport="), operator=+), operandr=MemberReference(member=disableTemplatesSupport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" cacheSizeInBytes="), operator=+), operandr=MemberReference(member=cacheSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" fieldCheck="), operator=+), operandr=MemberReference(member=fieldCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" dataGB="), operator=+), operandr=MemberReference(member=currentDataGB, postfix_operators=[], prefix_operators=[], qualifier=cod.diskCacheSizeInfo, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" dependencyIdGB="), operator=+), operandr=MemberReference(member=currentDependencyIdGB, postfix_operators=[], prefix_operators=[], qualifier=cod.diskCacheSizeInfo, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" templateGB="), operator=+), operandr=MemberReference(member=currentTemplateGB, postfix_operators=[], prefix_operators=[], qualifier=cod.diskCacheSizeInfo, selectors=[]), operator=+)], member=traceDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HTOD properties - Do not modify the properties")], member=store, postfix_operators=[], prefix_operators=[], qualifier=htodProp, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.cache.CacheOnDisk.updatePropertyFile"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="651"), MemberReference(member=cod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cacheName="), operandr=MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nException: "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtility, selectors=[], type_arguments=None), operator=+)], member=traceDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fos, 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=fos, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.cache.CacheOnDisk.updatePropertyFile"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="859"), MemberReference(member=cod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cacheName="), operandr=MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nException: "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtility, selectors=[], type_arguments=None), operator=+)], member=traceDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)], label=None, resources=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrivilegedAction, sub_type=None))]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[updatePropertyFile] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[methodName] operator[=] literal[String] operator[SEP] Keyword[final] identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[htodPropertyFileName] operator[SEP] operator[SEP] Keyword[final] identifier[CacheOnDisk] identifier[cod] operator[=] Keyword[this] operator[SEP] identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[cacheName] operator[SEP] operator[SEP] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[SEP] operator[SEP] {
Keyword[public] identifier[Object] identifier[run] operator[SEP] operator[SEP] {
identifier[FileOutputStream] identifier[fos] operator[=] Other[null] operator[SEP] identifier[Properties] identifier[htodProp] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[fos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[f] operator[SEP] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[HTOD_VERSION] , identifier[HTOD_VERSION_NUM] operator[SEP] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[DISABLE_DEPENDENCY_ID] , identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] identifier[disableDependencyId] operator[SEP] operator[SEP] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[DISABLE_TEMPLATE_SUPPORT] , identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] identifier[disableTemplatesSupport] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[cacheSizeInBytes] operator[=] Other[0] operator[SEP] Keyword[int] identifier[fieldCheck] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[cod] operator[SEP] identifier[enableCacheSizeInBytes] operator[SEP] {
Keyword[if] operator[SEP] identifier[cod] operator[SEP] identifier[currentCacheSizeInBytes] operator[<] identifier[cod] operator[SEP] identifier[htod] operator[SEP] identifier[minDiskCacheSizeInBytes] operator[SEP] {
identifier[cod] operator[SEP] identifier[currentCacheSizeInBytes] operator[=] identifier[cod] operator[SEP] identifier[htod] operator[SEP] identifier[minDiskCacheSizeInBytes] operator[SEP]
}
identifier[cacheSizeInBytes] operator[=] identifier[cod] operator[SEP] identifier[currentCacheSizeInBytes] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[CACHE_SIZE_IN_BYTES] , identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[cacheSizeInBytes] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[cacheSizeInBytes] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[s] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fieldCheck] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[b] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[fieldCheck] operator[+=] operator[SEP] Keyword[int] operator[SEP] identifier[b] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
identifier[fieldCheck] operator[=] identifier[fieldCheck] operator[*] Other[3] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[FIELD_CHECK] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[fieldCheck] operator[SEP] operator[SEP] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[DATA_GB] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[cod] operator[SEP] identifier[diskCacheSizeInfo] operator[SEP] identifier[currentDataGB] operator[SEP] operator[SEP] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[DEPID_GB] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[cod] operator[SEP] identifier[diskCacheSizeInfo] operator[SEP] identifier[currentDependencyIdGB] operator[SEP] operator[SEP] operator[SEP] identifier[htodProp] operator[SEP] identifier[put] operator[SEP] identifier[TEMPLATE_GB] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[cod] operator[SEP] identifier[diskCacheSizeInfo] operator[SEP] identifier[currentTemplateGB] operator[SEP] operator[SEP] operator[SEP] identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] identifier[cod] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[+] identifier[disableDependencyId] operator[+] literal[String] operator[+] identifier[disableTemplatesSupport] operator[+] literal[String] operator[+] identifier[cacheSizeInBytes] operator[+] literal[String] operator[+] identifier[fieldCheck] operator[+] literal[String] operator[+] identifier[cod] operator[SEP] identifier[diskCacheSizeInfo] operator[SEP] identifier[currentDataGB] operator[+] literal[String] operator[+] identifier[cod] operator[SEP] identifier[diskCacheSizeInfo] operator[SEP] identifier[currentDependencyIdGB] operator[+] literal[String] operator[+] identifier[cod] operator[SEP] identifier[diskCacheSizeInfo] operator[SEP] identifier[currentTemplateGB] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] identifier[cod] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[+] identifier[disableDependencyId] operator[+] literal[String] operator[+] identifier[disableTemplatesSupport] operator[SEP] operator[SEP]
}
identifier[htodProp] operator[SEP] identifier[store] operator[SEP] identifier[fos] , literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[t] , literal[String] , literal[String] , identifier[cod] operator[SEP] operator[SEP] identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] identifier[cod] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[+] identifier[ExceptionUtility] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[t] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[fos] operator[!=] Other[null] operator[SEP] {
identifier[fos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[t] , literal[String] , literal[String] , identifier[cod] operator[SEP] operator[SEP] identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] identifier[cod] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[+] identifier[ExceptionUtility] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[t] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@SuppressWarnings("deprecation")
public void killJob(JobID jobId, Map<String, InetAddress> allTrackers) {
for (Map.Entry<String, InetAddress> entry : allTrackers.entrySet()) {
String trackerName = entry.getKey();
InetAddress addr = entry.getValue();
String description = "KillJobAction " + jobId;
ActionToSend action = new ActionToSend(trackerName, addr,
new KillJobAction(jobId), description);
allWorkQueues.enqueueAction(action);
LOG.info("Queueing " + description + " to worker " +
trackerName + "(" + addr.host + ":" + addr.port + ")");
}
} | class class_name[name] begin[{]
method[killJob, return_type[void], modifier[public], parameter[jobId, allTrackers]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=trackerName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=addr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="KillJobAction "), operandr=MemberReference(member=jobId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=description)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=trackerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=addr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=jobId, 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=KillJobAction, sub_type=None)), MemberReference(member=description, 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=ActionToSend, sub_type=None)), name=action)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ActionToSend, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enqueueAction, postfix_operators=[], prefix_operators=[], qualifier=allWorkQueues, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Queueing "), operandr=MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to worker "), operator=+), operandr=MemberReference(member=trackerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="("), operator=+), operandr=MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=allTrackers, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[killJob] operator[SEP] identifier[JobID] identifier[jobId] , identifier[Map] operator[<] identifier[String] , identifier[InetAddress] operator[>] identifier[allTrackers] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[InetAddress] operator[>] identifier[entry] operator[:] identifier[allTrackers] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[trackerName] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[InetAddress] identifier[addr] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[description] operator[=] literal[String] operator[+] identifier[jobId] operator[SEP] identifier[ActionToSend] identifier[action] operator[=] Keyword[new] identifier[ActionToSend] operator[SEP] identifier[trackerName] , identifier[addr] , Keyword[new] identifier[KillJobAction] operator[SEP] identifier[jobId] operator[SEP] , identifier[description] operator[SEP] operator[SEP] identifier[allWorkQueues] operator[SEP] identifier[enqueueAction] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[description] operator[+] literal[String] operator[+] identifier[trackerName] operator[+] literal[String] operator[+] identifier[addr] operator[SEP] identifier[host] operator[+] literal[String] operator[+] identifier[addr] operator[SEP] identifier[port] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
protected int getNextAttributeIdentity(int identity) {
// Assume that attributes and namespace nodes immediately follow the element
while (DTM.NULL != (identity = getNextNodeIdentity(identity))) {
int type = _type(identity);
if (type == DTM.ATTRIBUTE_NODE) {
return identity;
} else if (type != DTM.NAMESPACE_NODE) {
break;
}
}
return DTM.NULL;
} | class class_name[name] begin[{]
method[getNextAttributeIdentity, return_type[type[int]], modifier[protected], parameter[identity]] begin[{]
while[binary_operation[member[DTM.NULL], !=, assign[member[.identity], call[.getNextNodeIdentity, parameter[member[.identity]]]]]] begin[{]
local_variable[type[int], type]
if[binary_operation[member[.type], ==, member[DTM.ATTRIBUTE_NODE]]] begin[{]
return[member[.identity]]
else begin[{]
if[binary_operation[member[.type], !=, member[DTM.NAMESPACE_NODE]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
end[}]
end[}]
return[member[DTM.NULL]]
end[}]
END[}] | Keyword[protected] Keyword[int] identifier[getNextAttributeIdentity] operator[SEP] Keyword[int] identifier[identity] operator[SEP] {
Keyword[while] operator[SEP] identifier[DTM] operator[SEP] identifier[NULL] operator[!=] operator[SEP] identifier[identity] operator[=] identifier[getNextNodeIdentity] operator[SEP] identifier[identity] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[identity] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[DTM] operator[SEP] identifier[ATTRIBUTE_NODE] operator[SEP] {
Keyword[return] identifier[identity] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[!=] identifier[DTM] operator[SEP] identifier[NAMESPACE_NODE] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[DTM] operator[SEP] identifier[NULL] operator[SEP]
}
|
private void addRawPut(List<Put> puts, byte[] rowKey, byte[] rawColumn,
byte[] lastModificationColumn, FileStatus fileStatus) throws IOException {
byte[] rawBytes = readJobFile(fileStatus);
Put raw = new Put(rowKey);
byte[] rawLastModifiedMillis =
Bytes.toBytes(fileStatus.getModificationTime());
raw.addColumn(Constants.RAW_FAM_BYTES, rawColumn, rawBytes);
raw.addColumn(Constants.INFO_FAM_BYTES, lastModificationColumn,
rawLastModifiedMillis);
puts.add(raw);
} | class class_name[name] begin[{]
method[addRawPut, return_type[void], modifier[private], parameter[puts, rowKey, rawColumn, lastModificationColumn, fileStatus]] begin[{]
local_variable[type[byte], rawBytes]
local_variable[type[Put], raw]
local_variable[type[byte], rawLastModifiedMillis]
call[raw.addColumn, parameter[member[Constants.RAW_FAM_BYTES], member[.rawColumn], member[.rawBytes]]]
call[raw.addColumn, parameter[member[Constants.INFO_FAM_BYTES], member[.lastModificationColumn], member[.rawLastModifiedMillis]]]
call[puts.add, parameter[member[.raw]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addRawPut] operator[SEP] identifier[List] operator[<] identifier[Put] operator[>] identifier[puts] , Keyword[byte] operator[SEP] operator[SEP] identifier[rowKey] , Keyword[byte] operator[SEP] operator[SEP] identifier[rawColumn] , Keyword[byte] operator[SEP] operator[SEP] identifier[lastModificationColumn] , identifier[FileStatus] identifier[fileStatus] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[byte] operator[SEP] operator[SEP] identifier[rawBytes] operator[=] identifier[readJobFile] operator[SEP] identifier[fileStatus] operator[SEP] operator[SEP] identifier[Put] identifier[raw] operator[=] Keyword[new] identifier[Put] operator[SEP] identifier[rowKey] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rawLastModifiedMillis] operator[=] identifier[Bytes] operator[SEP] identifier[toBytes] operator[SEP] identifier[fileStatus] operator[SEP] identifier[getModificationTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[raw] operator[SEP] identifier[addColumn] operator[SEP] identifier[Constants] operator[SEP] identifier[RAW_FAM_BYTES] , identifier[rawColumn] , identifier[rawBytes] operator[SEP] operator[SEP] identifier[raw] operator[SEP] identifier[addColumn] operator[SEP] identifier[Constants] operator[SEP] identifier[INFO_FAM_BYTES] , identifier[lastModificationColumn] , identifier[rawLastModifiedMillis] operator[SEP] operator[SEP] identifier[puts] operator[SEP] identifier[add] operator[SEP] identifier[raw] operator[SEP] operator[SEP]
}
|
@Override
public EJBHome getEJBHome()
{
try
{
EJSWrapper wrapper = home.getWrapper().getRemoteWrapper();
Object wrapperRef = container.getEJBRuntime().getRemoteReference(wrapper);
// The EJB spec does not require us to narrow to the actual home
// interface, but since we have to narrow to EJBHome anyway, we
// might as well narrow to the specific interface. It seems like it
// might be an oversight anyway given that the spec does require
// SessionContext.getEJBObject to narrow.
return (EJBHome) PortableRemoteObject.narrow(wrapperRef, home.beanMetaData.homeInterfaceClass);
} catch (IllegalStateException ise) { // d116480
// FFDC not logged for this spec required scenario
throw ise;
} catch (Exception ex) {
// p97440 - start of change
// This should never happen. Something is wrong.
// Need to throw a runtime exception since this is a
// Java EE architected interface that does not allow a checked
// exceptions to be thrown. So, throw ContainerEJBException.
FFDCFilter.processException(ex, CLASS_NAME + ".getEJBHome", "522", this);
ContainerEJBException ex2 = new ContainerEJBException("Failed to get the wrapper for home.", ex);
Tr.error(tc
, "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E"
, new Object[] { ex, ex2.toString() }); // d194031
throw ex2;
// p97440 - end of change
}
} | class class_name[name] begin[{]
method[getEJBHome, return_type[type[EJBHome]], modifier[public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWrapper, postfix_operators=[], prefix_operators=[], qualifier=home, selectors=[MethodInvocation(arguments=[], member=getRemoteWrapper, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=wrapper)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EJSWrapper, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEJBRuntime, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[MethodInvocation(arguments=[MemberReference(member=wrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRemoteReference, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=wrapperRef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=wrapperRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=homeInterfaceClass, postfix_operators=[], prefix_operators=[], qualifier=home.beanMetaData, selectors=[])], member=narrow, postfix_operators=[], prefix_operators=[], qualifier=PortableRemoteObject, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EJBHome, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=ise, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ise, types=['IllegalStateException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".getEJBHome"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="522"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get the wrapper for home."), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ContainerEJBException, sub_type=None)), name=ex2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ContainerEJBException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=ex2, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=error, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ex2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EJBHome] identifier[getEJBHome] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[EJSWrapper] identifier[wrapper] operator[=] identifier[home] operator[SEP] identifier[getWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[getRemoteWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[wrapperRef] operator[=] identifier[container] operator[SEP] identifier[getEJBRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[getRemoteReference] operator[SEP] identifier[wrapper] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[EJBHome] operator[SEP] identifier[PortableRemoteObject] operator[SEP] identifier[narrow] operator[SEP] identifier[wrapperRef] , identifier[home] operator[SEP] identifier[beanMetaData] operator[SEP] identifier[homeInterfaceClass] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[ise] operator[SEP] {
Keyword[throw] identifier[ise] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ex] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[ContainerEJBException] identifier[ex2] operator[=] Keyword[new] identifier[ContainerEJBException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[ex] , identifier[ex2] operator[SEP] identifier[toString] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[throw] identifier[ex2] operator[SEP]
}
}
|
public static<R> R execute(Transactional<R> exe, TransactionalProvider provider, TimestampProvider times) throws BackendException {
StoreTransaction txh = null;
try {
txh = provider.openTx();
if (!txh.getConfiguration().hasCommitTime()) txh.getConfiguration().setCommitTime(times.getTime());
return exe.call(txh);
} catch (BackendException e) {
if (txh!=null) txh.rollback();
txh=null;
throw e;
} finally {
if (txh!=null) txh.commit();
}
} | class class_name[name] begin[{]
method[execute, return_type[type[R]], modifier[public static], parameter[exe, provider, times]] begin[{]
local_variable[type[StoreTransaction], txh]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=txh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openTx, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=['!'], qualifier=txh, selectors=[MethodInvocation(arguments=[], member=hasCommitTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=txh, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=times, selectors=[], type_arguments=None)], member=setCommitTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=txh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=call, postfix_operators=[], prefix_operators=[], qualifier=exe, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=txh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=rollback, postfix_operators=[], prefix_operators=[], qualifier=txh, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=txh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BackendException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=txh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=txh, selectors=[], type_arguments=None), label=None))], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[R] operator[>] identifier[R] identifier[execute] operator[SEP] identifier[Transactional] operator[<] identifier[R] operator[>] identifier[exe] , identifier[TransactionalProvider] identifier[provider] , identifier[TimestampProvider] identifier[times] operator[SEP] Keyword[throws] identifier[BackendException] {
identifier[StoreTransaction] identifier[txh] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[txh] operator[=] identifier[provider] operator[SEP] identifier[openTx] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[txh] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[hasCommitTime] operator[SEP] operator[SEP] operator[SEP] identifier[txh] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[setCommitTime] operator[SEP] identifier[times] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[exe] operator[SEP] identifier[call] operator[SEP] identifier[txh] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[BackendException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[txh] operator[!=] Other[null] operator[SEP] identifier[txh] operator[SEP] identifier[rollback] operator[SEP] operator[SEP] operator[SEP] identifier[txh] operator[=] Other[null] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[txh] operator[!=] Other[null] operator[SEP] identifier[txh] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public <T> T queryColumns(K key, List<N> columns,
ColumnFamilyRowMapper<K, N, T> mapper) {
HSlicePredicate<N> predicate = new HSlicePredicate<N>(topSerializer);
predicate.setColumnNames(columns);
return doExecuteSlice(key, predicate, mapper);
} | class class_name[name] begin[{]
method[queryColumns, return_type[type[T]], modifier[public], parameter[key, columns, mapper]] begin[{]
local_variable[type[HSlicePredicate], predicate]
call[predicate.setColumnNames, parameter[member[.columns]]]
return[call[.doExecuteSlice, parameter[member[.key], member[.predicate], member[.mapper]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[queryColumns] operator[SEP] identifier[K] identifier[key] , identifier[List] operator[<] identifier[N] operator[>] identifier[columns] , identifier[ColumnFamilyRowMapper] operator[<] identifier[K] , identifier[N] , identifier[T] operator[>] identifier[mapper] operator[SEP] {
identifier[HSlicePredicate] operator[<] identifier[N] operator[>] identifier[predicate] operator[=] Keyword[new] identifier[HSlicePredicate] operator[<] identifier[N] operator[>] operator[SEP] identifier[topSerializer] operator[SEP] operator[SEP] identifier[predicate] operator[SEP] identifier[setColumnNames] operator[SEP] identifier[columns] operator[SEP] operator[SEP] Keyword[return] identifier[doExecuteSlice] operator[SEP] identifier[key] , identifier[predicate] , identifier[mapper] operator[SEP] operator[SEP]
}
|
private static ByteBuffer putUnsignedLong(ByteBuffer buffer, long v) {
buffer.putInt(0);
return putUnsignedInt(buffer, (int)v);
} | class class_name[name] begin[{]
method[putUnsignedLong, return_type[type[ByteBuffer]], modifier[private static], parameter[buffer, v]] begin[{]
call[buffer.putInt, parameter[literal[0]]]
return[call[.putUnsignedInt, parameter[member[.buffer], Cast(expression=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[ByteBuffer] identifier[putUnsignedLong] operator[SEP] identifier[ByteBuffer] identifier[buffer] , Keyword[long] identifier[v] operator[SEP] {
identifier[buffer] operator[SEP] identifier[putInt] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[putUnsignedInt] operator[SEP] identifier[buffer] , operator[SEP] Keyword[int] operator[SEP] identifier[v] operator[SEP] operator[SEP]
}
|
public void loadFromProperties(java.util.Properties properties) {
for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) {
String key = (String) i.next();
if (!key.endsWith(".desc")) {
try {
Class clazz = Class.forName(properties.getProperty(key));
String desc = properties.getProperty(key + ".desc", "");
addAlias(new Alias(key, desc, clazz));
} catch (ClassNotFoundException e) {
System.err.println("Unable to locate class " + properties.getProperty(key));
}
}
}
} | class class_name[name] begin[{]
method[loadFromProperties, return_type[void], modifier[public], parameter[properties]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".desc")], member=endsWith, postfix_operators=[], prefix_operators=['!'], qualifier=key, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None)], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".desc"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), name=desc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=desc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clazz, 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=Alias, sub_type=None))], member=addAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to locate class "), operandr=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[loadFromProperties] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] {
Keyword[for] operator[SEP] identifier[Iterator] identifier[i] operator[=] identifier[properties] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[key] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[key] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[Class] identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[desc] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[addAlias] operator[SEP] Keyword[new] identifier[Alias] operator[SEP] identifier[key] , identifier[desc] , identifier[clazz] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
|
private byte[] blockForWrite(int index) throws IOException {
if (index >= blockCount) {
int additionalBlocksNeeded = index - blockCount + 1;
disk.allocate(this, additionalBlocksNeeded);
}
return blocks[index];
} | class class_name[name] begin[{]
method[blockForWrite, return_type[type[byte]], modifier[private], parameter[index]] begin[{]
if[binary_operation[member[.index], >=, member[.blockCount]]] begin[{]
local_variable[type[int], additionalBlocksNeeded]
call[disk.allocate, parameter[THIS[], member[.additionalBlocksNeeded]]]
else begin[{]
None
end[}]
return[member[.blocks]]
end[}]
END[}] | Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[blockForWrite] operator[SEP] Keyword[int] identifier[index] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[index] operator[>=] identifier[blockCount] operator[SEP] {
Keyword[int] identifier[additionalBlocksNeeded] operator[=] identifier[index] operator[-] identifier[blockCount] operator[+] Other[1] operator[SEP] identifier[disk] operator[SEP] identifier[allocate] operator[SEP] Keyword[this] , identifier[additionalBlocksNeeded] operator[SEP] operator[SEP]
}
Keyword[return] identifier[blocks] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
|
public IfcPropertySetTemplateTypeEnum createIfcPropertySetTemplateTypeEnumFromString(EDataType eDataType,
String initialValue) {
IfcPropertySetTemplateTypeEnum result = IfcPropertySetTemplateTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | class class_name[name] begin[{]
method[createIfcPropertySetTemplateTypeEnumFromString, return_type[type[IfcPropertySetTemplateTypeEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{]
local_variable[type[IfcPropertySetTemplateTypeEnum], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), 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[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[IfcPropertySetTemplateTypeEnum] identifier[createIfcPropertySetTemplateTypeEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] {
identifier[IfcPropertySetTemplateTypeEnum] identifier[result] operator[=] identifier[IfcPropertySetTemplateTypeEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public void setSubscribers(java.util.Collection<String> subscribers) {
if (subscribers == null) {
this.subscribers = null;
return;
}
this.subscribers = new java.util.ArrayList<String>(subscribers);
} | class class_name[name] begin[{]
method[setSubscribers, return_type[void], modifier[public], parameter[subscribers]] begin[{]
if[binary_operation[member[.subscribers], ==, literal[null]]] begin[{]
assign[THIS[member[None.subscribers]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.subscribers]], ClassCreator(arguments=[MemberReference(member=subscribers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSubscribers] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[subscribers] operator[SEP] {
Keyword[if] operator[SEP] identifier[subscribers] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[subscribers] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[subscribers] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[subscribers] operator[SEP] operator[SEP]
}
|
public void insertItem(T value, String text, int index) {
insertItemInternal(value, text, index, true);
} | class class_name[name] begin[{]
method[insertItem, return_type[void], modifier[public], parameter[value, text, index]] begin[{]
call[.insertItemInternal, parameter[member[.value], member[.text], member[.index], literal[true]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[insertItem] operator[SEP] identifier[T] identifier[value] , identifier[String] identifier[text] , Keyword[int] identifier[index] operator[SEP] {
identifier[insertItemInternal] operator[SEP] identifier[value] , identifier[text] , identifier[index] , literal[boolean] operator[SEP] operator[SEP]
}
|
public void setExportOnlyColumns(final String[] exportOnlyColumns) {
if (exportOnlyColumns != null) {
this.exportOnlyColumns = exportOnlyColumns.clone();
} else {
this.exportOnlyColumns = null;
}
} | class class_name[name] begin[{]
method[setExportOnlyColumns, return_type[void], modifier[public], parameter[exportOnlyColumns]] begin[{]
if[binary_operation[member[.exportOnlyColumns], !=, literal[null]]] begin[{]
assign[THIS[member[None.exportOnlyColumns]], call[exportOnlyColumns.clone, parameter[]]]
else begin[{]
assign[THIS[member[None.exportOnlyColumns]], literal[null]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setExportOnlyColumns] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[exportOnlyColumns] operator[SEP] {
Keyword[if] operator[SEP] identifier[exportOnlyColumns] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[exportOnlyColumns] operator[=] identifier[exportOnlyColumns] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[exportOnlyColumns] operator[=] Other[null] operator[SEP]
}
}
|
public void setSnapshotDetails(java.util.Collection<SnapshotDetail> snapshotDetails) {
if (snapshotDetails == null) {
this.snapshotDetails = null;
return;
}
this.snapshotDetails = new com.amazonaws.internal.SdkInternalList<SnapshotDetail>(snapshotDetails);
} | class class_name[name] begin[{]
method[setSnapshotDetails, return_type[void], modifier[public], parameter[snapshotDetails]] begin[{]
if[binary_operation[member[.snapshotDetails], ==, literal[null]]] begin[{]
assign[THIS[member[None.snapshotDetails]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.snapshotDetails]], ClassCreator(arguments=[MemberReference(member=snapshotDetails, 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=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=SnapshotDetail, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSnapshotDetails] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[SnapshotDetail] operator[>] identifier[snapshotDetails] operator[SEP] {
Keyword[if] operator[SEP] identifier[snapshotDetails] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[snapshotDetails] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[snapshotDetails] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[SnapshotDetail] operator[>] operator[SEP] identifier[snapshotDetails] operator[SEP] operator[SEP]
}
|
public JoinClause crossJoinAllNodesAs( String alias ) {
// Expect there to be a source already ...
return new JoinClause(namedSelector(AllNodes.ALL_NODES_NAME + " AS " + alias), JoinType.CROSS);
} | class class_name[name] begin[{]
method[crossJoinAllNodesAs, return_type[type[JoinClause]], modifier[public], parameter[alias]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ALL_NODES_NAME, postfix_operators=[], prefix_operators=[], qualifier=AllNodes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" AS "), operator=+), operandr=MemberReference(member=alias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=namedSelector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=CROSS, postfix_operators=[], prefix_operators=[], qualifier=JoinType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JoinClause, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[JoinClause] identifier[crossJoinAllNodesAs] operator[SEP] identifier[String] identifier[alias] operator[SEP] {
Keyword[return] Keyword[new] identifier[JoinClause] operator[SEP] identifier[namedSelector] operator[SEP] identifier[AllNodes] operator[SEP] identifier[ALL_NODES_NAME] operator[+] literal[String] operator[+] identifier[alias] operator[SEP] , identifier[JoinType] operator[SEP] identifier[CROSS] operator[SEP] operator[SEP]
}
|
private static String arraysToString(final Object[] a) {
if (a == null) {
return "null";
}
final int iMax = a.length - 1;
if (iMax == -1) {
return "[]";
}
final StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0;; i++) {
b.append(String.valueOf(a[i]));
if (i == iMax) {
return b.append(']').toString();
}
b.append(", ");
}
} | class class_name[name] begin[{]
method[arraysToString, return_type[type[String]], modifier[private static], parameter[a]] begin[{]
if[binary_operation[member[.a], ==, literal[null]]] begin[{]
return[literal["null"]]
else begin[{]
None
end[}]
local_variable[type[int], iMax]
if[binary_operation[member[.iMax], ==, literal[1]]] begin[{]
return[literal["[]"]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], b]
call[b.append, parameter[literal['[']]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=iMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']')], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[MethodInvocation(arguments=[], member=toString, 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=b, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=None, init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[arraysToString] operator[SEP] Keyword[final] identifier[Object] operator[SEP] operator[SEP] identifier[a] operator[SEP] {
Keyword[if] operator[SEP] identifier[a] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[final] Keyword[int] identifier[iMax] operator[=] identifier[a] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[iMax] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[final] identifier[StringBuilder] identifier[b] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[b] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[a] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] identifier[iMax] operator[SEP] {
Keyword[return] identifier[b] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[b] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public void setLinearFactor(float x, float y, float z) {
Native3DRigidBody.setLinearFactor(getNative(), x, y, z);
} | class class_name[name] begin[{]
method[setLinearFactor, return_type[void], modifier[public], parameter[x, y, z]] begin[{]
call[Native3DRigidBody.setLinearFactor, parameter[call[.getNative, parameter[]], member[.x], member[.y], member[.z]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setLinearFactor] operator[SEP] Keyword[float] identifier[x] , Keyword[float] identifier[y] , Keyword[float] identifier[z] operator[SEP] {
identifier[Native3DRigidBody] operator[SEP] identifier[setLinearFactor] operator[SEP] identifier[getNative] operator[SEP] operator[SEP] , identifier[x] , identifier[y] , identifier[z] operator[SEP] operator[SEP]
}
|
public void setStatusMapping(Map<String, Integer> statusMapping) {
Assert.notNull(statusMapping, "StatusMapping must not be null");
this.statusMapping = new HashMap<>(statusMapping);
} | class class_name[name] begin[{]
method[setStatusMapping, return_type[void], modifier[public], parameter[statusMapping]] begin[{]
call[Assert.notNull, parameter[member[.statusMapping], literal["StatusMapping must not be null"]]]
assign[THIS[member[None.statusMapping]], ClassCreator(arguments=[MemberReference(member=statusMapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setStatusMapping] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[statusMapping] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[statusMapping] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[statusMapping] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[statusMapping] operator[SEP] operator[SEP]
}
|
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
validateConfiguration();
try {
// set git flow configuration
initGitFlowConfig();
// check uncommitted changes
checkUncommittedChanges();
String tag = null;
if (settings.isInteractiveMode()) {
// get tags
String tagsStr = gitFindTags();
if (StringUtils.isBlank(tagsStr)) {
throw new MojoFailureException("There are no tags.");
}
try {
tag = prompter.prompt("Choose tag to start support branch",
Arrays.asList(tagsStr.split("\\r?\\n")));
} catch (PrompterException e) {
throw new MojoFailureException("support-start", e);
}
} else if (StringUtils.isNotBlank(tagName)) {
if (gitCheckTagExists(tagName)) {
tag = tagName;
} else {
throw new MojoFailureException("The tag '" + tagName + "' doesn't exist.");
}
} else {
getLog().info("The tagName is blank. Using the last tag.");
tag = gitFindLastTag();
}
if (StringUtils.isBlank(tag)) {
throw new MojoFailureException("Tag is blank.");
}
// git for-each-ref refs/heads/support/...
final boolean supportBranchExists = gitCheckBranchExists(gitFlowConfig
.getSupportBranchPrefix() + tag);
if (supportBranchExists) {
throw new MojoFailureException(
"Support branch with that name already exists.");
}
// git checkout -b ... tag
gitCreateAndCheckout(gitFlowConfig.getSupportBranchPrefix() + tag, tag);
if (installProject) {
// mvn clean install
mvnCleanInstall();
}
if (pushRemote) {
gitPush(gitFlowConfig.getSupportBranchPrefix() + tag, false);
}
} catch (CommandLineException e) {
throw new MojoFailureException("support-start", e);
}
} | class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[]] begin[{]
call[.validateConfiguration, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=initGitFlowConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=checkUncommittedChanges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=tag)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isInteractiveMode, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNotBlank, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The tagName is blank. Using the last tag.")], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=gitFindLastTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=gitCheckTagExists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The tag '"), operandr=MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' doesn't exist."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MojoFailureException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=gitFindTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tagsStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tagsStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="There are no tags.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MojoFailureException, sub_type=None)), label=None)])), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Choose tag to start support branch"), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\r?\\n")], member=split, postfix_operators=[], prefix_operators=[], qualifier=tagsStr, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=prompt, postfix_operators=[], prefix_operators=[], qualifier=prompter, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="support-start"), 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=MojoFailureException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PrompterException']))], finally_block=None, label=None, resources=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tag is blank.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MojoFailureException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSupportBranchPrefix, postfix_operators=[], prefix_operators=[], qualifier=gitFlowConfig, selectors=[], type_arguments=None), operandr=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=gitCheckBranchExists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=supportBranchExists)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=supportBranchExists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Support branch with that name already exists.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MojoFailureException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSupportBranchPrefix, postfix_operators=[], prefix_operators=[], qualifier=gitFlowConfig, selectors=[], type_arguments=None), operandr=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=gitCreateAndCheckout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=installProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=mvnCleanInstall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MemberReference(member=pushRemote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSupportBranchPrefix, postfix_operators=[], prefix_operators=[], qualifier=gitFlowConfig, selectors=[], type_arguments=None), operandr=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=gitPush, 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="support-start"), 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=MojoFailureException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CommandLineException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] Keyword[throws] identifier[MojoExecutionException] , identifier[MojoFailureException] {
identifier[validateConfiguration] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[initGitFlowConfig] operator[SEP] operator[SEP] operator[SEP] identifier[checkUncommittedChanges] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[tag] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[settings] operator[SEP] identifier[isInteractiveMode] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[tagsStr] operator[=] identifier[gitFindTags] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[tagsStr] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MojoFailureException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[tag] operator[=] identifier[prompter] operator[SEP] identifier[prompt] operator[SEP] literal[String] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[tagsStr] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[PrompterException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MojoFailureException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[gitCheckTagExists] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] {
identifier[tag] operator[=] identifier[tagName] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[MojoFailureException] operator[SEP] literal[String] operator[+] identifier[tagName] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[tag] operator[=] identifier[gitFindLastTag] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[tag] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MojoFailureException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[boolean] identifier[supportBranchExists] operator[=] identifier[gitCheckBranchExists] operator[SEP] identifier[gitFlowConfig] operator[SEP] identifier[getSupportBranchPrefix] operator[SEP] operator[SEP] operator[+] identifier[tag] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[supportBranchExists] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MojoFailureException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[gitCreateAndCheckout] operator[SEP] identifier[gitFlowConfig] operator[SEP] identifier[getSupportBranchPrefix] operator[SEP] operator[SEP] operator[+] identifier[tag] , identifier[tag] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[installProject] operator[SEP] {
identifier[mvnCleanInstall] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pushRemote] operator[SEP] {
identifier[gitPush] operator[SEP] identifier[gitFlowConfig] operator[SEP] identifier[getSupportBranchPrefix] operator[SEP] operator[SEP] operator[+] identifier[tag] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[CommandLineException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MojoFailureException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
protected Annotation[] getValidators() {
// Si l'annotation en cours est nulle
if(this.annotation == null) {
// On retourne null
return null;
}
// Si l'annotation en cours n'est pas de l'instance
if(!(annotation instanceof SizeDAOValidators)) {
// On retourne null
return null;
}
// On caste
SizeDAOValidators castedValidators = (SizeDAOValidators) annotation;
// Liste des Annotations
SizeDAOValidator[] tValidators = castedValidators.value();
// On retourne la liste
return tValidators;
} | class class_name[name] begin[{]
method[getValidators, return_type[type[Annotation]], modifier[protected], parameter[]] begin[{]
if[binary_operation[THIS[member[None.annotation]], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.annotation], instanceof, type[SizeDAOValidators]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[SizeDAOValidators], castedValidators]
local_variable[type[SizeDAOValidator], tValidators]
return[member[.tValidators]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[Annotation] operator[SEP] operator[SEP] identifier[getValidators] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[annotation] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[annotation] Keyword[instanceof] identifier[SizeDAOValidators] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[SizeDAOValidators] identifier[castedValidators] operator[=] operator[SEP] identifier[SizeDAOValidators] operator[SEP] identifier[annotation] operator[SEP] identifier[SizeDAOValidator] operator[SEP] operator[SEP] identifier[tValidators] operator[=] identifier[castedValidators] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[tValidators] operator[SEP]
}
|
static <T> String join(Iterable<T> elems, String delim) {
if (elems == null)
return "";
StringBuilder result = new StringBuilder();
for (T elem : elems)
result.append(elem).append(delim);
if (result.length() > 0)
result.setLength(result.length() - delim.length());
return result.toString();
} | class class_name[name] begin[{]
method[join, return_type[type[String]], modifier[static], parameter[elems, delim]] begin[{]
if[binary_operation[member[.elems], ==, literal[null]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], result]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=elem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[MemberReference(member=delim, 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), control=EnhancedForControl(iterable=MemberReference(member=elems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=elem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None)
if[binary_operation[call[result.length, parameter[]], >, literal[0]]] begin[{]
call[result.setLength, parameter[binary_operation[call[result.length, parameter[]], -, call[delim.length, parameter[]]]]]
else begin[{]
None
end[}]
return[call[result.toString, parameter[]]]
end[}]
END[}] | Keyword[static] operator[<] identifier[T] operator[>] identifier[String] identifier[join] operator[SEP] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[elems] , identifier[String] identifier[delim] operator[SEP] {
Keyword[if] operator[SEP] identifier[elems] operator[==] Other[null] operator[SEP] Keyword[return] literal[String] operator[SEP] identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[T] identifier[elem] operator[:] identifier[elems] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[elem] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[delim] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[result] operator[SEP] identifier[setLength] operator[SEP] identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[delim] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public double getLowerBound(final int numStdDev) {
if (!isEstimationMode()) { return getRetainedEntries(); }
return BinomialBoundsN.getLowerBound(getRetainedEntries(), getTheta(), numStdDev, isEmpty_);
} | class class_name[name] begin[{]
method[getLowerBound, return_type[type[double]], modifier[public], parameter[numStdDev]] begin[{]
if[call[.isEstimationMode, parameter[]]] begin[{]
return[call[.getRetainedEntries, parameter[]]]
else begin[{]
None
end[}]
return[call[BinomialBoundsN.getLowerBound, parameter[call[.getRetainedEntries, parameter[]], call[.getTheta, parameter[]], member[.numStdDev], member[.isEmpty_]]]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[getLowerBound] operator[SEP] Keyword[final] Keyword[int] identifier[numStdDev] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isEstimationMode] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[getRetainedEntries] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[BinomialBoundsN] operator[SEP] identifier[getLowerBound] operator[SEP] identifier[getRetainedEntries] operator[SEP] operator[SEP] , identifier[getTheta] operator[SEP] operator[SEP] , identifier[numStdDev] , identifier[isEmpty_] operator[SEP] operator[SEP]
}
|
public S tableNamePrefix(String tableNamePrefix) {
attributes.attribute(TABLE_NAME_PREFIX).set(tableNamePrefix);
return self();
} | class class_name[name] begin[{]
method[tableNamePrefix, return_type[type[S]], modifier[public], parameter[tableNamePrefix]] begin[{]
call[attributes.attribute, parameter[member[.TABLE_NAME_PREFIX]]]
return[call[.self, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[S] identifier[tableNamePrefix] operator[SEP] identifier[String] identifier[tableNamePrefix] operator[SEP] {
identifier[attributes] operator[SEP] identifier[attribute] operator[SEP] identifier[TABLE_NAME_PREFIX] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[tableNamePrefix] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP]
}
|
public Element getGlobalVariable(String name) {
GlobalVariable gvar = globalVariables.get(name);
return (gvar != null) ? gvar.getValue() : null;
} | class class_name[name] begin[{]
method[getGlobalVariable, return_type[type[Element]], modifier[public], parameter[name]] begin[{]
local_variable[type[GlobalVariable], gvar]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=gvar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=gvar, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] identifier[Element] identifier[getGlobalVariable] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[GlobalVariable] identifier[gvar] operator[=] identifier[globalVariables] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[gvar] operator[!=] Other[null] operator[SEP] operator[?] identifier[gvar] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP]
}
|
public synchronized JsMessage get(short sessionId)
throws SIResourceException, SIConnectionDroppedException, SIConnectionLostException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "get", sessionId);
JsMessage retValue = null;
QueueData rhData = removeLastIfAvailable(sessionId);
while (rhData != null)
{
retValue = (JsMessage) rhData.getMessage();
// Now we need to decide whether the message has expired or not. We do this by comparing
// the message arrival time + message TTL and the current time. If we find the message
// has expired we need to unlock it at the server, and discard it from our queue without
// giving it to the caller.
// NOTE: We want to avoid the situation where we unlock an expired message but it gets to
// the server at the exact time it did expire. As such, we give each message an extra
// 500ms to live. This way we absolutely guarentee that when we unlock on the server the
// message will not be redelivered.
boolean messageHasExpired = false;
long msgTTL = retValue.getRemainingTimeToLive();
if (msgTTL != -1)
{
long currentTime = approxTimeThread.getApproxTime();
long msgArrivalTime = rhData.getArrivalTime();
// Compensate the TTL by 500 ms
msgTTL += 500;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Arrived: " + new Date(msgArrivalTime) +
", Now: " + new Date(currentTime) +
", Expires: " + new Date(msgArrivalTime + msgTTL));
if (currentTime > (msgArrivalTime + msgTTL))
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Message has expired: " +
retValue.getMessageHandle());
messageHasExpired = true;
}
}
// Now we need to update our counters and decide whether we request more messages.
// We do this whether the message will expire or not - as either way the message is
// coming of the queue.
if (trackBytes)
{
bytesGivenToUserSinceLastRequestForMsgs += rhData.getMessageLength();
}
totalBytesGiven += bytesGivenToUserSinceLastRequestForMsgs;
currentBytesOnQueue -= rhData.getMessageLength();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(this, tc, "Current bytes on the queue", ""+currentBytesOnQueue);
SibTr.debug(this, tc, "Bytes given since last request", ""+bytesGivenToUserSinceLastRequestForMsgs);
}
// Now check and see if we need more messags. If we have gone below the lower watermark
// of bytes cached by us (rather - if we have given the user more than HIGH - LOW messages),
// and if the server has stopped sending us messages (coz we have received more than the
// high watermark) then request some more messages.
if (trackBytes &&
(bytesGivenToUserSinceLastRequestForMsgs >= (HIGH_QUEUE_BYTES - LOW_QUEUE_BYTES)))
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Need more messages: " +
bytesGivenToUserSinceLastRequestForMsgs + " >= " + (HIGH_QUEUE_BYTES - LOW_QUEUE_BYTES));
// Are there new values waiting to be set? If so, set them now
if (NEW_HIGH_QUEUE_BYTES != 0)
{
HIGH_QUEUE_BYTES = NEW_HIGH_QUEUE_BYTES;
LOW_QUEUE_BYTES = NEW_LOW_QUEUE_BYTES;
}
convHelper.requestMoreMessages(bytesReceivedSinceLastRequestForMsgs, HIGH_QUEUE_BYTES); // d172528
bytesGivenToUserSinceLastRequestForMsgs = 0;
bytesReceivedSinceLastRequestForMsgs = 0;
totalRequests++;
lastRequestForMessagesTime = System.currentTimeMillis();
synchronized(queue)
{
if (queue.isEmpty()) goneEmptyCount++;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Queue is now: ", this);
}
// If the message has not expired, break out of this loop and deliver the message
if (!messageHasExpired)
{
break;
}
// Otherwise, unlock him if he was a recoverable message
if (CommsUtils.isRecoverable(retValue, unrecoverableReliability))
{
try
{
convHelper.unlockSet(new SIMessageHandle[] {retValue.getMessageHandle()});
}
catch (SIException e)
{
FFDCFilter.processException(e, CLASS_NAME + ".get",
CommsConstants.RHPQ_GET_01, this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Unable to unlock expired message", e);
// Not a lot else we can do that
}
}
// And null out the message so we don't accidentally return him
retValue = null;
rhData = removeLastIfAvailable(sessionId);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "get", retValue);
return retValue;
} | class class_name[name] begin[{]
method[get, return_type[type[JsMessage]], modifier[synchronized public], parameter[sessionId]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["get"], member[.sessionId]]]
else begin[{]
None
end[}]
local_variable[type[JsMessage], retValue]
local_variable[type[QueueData], rhData]
while[binary_operation[member[.rhData], !=, literal[null]]] begin[{]
assign[member[.retValue], Cast(expression=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=rhData, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JsMessage, sub_type=None))]
local_variable[type[boolean], messageHasExpired]
local_variable[type[long], msgTTL]
if[binary_operation[member[.msgTTL], !=, literal[1]]] begin[{]
local_variable[type[long], currentTime]
local_variable[type[long], msgArrivalTime]
assign[member[.msgTTL], literal[500]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Arrived: "], +, ClassCreator(arguments=[MemberReference(member=msgArrivalTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))], +, literal[", Now: "]], +, ClassCreator(arguments=[MemberReference(member=currentTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))], +, literal[", Expires: "]], +, ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=msgArrivalTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=msgTTL, 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=Date, sub_type=None))]]]
else begin[{]
None
end[}]
if[binary_operation[member[.currentTime], >, binary_operation[member[.msgArrivalTime], +, member[.msgTTL]]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[THIS[], member[.tc], binary_operation[literal["Message has expired: "], +, call[retValue.getMessageHandle, parameter[]]]]]
else begin[{]
None
end[}]
assign[member[.messageHasExpired], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[member[.trackBytes]] begin[{]
assign[member[.bytesGivenToUserSinceLastRequestForMsgs], call[rhData.getMessageLength, parameter[]]]
else begin[{]
None
end[}]
assign[member[.totalBytesGiven], member[.bytesGivenToUserSinceLastRequestForMsgs]]
assign[member[.currentBytesOnQueue], call[rhData.getMessageLength, parameter[]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[THIS[], member[.tc], literal["Current bytes on the queue"], binary_operation[literal[""], +, member[.currentBytesOnQueue]]]]
call[SibTr.debug, parameter[THIS[], member[.tc], literal["Bytes given since last request"], binary_operation[literal[""], +, member[.bytesGivenToUserSinceLastRequestForMsgs]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.trackBytes], &&, binary_operation[member[.bytesGivenToUserSinceLastRequestForMsgs], >=, binary_operation[member[.HIGH_QUEUE_BYTES], -, member[.LOW_QUEUE_BYTES]]]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[THIS[], member[.tc], binary_operation[binary_operation[binary_operation[literal["Need more messages: "], +, member[.bytesGivenToUserSinceLastRequestForMsgs]], +, literal[" >= "]], +, binary_operation[member[.HIGH_QUEUE_BYTES], -, member[.LOW_QUEUE_BYTES]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.NEW_HIGH_QUEUE_BYTES], !=, literal[0]]] begin[{]
assign[member[.HIGH_QUEUE_BYTES], member[.NEW_HIGH_QUEUE_BYTES]]
assign[member[.LOW_QUEUE_BYTES], member[.NEW_LOW_QUEUE_BYTES]]
else begin[{]
None
end[}]
call[convHelper.requestMoreMessages, parameter[member[.bytesReceivedSinceLastRequestForMsgs], member[.HIGH_QUEUE_BYTES]]]
assign[member[.bytesGivenToUserSinceLastRequestForMsgs], literal[0]]
assign[member[.bytesReceivedSinceLastRequestForMsgs], literal[0]]
member[.totalRequests]
assign[member[.lastRequestForMessagesTime], call[System.currentTimeMillis, parameter[]]]
SYNCHRONIZED[member[.queue]] BEGIN[{]
if[call[queue.isEmpty, parameter[]]] begin[{]
member[.goneEmptyCount]
else begin[{]
None
end[}]
END[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[THIS[], member[.tc], literal["Queue is now: "], THIS[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[member[.messageHasExpired]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[call[CommsUtils.isRecoverable, parameter[member[.retValue], member[.unrecoverableReliability]]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getMessageHandle, postfix_operators=[], prefix_operators=[], qualifier=retValue, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIMessageHandle, sub_type=None))], member=unlockSet, postfix_operators=[], prefix_operators=[], qualifier=convHelper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".get"), operator=+), MemberReference(member=RHPQ_GET_01, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to unlock expired message"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
assign[member[.retValue], literal[null]]
assign[member[.rhData], call[.removeLastIfAvailable, parameter[member[.sessionId]]]]
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["get"], member[.retValue]]]
else begin[{]
None
end[}]
return[member[.retValue]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] identifier[JsMessage] identifier[get] operator[SEP] Keyword[short] identifier[sessionId] operator[SEP] Keyword[throws] identifier[SIResourceException] , identifier[SIConnectionDroppedException] , identifier[SIConnectionLostException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[sessionId] operator[SEP] operator[SEP] identifier[JsMessage] identifier[retValue] operator[=] Other[null] operator[SEP] identifier[QueueData] identifier[rhData] operator[=] identifier[removeLastIfAvailable] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[rhData] operator[!=] Other[null] operator[SEP] {
identifier[retValue] operator[=] operator[SEP] identifier[JsMessage] operator[SEP] identifier[rhData] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[messageHasExpired] operator[=] literal[boolean] operator[SEP] Keyword[long] identifier[msgTTL] operator[=] identifier[retValue] operator[SEP] identifier[getRemainingTimeToLive] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msgTTL] operator[!=] operator[-] Other[1] operator[SEP] {
Keyword[long] identifier[currentTime] operator[=] identifier[approxTimeThread] operator[SEP] identifier[getApproxTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[msgArrivalTime] operator[=] identifier[rhData] operator[SEP] identifier[getArrivalTime] operator[SEP] operator[SEP] operator[SEP] identifier[msgTTL] operator[+=] Other[500] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] identifier[msgArrivalTime] operator[SEP] operator[+] literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] identifier[currentTime] operator[SEP] operator[+] literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] identifier[msgArrivalTime] operator[+] identifier[msgTTL] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentTime] operator[>] operator[SEP] identifier[msgArrivalTime] operator[+] identifier[msgTTL] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[retValue] operator[SEP] identifier[getMessageHandle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[messageHasExpired] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[trackBytes] operator[SEP] {
identifier[bytesGivenToUserSinceLastRequestForMsgs] operator[+=] identifier[rhData] operator[SEP] identifier[getMessageLength] operator[SEP] operator[SEP] operator[SEP]
}
identifier[totalBytesGiven] operator[+=] identifier[bytesGivenToUserSinceLastRequestForMsgs] operator[SEP] identifier[currentBytesOnQueue] operator[-=] identifier[rhData] operator[SEP] identifier[getMessageLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , literal[String] operator[+] identifier[currentBytesOnQueue] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , literal[String] operator[+] identifier[bytesGivenToUserSinceLastRequestForMsgs] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[trackBytes] operator[&&] operator[SEP] identifier[bytesGivenToUserSinceLastRequestForMsgs] operator[>=] operator[SEP] identifier[HIGH_QUEUE_BYTES] operator[-] identifier[LOW_QUEUE_BYTES] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[bytesGivenToUserSinceLastRequestForMsgs] operator[+] literal[String] operator[+] operator[SEP] identifier[HIGH_QUEUE_BYTES] operator[-] identifier[LOW_QUEUE_BYTES] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[NEW_HIGH_QUEUE_BYTES] operator[!=] Other[0] operator[SEP] {
identifier[HIGH_QUEUE_BYTES] operator[=] identifier[NEW_HIGH_QUEUE_BYTES] operator[SEP] identifier[LOW_QUEUE_BYTES] operator[=] identifier[NEW_LOW_QUEUE_BYTES] operator[SEP]
}
identifier[convHelper] operator[SEP] identifier[requestMoreMessages] operator[SEP] identifier[bytesReceivedSinceLastRequestForMsgs] , identifier[HIGH_QUEUE_BYTES] operator[SEP] operator[SEP] identifier[bytesGivenToUserSinceLastRequestForMsgs] operator[=] Other[0] operator[SEP] identifier[bytesReceivedSinceLastRequestForMsgs] operator[=] Other[0] operator[SEP] identifier[totalRequests] operator[++] operator[SEP] identifier[lastRequestForMessagesTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[queue] operator[SEP] {
Keyword[if] operator[SEP] identifier[queue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[goneEmptyCount] operator[++] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , Keyword[this] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[messageHasExpired] operator[SEP] {
Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[CommsUtils] operator[SEP] identifier[isRecoverable] operator[SEP] identifier[retValue] , identifier[unrecoverableReliability] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[convHelper] operator[SEP] identifier[unlockSet] operator[SEP] Keyword[new] identifier[SIMessageHandle] operator[SEP] operator[SEP] {
identifier[retValue] operator[SEP] identifier[getMessageHandle] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SIException] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[CommsConstants] operator[SEP] identifier[RHPQ_GET_01] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[retValue] operator[=] Other[null] operator[SEP] identifier[rhData] operator[=] identifier[removeLastIfAvailable] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[retValue] operator[SEP] operator[SEP] Keyword[return] identifier[retValue] operator[SEP]
}
|
private void initialize() {
this.setLayout(new BorderLayout());
this.setName(Constant.messages.getString("output.panel.title")); // ZAP: i18n
if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
this.setSize(243, 119);
}
// ZAP: Added Output (doc) icon
this.setIcon(new ImageIcon(OutputPanel.class.getResource("/resource/icon/16/172.png"))); // 'doc' icon
this.setDefaultAccelerator(View.getSingleton().getMenuShortcutKeyStroke(KeyEvent.VK_O, KeyEvent.SHIFT_DOWN_MASK, false));
this.setMnemonic(Constant.messages.getChar("output.panel.mnemonic"));
this.add(getMainPanel(), BorderLayout.CENTER);
this.setShowByDefault(true);
} | class class_name[name] begin[{]
method[initialize, return_type[void], modifier[private], parameter[]] begin[{]
THIS[call[None.setLayout, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BorderLayout, sub_type=None))]]]
THIS[call[None.setName, parameter[call[Constant.messages.getString, parameter[literal["output.panel.title"]]]]]]
if[binary_operation[call[Model.getSingleton, parameter[]], ==, literal[0]]] begin[{]
THIS[call[None.setSize, parameter[literal[243], literal[119]]]]
else begin[{]
None
end[}]
THIS[call[None.setIcon, parameter[ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/resource/icon/16/172.png")], member=getResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=OutputPanel, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ImageIcon, sub_type=None))]]]
THIS[call[None.setDefaultAccelerator, parameter[call[View.getSingleton, parameter[]]]]]
THIS[call[None.setMnemonic, parameter[call[Constant.messages.getChar, parameter[literal["output.panel.mnemonic"]]]]]]
THIS[call[None.add, parameter[call[.getMainPanel, parameter[]], member[BorderLayout.CENTER]]]]
THIS[call[None.setShowByDefault, parameter[literal[true]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[initialize] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[BorderLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setName] operator[SEP] identifier[Constant] operator[SEP] identifier[messages] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Model] operator[SEP] identifier[getSingleton] operator[SEP] operator[SEP] operator[SEP] identifier[getOptionsParam] operator[SEP] operator[SEP] operator[SEP] identifier[getViewParam] operator[SEP] operator[SEP] operator[SEP] identifier[getWmUiHandlingOption] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[this] operator[SEP] identifier[setSize] operator[SEP] Other[243] , Other[119] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[setIcon] operator[SEP] Keyword[new] identifier[ImageIcon] operator[SEP] identifier[OutputPanel] operator[SEP] Keyword[class] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setDefaultAccelerator] operator[SEP] identifier[View] operator[SEP] identifier[getSingleton] operator[SEP] operator[SEP] operator[SEP] identifier[getMenuShortcutKeyStroke] operator[SEP] identifier[KeyEvent] operator[SEP] identifier[VK_O] , identifier[KeyEvent] operator[SEP] identifier[SHIFT_DOWN_MASK] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setMnemonic] operator[SEP] identifier[Constant] operator[SEP] identifier[messages] operator[SEP] identifier[getChar] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[add] operator[SEP] identifier[getMainPanel] operator[SEP] operator[SEP] , identifier[BorderLayout] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setShowByDefault] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
|
public static List<ProducerDecoratorBean> getDecoratedProducers(HttpServletRequest req, List<ProducerAO> producers, Map<String, GraphDataBean> graphData){
Map<IDecorator, List<ProducerAO>> decoratorMap = new HashMap<>(producers.size());
for (ProducerAO producer : producers){
try{
IDecorator decorator = findOrCreateDecorator(producer);
List<ProducerAO> decoratedProducers = decoratorMap.get(decorator);
if (decoratedProducers == null){
decoratedProducers = new ArrayList<>();
decoratorMap.put(decorator, decoratedProducers);
for(StatValueAO statBean : producer.getFirstStatsValues()){
String graphKey = decorator.getName()+ '_' +statBean.getName();
GraphDataBean graphDataBean = new GraphDataBean(decorator.getName()+ '_' +statBean.getJsVariableName(), statBean.getName());
graphData.put(graphKey, graphDataBean);
}
}
decoratedProducers.add(producer);
}catch(IndexOutOfBoundsException e){
//producer has no stats at all, ignoring
}
}
Set<Map.Entry<IDecorator, List<ProducerAO>>> entries = decoratorMap.entrySet();
List<ProducerDecoratorBean> beans = new ArrayList<>(entries.size());
for (Map.Entry<IDecorator, List<ProducerAO>> entry : entries){
IDecorator decorator = entry.getKey();
ProducerDecoratorBean b = new ProducerDecoratorBean();
b.setName(decorator.getName());
b.setCaptions(decorator.getCaptions());
for (ProducerAO p : entry.getValue()) {
try {
List<StatValueAO> values = p.getFirstStatsValues();
for (StatValueAO valueBean : values){
String graphKey = decorator.getName()+ '_' +valueBean.getName();
GraphDataBean bean = graphData.get(graphKey);
if (bean==null) {
// FIXME!
log.warn("unable to find bean for key: " + graphKey);
} else {
bean.addValue(new GraphDataValueBean(p.getProducerId(), valueBean.getRawValue()));
}
}
}catch(UnknownIntervalException e){
//do nothing, apparently we have a decorator which has no interval support for THIS interval.
}
}
b.setProducerBeans(StaticQuickSorter.sort(decoratorMap.get(decorator), getProducerBeanSortType(b, req)));
beans.add(b);
}
return beans;
} | class class_name[name] begin[{]
method[getDecoratedProducers, return_type[type[List]], modifier[public static], parameter[req, producers, graphData]] begin[{]
local_variable[type[Map], decoratorMap]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=producer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findOrCreateDecorator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=decorator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IDecorator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=decorator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=decoratorMap, selectors=[], type_arguments=None), name=decoratedProducers)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ProducerAO, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=decoratedProducers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=decoratedProducers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=decorator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=decoratedProducers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=decoratorMap, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=decorator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_'), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=statBean, selectors=[], type_arguments=None), operator=+), name=graphKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=decorator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_'), operator=+), operandr=MethodInvocation(arguments=[], member=getJsVariableName, postfix_operators=[], prefix_operators=[], qualifier=statBean, selectors=[], type_arguments=None), operator=+), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=statBean, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GraphDataBean, sub_type=None)), name=graphDataBean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GraphDataBean, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=graphKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=graphDataBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=graphData, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFirstStatsValues, postfix_operators=[], prefix_operators=[], qualifier=producer, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=statBean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StatValueAO, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=producer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=decoratedProducers, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IndexOutOfBoundsException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=producers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=producer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProducerAO, sub_type=None))), label=None)
local_variable[type[Set], entries]
local_variable[type[List], beans]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=decorator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IDecorator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProducerDecoratorBean, sub_type=None)), name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProducerDecoratorBean, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=decorator, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCaptions, postfix_operators=[], prefix_operators=[], qualifier=decorator, selectors=[], type_arguments=None)], member=setCaptions, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFirstStatsValues, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), name=values)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StatValueAO, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=decorator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_'), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=valueBean, selectors=[], type_arguments=None), operator=+), name=graphKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=graphKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=graphData, selectors=[], type_arguments=None), name=bean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GraphDataBean, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProducerId, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getRawValue, postfix_operators=[], prefix_operators=[], qualifier=valueBean, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GraphDataValueBean, sub_type=None))], member=addValue, postfix_operators=[], prefix_operators=[], qualifier=bean, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unable to find bean for key: "), operandr=MemberReference(member=graphKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=valueBean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StatValueAO, sub_type=None))), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnknownIntervalException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProducerAO, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=decorator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=decoratorMap, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProducerBeanSortType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=sort, postfix_operators=[], prefix_operators=[], qualifier=StaticQuickSorter, selectors=[], type_arguments=None)], member=setProducerBeans, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=beans, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=IDecorator, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ProducerAO, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[member[.beans]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[ProducerDecoratorBean] operator[>] identifier[getDecoratedProducers] operator[SEP] identifier[HttpServletRequest] identifier[req] , identifier[List] operator[<] identifier[ProducerAO] operator[>] identifier[producers] , identifier[Map] operator[<] identifier[String] , identifier[GraphDataBean] operator[>] identifier[graphData] operator[SEP] {
identifier[Map] operator[<] identifier[IDecorator] , identifier[List] operator[<] identifier[ProducerAO] operator[>] operator[>] identifier[decoratorMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[producers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ProducerAO] identifier[producer] operator[:] identifier[producers] operator[SEP] {
Keyword[try] {
identifier[IDecorator] identifier[decorator] operator[=] identifier[findOrCreateDecorator] operator[SEP] identifier[producer] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ProducerAO] operator[>] identifier[decoratedProducers] operator[=] identifier[decoratorMap] operator[SEP] identifier[get] operator[SEP] identifier[decorator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[decoratedProducers] operator[==] Other[null] operator[SEP] {
identifier[decoratedProducers] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[decoratorMap] operator[SEP] identifier[put] operator[SEP] identifier[decorator] , identifier[decoratedProducers] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StatValueAO] identifier[statBean] operator[:] identifier[producer] operator[SEP] identifier[getFirstStatsValues] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[graphKey] operator[=] identifier[decorator] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[statBean] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[GraphDataBean] identifier[graphDataBean] operator[=] Keyword[new] identifier[GraphDataBean] operator[SEP] identifier[decorator] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[statBean] operator[SEP] identifier[getJsVariableName] operator[SEP] operator[SEP] , identifier[statBean] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[graphData] operator[SEP] identifier[put] operator[SEP] identifier[graphKey] , identifier[graphDataBean] operator[SEP] operator[SEP]
}
}
identifier[decoratedProducers] operator[SEP] identifier[add] operator[SEP] identifier[producer] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IndexOutOfBoundsException] identifier[e] operator[SEP] {
}
}
identifier[Set] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[IDecorator] , identifier[List] operator[<] identifier[ProducerAO] operator[>] operator[>] operator[>] identifier[entries] operator[=] identifier[decoratorMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ProducerDecoratorBean] operator[>] identifier[beans] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[entries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[IDecorator] , identifier[List] operator[<] identifier[ProducerAO] operator[>] operator[>] identifier[entry] operator[:] identifier[entries] operator[SEP] {
identifier[IDecorator] identifier[decorator] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[ProducerDecoratorBean] identifier[b] operator[=] Keyword[new] identifier[ProducerDecoratorBean] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[setName] operator[SEP] identifier[decorator] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[setCaptions] operator[SEP] identifier[decorator] operator[SEP] identifier[getCaptions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ProducerAO] identifier[p] operator[:] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[List] operator[<] identifier[StatValueAO] operator[>] identifier[values] operator[=] identifier[p] operator[SEP] identifier[getFirstStatsValues] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StatValueAO] identifier[valueBean] operator[:] identifier[values] operator[SEP] {
identifier[String] identifier[graphKey] operator[=] identifier[decorator] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[valueBean] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[GraphDataBean] identifier[bean] operator[=] identifier[graphData] operator[SEP] identifier[get] operator[SEP] identifier[graphKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bean] operator[==] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[graphKey] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[bean] operator[SEP] identifier[addValue] operator[SEP] Keyword[new] identifier[GraphDataValueBean] operator[SEP] identifier[p] operator[SEP] identifier[getProducerId] operator[SEP] operator[SEP] , identifier[valueBean] operator[SEP] identifier[getRawValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[UnknownIntervalException] identifier[e] operator[SEP] {
}
}
identifier[b] operator[SEP] identifier[setProducerBeans] operator[SEP] identifier[StaticQuickSorter] operator[SEP] identifier[sort] operator[SEP] identifier[decoratorMap] operator[SEP] identifier[get] operator[SEP] identifier[decorator] operator[SEP] , identifier[getProducerBeanSortType] operator[SEP] identifier[b] , identifier[req] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[beans] operator[SEP] identifier[add] operator[SEP] identifier[b] operator[SEP] operator[SEP]
}
Keyword[return] identifier[beans] operator[SEP]
}
|
public void addFieldError (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText)
{
add (SingleError.builderError ().setErrorFieldName (sFieldName).setErrorText (sText).build ());
} | class class_name[name] begin[{]
method[addFieldError, return_type[void], modifier[public], parameter[sFieldName, sText]] begin[{]
call[.add, parameter[call[SingleError.builderError, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addFieldError] operator[SEP] annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sFieldName] , annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sText] operator[SEP] {
identifier[add] operator[SEP] identifier[SingleError] operator[SEP] identifier[builderError] operator[SEP] operator[SEP] operator[SEP] identifier[setErrorFieldName] operator[SEP] identifier[sFieldName] operator[SEP] operator[SEP] identifier[setErrorText] operator[SEP] identifier[sText] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected void processBundle(Bundle bundle) {
Properties props = readMessageRouterProps(bundle);
if (props != null) {
msgRouter.modified(props);
}
} | class class_name[name] begin[{]
method[processBundle, return_type[void], modifier[protected], parameter[bundle]] begin[{]
local_variable[type[Properties], props]
if[binary_operation[member[.props], !=, literal[null]]] begin[{]
call[msgRouter.modified, parameter[member[.props]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[processBundle] operator[SEP] identifier[Bundle] identifier[bundle] operator[SEP] {
identifier[Properties] identifier[props] operator[=] identifier[readMessageRouterProps] operator[SEP] identifier[bundle] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[props] operator[!=] Other[null] operator[SEP] {
identifier[msgRouter] operator[SEP] identifier[modified] operator[SEP] identifier[props] operator[SEP] operator[SEP]
}
}
|
protected void addSpacing(float extraspace, float oldleading, Font f) {
if (extraspace == 0) return;
if (pageEmpty) return;
if (currentHeight + line.height() + leading > indentTop() - indentBottom()) return;
leading = extraspace;
carriageReturn();
if (f.isUnderlined() || f.isStrikethru()) {
f = new Font(f);
int style = f.getStyle();
style &= ~Font.UNDERLINE;
style &= ~Font.STRIKETHRU;
f.setStyle(style);
}
Chunk space = new Chunk(" ", f);
space.process(this);
carriageReturn();
leading = oldleading;
} | class class_name[name] begin[{]
method[addSpacing, return_type[void], modifier[protected], parameter[extraspace, oldleading, f]] begin[{]
if[binary_operation[member[.extraspace], ==, literal[0]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[member[.pageEmpty]] begin[{]
return[None]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.currentHeight], +, call[line.height, parameter[]]], +, member[.leading]], >, binary_operation[call[.indentTop, parameter[]], -, call[.indentBottom, parameter[]]]]] begin[{]
return[None]
else begin[{]
None
end[}]
assign[member[.leading], member[.extraspace]]
call[.carriageReturn, parameter[]]
if[binary_operation[call[f.isUnderlined, parameter[]], ||, call[f.isStrikethru, parameter[]]]] begin[{]
assign[member[.f], ClassCreator(arguments=[MemberReference(member=f, 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=Font, sub_type=None))]
local_variable[type[int], style]
assign[member[.style], member[Font.UNDERLINE]]
assign[member[.style], member[Font.STRIKETHRU]]
call[f.setStyle, parameter[member[.style]]]
else begin[{]
None
end[}]
local_variable[type[Chunk], space]
call[space.process, parameter[THIS[]]]
call[.carriageReturn, parameter[]]
assign[member[.leading], member[.oldleading]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[addSpacing] operator[SEP] Keyword[float] identifier[extraspace] , Keyword[float] identifier[oldleading] , identifier[Font] identifier[f] operator[SEP] {
Keyword[if] operator[SEP] identifier[extraspace] operator[==] Other[0] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[pageEmpty] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[currentHeight] operator[+] identifier[line] operator[SEP] identifier[height] operator[SEP] operator[SEP] operator[+] identifier[leading] operator[>] identifier[indentTop] operator[SEP] operator[SEP] operator[-] identifier[indentBottom] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[leading] operator[=] identifier[extraspace] operator[SEP] identifier[carriageReturn] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[isUnderlined] operator[SEP] operator[SEP] operator[||] identifier[f] operator[SEP] identifier[isStrikethru] operator[SEP] operator[SEP] operator[SEP] {
identifier[f] operator[=] Keyword[new] identifier[Font] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[int] identifier[style] operator[=] identifier[f] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[style] operator[&=] operator[~] identifier[Font] operator[SEP] identifier[UNDERLINE] operator[SEP] identifier[style] operator[&=] operator[~] identifier[Font] operator[SEP] identifier[STRIKETHRU] operator[SEP] identifier[f] operator[SEP] identifier[setStyle] operator[SEP] identifier[style] operator[SEP] operator[SEP]
}
identifier[Chunk] identifier[space] operator[=] Keyword[new] identifier[Chunk] operator[SEP] literal[String] , identifier[f] operator[SEP] operator[SEP] identifier[space] operator[SEP] identifier[process] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[carriageReturn] operator[SEP] operator[SEP] operator[SEP] identifier[leading] operator[=] identifier[oldleading] operator[SEP]
}
|
public static IntRange GetRange( int[] values, double percent ){
int total = 0, n = values.length;
// for all values
for ( int i = 0; i < n; i++ )
{
// accumalate total
total += values[i];
}
int min, max, hits;
int h = (int) ( total * ( percent + ( 1 - percent ) / 2 ) );
// get range min value
for ( min = 0, hits = total; min < n; min++ )
{
hits -= values[min];
if ( hits < h )
break;
}
// get range max value
for ( max = n - 1, hits = total; max >= 0; max-- )
{
hits -= values[max];
if ( hits < h )
break;
}
return new IntRange( min, max );
} | class class_name[name] begin[{]
method[GetRange, return_type[type[IntRange]], modifier[public static], parameter[values, percent]] begin[{]
local_variable[type[int], total]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[int], min]
local_variable[type[int], h]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=hits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), Assignment(expressionl=MemberReference(member=hits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[MemberReference(member=min, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=hits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=[Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), Assignment(expressionl=MemberReference(member=hits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[MemberReference(member=max, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[ClassCreator(arguments=[MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=max, 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=IntRange, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IntRange] identifier[GetRange] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[values] , Keyword[double] identifier[percent] operator[SEP] {
Keyword[int] identifier[total] operator[=] Other[0] , identifier[n] operator[=] identifier[values] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[total] operator[+=] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[int] identifier[min] , identifier[max] , identifier[hits] operator[SEP] Keyword[int] identifier[h] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[total] operator[*] operator[SEP] identifier[percent] operator[+] operator[SEP] Other[1] operator[-] identifier[percent] operator[SEP] operator[/] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[min] operator[=] Other[0] , identifier[hits] operator[=] identifier[total] operator[SEP] identifier[min] operator[<] identifier[n] operator[SEP] identifier[min] operator[++] operator[SEP] {
identifier[hits] operator[-=] identifier[values] operator[SEP] identifier[min] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hits] operator[<] identifier[h] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[for] operator[SEP] identifier[max] operator[=] identifier[n] operator[-] Other[1] , identifier[hits] operator[=] identifier[total] operator[SEP] identifier[max] operator[>=] Other[0] operator[SEP] identifier[max] operator[--] operator[SEP] {
identifier[hits] operator[-=] identifier[values] operator[SEP] identifier[max] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hits] operator[<] identifier[h] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[return] Keyword[new] identifier[IntRange] operator[SEP] identifier[min] , identifier[max] operator[SEP] operator[SEP]
}
|
public KriptonContentValues contentValues(SQLiteStatement compiledStatement) {
KriptonContentValues content = contentValues.get();
content.clear(compiledStatement);
return content;
} | class class_name[name] begin[{]
method[contentValues, return_type[type[KriptonContentValues]], modifier[public], parameter[compiledStatement]] begin[{]
local_variable[type[KriptonContentValues], content]
call[content.clear, parameter[member[.compiledStatement]]]
return[member[.content]]
end[}]
END[}] | Keyword[public] identifier[KriptonContentValues] identifier[contentValues] operator[SEP] identifier[SQLiteStatement] identifier[compiledStatement] operator[SEP] {
identifier[KriptonContentValues] identifier[content] operator[=] identifier[contentValues] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[clear] operator[SEP] identifier[compiledStatement] operator[SEP] operator[SEP] Keyword[return] identifier[content] operator[SEP]
}
|
@Override
public void run()
{
ObjectInputStream ois = null;
try
{
ois = new ObjectInputStream(new BufferedInputStream(socket.getInputStream()));
clientAddress = socket.getInetAddress().getHostAddress();
inetAddressFromClient = socket.getInetAddress();
while (true)
{
final Object object = ois.readObject();
process(object);
}
}
catch (final IOException e)
{
logger.error("An IOException on socket: " + e.toString(), e);
}
catch (final ClassNotFoundException cnfe)
{
logger.error("A ClassNotFoundException is thrown:\n " + cnfe.getMessage(), cnfe);
}
finally
{
try
{
if (ois != null)
{
ois.close();
}
if (socket != null)
{
socket.close();
}
}
catch (final IOException e)
{
logger.error("An IOException on socket: " + e.toString(), e);
}
}
logger.info("Socket finished: " + socket);
} | class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[ObjectInputStream], ois]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ois, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=socket, 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))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectInputStream, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=clientAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInetAddress, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[MethodInvocation(arguments=[], member=getHostAddress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=inetAddressFromClient, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInetAddress, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None)), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), name=object)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An IOException on socket: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A ClassNotFoundException is thrown:\n "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=cnfe, selectors=[], type_arguments=None), operator=+), MemberReference(member=cnfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ois, 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=ois, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=socket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An IOException on socket: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)], label=None, resources=None)
call[logger.info, parameter[binary_operation[literal["Socket finished: "], +, member[.socket]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[ObjectInputStream] identifier[ois] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[socket] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[clientAddress] operator[=] identifier[socket] operator[SEP] identifier[getInetAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] operator[SEP] identifier[inetAddressFromClient] operator[=] identifier[socket] operator[SEP] identifier[getInetAddress] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[final] identifier[Object] identifier[object] operator[=] identifier[ois] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] identifier[process] operator[SEP] identifier[object] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[cnfe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[cnfe] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[ois] operator[!=] Other[null] operator[SEP] {
identifier[ois] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[socket] operator[!=] Other[null] operator[SEP] {
identifier[socket] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[socket] operator[SEP] operator[SEP]
}
|
public EClass getIfcSectionReinforcementProperties() {
if (ifcSectionReinforcementPropertiesEClass == null) {
ifcSectionReinforcementPropertiesEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(505);
}
return ifcSectionReinforcementPropertiesEClass;
} | class class_name[name] begin[{]
method[getIfcSectionReinforcementProperties, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcSectionReinforcementPropertiesEClass], ==, literal[null]]] begin[{]
assign[member[.ifcSectionReinforcementPropertiesEClass], 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=505)], 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[.ifcSectionReinforcementPropertiesEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIfcSectionReinforcementProperties] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcSectionReinforcementPropertiesEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcSectionReinforcementPropertiesEClass] 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[505] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcSectionReinforcementPropertiesEClass] operator[SEP]
}
|
public Method getSourceMethod() {
Method method = sourceMethodReference.get();
if (method != null || sourceMethodName == CTOR_METHOD_NAME) {
return method;
}
for (Method m : ReflectionHelper.getDeclaredMethods(getSourceClass())) {
if (m.getName().equals(sourceMethodName) && Type.getMethodDescriptor(m).equals(sourceMethodDescriptor)) {
method = m;
sourceMethodReference = new WeakReference<Method>(method);
break;
}
}
return method;
} | class class_name[name] begin[{]
method[getSourceMethod, return_type[type[Method]], modifier[public], parameter[]] begin[{]
local_variable[type[Method], method]
if[binary_operation[binary_operation[member[.method], !=, literal[null]], ||, binary_operation[member[.sourceMethodName], ==, member[.CTOR_METHOD_NAME]]]] begin[{]
return[member[.method]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[MemberReference(member=sourceMethodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethodDescriptor, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[MethodInvocation(arguments=[MemberReference(member=sourceMethodDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sourceMethodReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=method, 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=Method, sub_type=None))], dimensions=None, name=WeakReference, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSourceClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getDeclaredMethods, postfix_operators=[], prefix_operators=[], qualifier=ReflectionHelper, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None)
return[member[.method]]
end[}]
END[}] | Keyword[public] identifier[Method] identifier[getSourceMethod] operator[SEP] operator[SEP] {
identifier[Method] identifier[method] operator[=] identifier[sourceMethodReference] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[!=] Other[null] operator[||] identifier[sourceMethodName] operator[==] identifier[CTOR_METHOD_NAME] operator[SEP] {
Keyword[return] identifier[method] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Method] identifier[m] operator[:] identifier[ReflectionHelper] operator[SEP] identifier[getDeclaredMethods] operator[SEP] identifier[getSourceClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[sourceMethodName] operator[SEP] operator[&&] identifier[Type] operator[SEP] identifier[getMethodDescriptor] operator[SEP] identifier[m] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[sourceMethodDescriptor] operator[SEP] operator[SEP] {
identifier[method] operator[=] identifier[m] operator[SEP] identifier[sourceMethodReference] operator[=] Keyword[new] identifier[WeakReference] operator[<] identifier[Method] operator[>] operator[SEP] identifier[method] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[method] operator[SEP]
}
|
public static <K,T> Cache2kBuilder<K,T> of(Class<K> _keyType, Class<T> _valueType) {
return new Cache2kBuilder<K, T>(CacheTypeCapture.of(_keyType), CacheTypeCapture.of(_valueType));
} | class class_name[name] begin[{]
method[of, return_type[type[Cache2kBuilder]], modifier[public static], parameter[_keyType, _valueType]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=_keyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=CacheTypeCapture, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=_valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=CacheTypeCapture, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=Cache2kBuilder, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[T] operator[>] identifier[Cache2kBuilder] operator[<] identifier[K] , identifier[T] operator[>] identifier[of] operator[SEP] identifier[Class] operator[<] identifier[K] operator[>] identifier[_keyType] , identifier[Class] operator[<] identifier[T] operator[>] identifier[_valueType] operator[SEP] {
Keyword[return] Keyword[new] identifier[Cache2kBuilder] operator[<] identifier[K] , identifier[T] operator[>] operator[SEP] identifier[CacheTypeCapture] operator[SEP] identifier[of] operator[SEP] identifier[_keyType] operator[SEP] , identifier[CacheTypeCapture] operator[SEP] identifier[of] operator[SEP] identifier[_valueType] operator[SEP] operator[SEP] operator[SEP]
}
|
private void processScores(String line) {
String[] values = line.trim().split(" +");
// increment the current row we are talking about
currentRowPos++;
for ( int i =0 ; i < values.length ; i++){
if ( values[i].endsWith(".")) {
values[i] = values[i] + "0";
}
// special case: MEHP950101
if (values[i].equals("-")) {
values[i] = "0";
}
if ( scale == -1 ) {
scale = determineScale(values[0]);
}
Float score = Float.parseFloat(values[i]);
score = scale * score;
Short s = (short) Math.round(score);
matrix[currentRowPos][i] = s;
if ( values.length < cols.size() || ( symmetricMatrix)){
//System.out.println(values.length + " " + cols.size() + " " + currentRowPos + " " + i + " " + line);
matrix[i][currentRowPos] = s;
symmetricMatrix = true;
}
if ( score > max)
max = s;
if ( score < min)
min = s;
}
} | class class_name[name] begin[{]
method[processScores, return_type[void], modifier[private], parameter[line]] begin[{]
local_variable[type[String], values]
member[.currentRowPos]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0"), operator=+)), label=None)])), IfStatement(condition=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0")), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=determineScale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=parseFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None), name=score)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=short)), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=currentRowPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cols, selectors=[], type_arguments=None), operator=<), operandr=MemberReference(member=symmetricMatrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=currentRowPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=symmetricMatrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=s, 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=values, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[processScores] operator[SEP] identifier[String] identifier[line] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[line] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[currentRowPos] operator[++] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[values] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[values] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP]
}
Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[values] operator[SEP] identifier[i] operator[SEP] operator[=] literal[String] operator[SEP]
}
Keyword[if] operator[SEP] identifier[scale] operator[==] operator[-] Other[1] operator[SEP] {
identifier[scale] operator[=] identifier[determineScale] operator[SEP] identifier[values] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Float] identifier[score] operator[=] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[score] operator[=] identifier[scale] operator[*] identifier[score] operator[SEP] identifier[Short] identifier[s] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[score] operator[SEP] operator[SEP] identifier[matrix] operator[SEP] identifier[currentRowPos] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[s] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[<] identifier[cols] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[symmetricMatrix] operator[SEP] operator[SEP] {
identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[currentRowPos] operator[SEP] operator[=] identifier[s] operator[SEP] identifier[symmetricMatrix] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[score] operator[>] identifier[max] operator[SEP] identifier[max] operator[=] identifier[s] operator[SEP] Keyword[if] operator[SEP] identifier[score] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[s] operator[SEP]
}
}
|
private void processElementNormal(GeneratorSingleCluster cluster, Node cur) {
double mean = 0.0;
double stddev = 1.0;
String meanstr = ((Element) cur).getAttribute(ATTR_MEAN);
if(meanstr != null && meanstr.length() > 0) {
mean = ParseUtil.parseDouble(meanstr);
}
String stddevstr = ((Element) cur).getAttribute(ATTR_STDDEV);
if(stddevstr != null && stddevstr.length() > 0) {
stddev = ParseUtil.parseDouble(stddevstr);
}
// *** New normal distribution generator
Random random = cluster.getNewRandomGenerator();
Distribution generator = new NormalDistribution(mean, stddev, random);
cluster.addGenerator(generator);
// TODO: check for unknown attributes.
XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
while(iter.hasNext()) {
Node child = iter.next();
if(child.getNodeType() == Node.ELEMENT_NODE) {
LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
}
}
} | class class_name[name] begin[{]
method[processElementNormal, return_type[void], modifier[private], parameter[cluster, cur]] begin[{]
local_variable[type[double], mean]
local_variable[type[double], stddev]
local_variable[type[String], meanstr]
if[binary_operation[binary_operation[member[.meanstr], !=, literal[null]], &&, binary_operation[call[meanstr.length, parameter[]], >, literal[0]]]] begin[{]
assign[member[.mean], call[ParseUtil.parseDouble, parameter[member[.meanstr]]]]
else begin[{]
None
end[}]
local_variable[type[String], stddevstr]
if[binary_operation[binary_operation[member[.stddevstr], !=, literal[null]], &&, binary_operation[call[stddevstr.length, parameter[]], >, literal[0]]]] begin[{]
assign[member[.stddev], call[ParseUtil.parseDouble, parameter[member[.stddevstr]]]]
else begin[{]
None
end[}]
local_variable[type[Random], random]
local_variable[type[Distribution], generator]
call[cluster.addGenerator, parameter[member[.generator]]]
local_variable[type[XMLNodeIterator], iter]
while[call[iter.hasNext, parameter[]]] begin[{]
local_variable[type[Node], child]
if[binary_operation[call[child.getNodeType, parameter[]], ==, member[Node.ELEMENT_NODE]]] begin[{]
call[LOG.warning, parameter[binary_operation[literal["Unknown element in XML specification file: "], +, call[child.getNodeName, parameter[]]]]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[processElementNormal] operator[SEP] identifier[GeneratorSingleCluster] identifier[cluster] , identifier[Node] identifier[cur] operator[SEP] {
Keyword[double] identifier[mean] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[stddev] operator[=] literal[Float] operator[SEP] identifier[String] identifier[meanstr] operator[=] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[cur] operator[SEP] operator[SEP] identifier[getAttribute] operator[SEP] identifier[ATTR_MEAN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[meanstr] operator[!=] Other[null] operator[&&] identifier[meanstr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[mean] operator[=] identifier[ParseUtil] operator[SEP] identifier[parseDouble] operator[SEP] identifier[meanstr] operator[SEP] operator[SEP]
}
identifier[String] identifier[stddevstr] operator[=] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[cur] operator[SEP] operator[SEP] identifier[getAttribute] operator[SEP] identifier[ATTR_STDDEV] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stddevstr] operator[!=] Other[null] operator[&&] identifier[stddevstr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[stddev] operator[=] identifier[ParseUtil] operator[SEP] identifier[parseDouble] operator[SEP] identifier[stddevstr] operator[SEP] operator[SEP]
}
identifier[Random] identifier[random] operator[=] identifier[cluster] operator[SEP] identifier[getNewRandomGenerator] operator[SEP] operator[SEP] operator[SEP] identifier[Distribution] identifier[generator] operator[=] Keyword[new] identifier[NormalDistribution] operator[SEP] identifier[mean] , identifier[stddev] , identifier[random] operator[SEP] operator[SEP] identifier[cluster] operator[SEP] identifier[addGenerator] operator[SEP] identifier[generator] operator[SEP] operator[SEP] identifier[XMLNodeIterator] identifier[iter] operator[=] Keyword[new] identifier[XMLNodeIterator] operator[SEP] identifier[cur] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Node] identifier[child] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[ELEMENT_NODE] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[+] identifier[child] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static <T> int binarySearch(final T[] a, final int fromIndex, final int toIndex, final T key, final Comparator<? super T> cmp) {
return Array.binarySearch(a, fromIndex, toIndex, key, cmp);
} | class class_name[name] begin[{]
method[binarySearch, return_type[type[int]], modifier[public static], parameter[a, fromIndex, toIndex, key, cmp]] begin[{]
return[call[Array.binarySearch, parameter[member[.a], member[.fromIndex], member[.toIndex], member[.key], member[.cmp]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[int] identifier[binarySearch] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[a] , Keyword[final] Keyword[int] identifier[fromIndex] , Keyword[final] Keyword[int] identifier[toIndex] , Keyword[final] identifier[T] identifier[key] , Keyword[final] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[cmp] operator[SEP] {
Keyword[return] identifier[Array] operator[SEP] identifier[binarySearch] operator[SEP] identifier[a] , identifier[fromIndex] , identifier[toIndex] , identifier[key] , identifier[cmp] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.