code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
private static int strAppender(String[] _text, StringBuilder _sbResult, int _beginIdx, int _len) {
if (_text == null || _sbResult == null) {
return -1;
}
if (_beginIdx > _text.length) {
return _text.length;
}
int i = _beginIdx;
for (i = _beginIdx; i < _text.length; i++) { // current token length + current buffer length
if (_sbResult.length() < _len) {
int condition = _text[i].length() + _sbResult.length();
boolean firstOrLastToken = true;
if (i <= _text.length -1 && _sbResult.length() > 0) { // add one char (for trailing space) if result is not empty and we are not on the first token
condition += 1; // + 1 (for space)
firstOrLastToken = false;
}
if (condition <= _len) {
if (!firstOrLastToken) { // append a space if result is not empty and we are not on the first token
_sbResult.append(" ");
}
_sbResult.append(_text[i]);
} else {
i-=1;
break;
}
} else {
if (i > _beginIdx) {
i-=1;
}
break;
}
}
return i;
}
|
class class_name[name] begin[{]
method[strAppender, return_type[type[int]], modifier[private static], parameter[_text, _sbResult, _beginIdx, _len]] begin[{]
if[binary_operation[binary_operation[member[._text], ==, literal[null]], ||, binary_operation[member[._sbResult], ==, literal[null]]]] begin[{]
return[literal[1]]
else begin[{]
None
end[}]
if[binary_operation[member[._beginIdx], >, member[_text.length]]] begin[{]
return[member[_text.length]]
else begin[{]
None
end[}]
local_variable[type[int], i]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=_sbResult, selectors=[], type_arguments=None), operandr=MemberReference(member=_len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_beginIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=_text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=_sbResult, selectors=[], type_arguments=None), operator=+), name=condition)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=firstOrLastToken)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=_text, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=_sbResult, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=condition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=firstOrLastToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=condition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=firstOrLastToken, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=_sbResult, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=_sbResult, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=_text, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=_beginIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.i]]
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[int] identifier[strAppender] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[_text] , identifier[StringBuilder] identifier[_sbResult] , Keyword[int] identifier[_beginIdx] , Keyword[int] identifier[_len] operator[SEP] {
Keyword[if] operator[SEP] identifier[_text] operator[==] Other[null] operator[||] identifier[_sbResult] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[-] Other[1] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_beginIdx] operator[>] identifier[_text] operator[SEP] identifier[length] operator[SEP] {
Keyword[return] identifier[_text] operator[SEP] identifier[length] operator[SEP]
}
Keyword[int] identifier[i] operator[=] identifier[_beginIdx] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] identifier[_beginIdx] operator[SEP] identifier[i] operator[<] identifier[_text] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[_sbResult] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[_len] operator[SEP] {
Keyword[int] identifier[condition] operator[=] identifier[_text] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] identifier[_sbResult] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[firstOrLastToken] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<=] identifier[_text] operator[SEP] identifier[length] operator[-] Other[1] operator[&&] identifier[_sbResult] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[condition] operator[+=] Other[1] operator[SEP] identifier[firstOrLastToken] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[condition] operator[<=] identifier[_len] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[firstOrLastToken] operator[SEP] {
identifier[_sbResult] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[_sbResult] operator[SEP] identifier[append] operator[SEP] identifier[_text] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[i] operator[-=] Other[1] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[i] operator[>] identifier[_beginIdx] operator[SEP] {
identifier[i] operator[-=] Other[1] operator[SEP]
}
Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[i] operator[SEP]
}
|
public static byte[] encodeToByte(final byte[] arr, final boolean lineSep) {
int len = arr != null ? arr.length : 0;
if (len == 0) {
return new byte[0];
}
int evenlen = (len / 3) * 3;
int cnt = ((len - 1) / 3 + 1) << 2;
int destlen = cnt + (lineSep ? (cnt - 1) / 76 << 1 : 0);
byte[] dest = new byte[destlen];
for (int s = 0, d = 0, cc = 0; s < evenlen;) {
int i = (arr[s++] & 0xff) << 16 | (arr[s++] & 0xff) << 8 | (arr[s++] & 0xff);
dest[d++] = (byte) CHARS[(i >>> 18) & 0x3f];
dest[d++] = (byte) CHARS[(i >>> 12) & 0x3f];
dest[d++] = (byte) CHARS[(i >>> 6) & 0x3f];
dest[d++] = (byte) CHARS[i & 0x3f];
if (lineSep && ++cc == 19 && d < destlen - 2) {
dest[d++] = '\r';
dest[d++] = '\n';
cc = 0;
}
}
int left = len - evenlen;
if (left > 0) {
int i = ((arr[evenlen] & 0xff) << 10) | (left == 2 ? ((arr[len - 1] & 0xff) << 2) : 0);
dest[destlen - 4] = (byte) CHARS[i >> 12];
dest[destlen - 3] = (byte) CHARS[(i >>> 6) & 0x3f];
dest[destlen - 2] = left == 2 ? (byte) CHARS[i & 0x3f] : (byte) '=';
dest[destlen - 1] = '=';
}
return dest;
}
|
class class_name[name] begin[{]
method[encodeToByte, return_type[type[byte]], modifier[public static], parameter[arr, lineSep]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.len], ==, literal[0]]] begin[{]
return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))]
else begin[{]
None
end[}]
local_variable[type[int], evenlen]
local_variable[type[int], cnt]
local_variable[type[int], destlen]
local_variable[type[byte], dest]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=s, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=s, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=|), operandr=BinaryOperation(operandl=MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=s, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operator=|), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=CHARS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18), operator=>>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3f), operator=&))]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=CHARS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=>>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3f), operator=&))]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=CHARS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=>>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3f), operator=&))]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=CHARS, 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=0x3f), operator=&))]), type=BasicType(dimensions=[], name=byte))), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lineSep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=cc, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=19), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=destlen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), operator=<), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r')), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=evenlen, 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=s), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=d), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=cc)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None)
local_variable[type[int], left]
if[binary_operation[member[.left], >, literal[0]]] begin[{]
local_variable[type[int], i]
assign[member[.dest], Cast(expression=MemberReference(member=CHARS, 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=12), operator=>>))]), type=BasicType(dimensions=[], name=byte))]
assign[member[.dest], Cast(expression=MemberReference(member=CHARS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=>>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3f), operator=&))]), type=BasicType(dimensions=[], name=byte))]
assign[member[.dest], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), if_false=Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='='), type=BasicType(dimensions=[], name=byte)), if_true=Cast(expression=MemberReference(member=CHARS, 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=0x3f), operator=&))]), type=BasicType(dimensions=[], name=byte)))]
assign[member[.dest], literal['=']]
else begin[{]
None
end[}]
return[member[.dest]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[encodeToByte] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[arr] , Keyword[final] Keyword[boolean] identifier[lineSep] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[arr] operator[!=] Other[null] operator[?] identifier[arr] operator[SEP] identifier[length] operator[:] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[==] Other[0] operator[SEP] {
Keyword[return] Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[int] identifier[evenlen] operator[=] operator[SEP] identifier[len] operator[/] Other[3] operator[SEP] operator[*] Other[3] operator[SEP] Keyword[int] identifier[cnt] operator[=] operator[SEP] operator[SEP] identifier[len] operator[-] Other[1] operator[SEP] operator[/] Other[3] operator[+] Other[1] operator[SEP] operator[<<] Other[2] operator[SEP] Keyword[int] identifier[destlen] operator[=] identifier[cnt] operator[+] operator[SEP] identifier[lineSep] operator[?] operator[SEP] identifier[cnt] operator[-] Other[1] operator[SEP] operator[/] Other[76] operator[<<] Other[1] operator[:] Other[0] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[dest] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[destlen] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[s] operator[=] Other[0] , identifier[d] operator[=] Other[0] , identifier[cc] operator[=] Other[0] operator[SEP] identifier[s] operator[<] identifier[evenlen] operator[SEP] operator[SEP] {
Keyword[int] identifier[i] operator[=] operator[SEP] identifier[arr] operator[SEP] identifier[s] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[|] operator[SEP] identifier[arr] operator[SEP] identifier[s] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[|] operator[SEP] identifier[arr] operator[SEP] identifier[s] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[d] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[CHARS] operator[SEP] operator[SEP] identifier[i] operator[>] operator[>] operator[>] Other[18] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[d] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[CHARS] operator[SEP] operator[SEP] identifier[i] operator[>] operator[>] operator[>] Other[12] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[d] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[CHARS] operator[SEP] operator[SEP] identifier[i] operator[>] operator[>] operator[>] Other[6] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[d] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[CHARS] operator[SEP] identifier[i] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lineSep] operator[&&] operator[++] identifier[cc] operator[==] Other[19] operator[&&] identifier[d] operator[<] identifier[destlen] operator[-] Other[2] operator[SEP] {
identifier[dest] operator[SEP] identifier[d] operator[++] operator[SEP] operator[=] literal[String] operator[SEP] identifier[dest] operator[SEP] identifier[d] operator[++] operator[SEP] operator[=] literal[String] operator[SEP] identifier[cc] operator[=] Other[0] operator[SEP]
}
}
Keyword[int] identifier[left] operator[=] identifier[len] operator[-] identifier[evenlen] operator[SEP] Keyword[if] operator[SEP] identifier[left] operator[>] Other[0] operator[SEP] {
Keyword[int] identifier[i] operator[=] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[evenlen] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[10] operator[SEP] operator[|] operator[SEP] identifier[left] operator[==] Other[2] operator[?] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[len] operator[-] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[2] operator[SEP] operator[:] Other[0] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[destlen] operator[-] Other[4] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[CHARS] operator[SEP] identifier[i] operator[>] operator[>] Other[12] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[destlen] operator[-] Other[3] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[CHARS] operator[SEP] operator[SEP] identifier[i] operator[>] operator[>] operator[>] Other[6] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[destlen] operator[-] Other[2] operator[SEP] operator[=] identifier[left] operator[==] Other[2] operator[?] operator[SEP] Keyword[byte] operator[SEP] identifier[CHARS] operator[SEP] identifier[i] operator[&] literal[Integer] operator[SEP] operator[:] operator[SEP] Keyword[byte] operator[SEP] literal[String] operator[SEP] identifier[dest] operator[SEP] identifier[destlen] operator[-] Other[1] operator[SEP] operator[=] literal[String] operator[SEP]
}
Keyword[return] identifier[dest] operator[SEP]
}
|
public static Set<UUID> getEntityIDsRecursively(final EntityContainer container) {
final Set<UUID> result = new HashSet<>();
walkEntityTree(container,
e -> result.add(e.getID()) ? EntityVisitResult.CONTINUE : EntityVisitResult.IGNORE_CHILDREN);
return result;
}
|
class class_name[name] begin[{]
method[getEntityIDsRecursively, return_type[type[Set]], modifier[public static], parameter[container]] begin[{]
local_variable[type[Set], result]
call[.walkEntityTree, parameter[member[.container], LambdaExpression(body=TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), if_false=MemberReference(member=IGNORE_CHILDREN, postfix_operators=[], prefix_operators=[], qualifier=EntityVisitResult, selectors=[]), if_true=MemberReference(member=CONTINUE, postfix_operators=[], prefix_operators=[], qualifier=EntityVisitResult, selectors=[])), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[UUID] operator[>] identifier[getEntityIDsRecursively] operator[SEP] Keyword[final] identifier[EntityContainer] identifier[container] operator[SEP] {
Keyword[final] identifier[Set] operator[<] identifier[UUID] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[walkEntityTree] operator[SEP] identifier[container] , identifier[e] operator[->] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[EntityVisitResult] operator[SEP] identifier[CONTINUE] operator[:] identifier[EntityVisitResult] operator[SEP] identifier[IGNORE_CHILDREN] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
@SuppressWarnings({ "rawtypes", "unchecked" })
@Nullable
public final XPath decompose(final Map<URI, Set<Object>> restrictions) {
Preconditions.checkNotNull(restrictions);
try {
Expr remaining = null;
for (final Expr node : toCNF(this.support.expr)) {
URI property = null;
Object valueOrRange = null;
if (node instanceof LocationPath) {
property = extractProperty(node);
valueOrRange = Boolean.TRUE;
} else if (node instanceof FunctionCallExpr) {
final FunctionCallExpr call = (FunctionCallExpr) node;
if ("not".equals(call.getFunctionName())) {
property = extractProperty((Expr) call.getParameters().get(0));
valueOrRange = Boolean.FALSE;
}
} else if (node instanceof BinaryExpr) {
final BinaryExpr binary = (BinaryExpr) node;
property = extractProperty(binary.getLHS());
Object value = extractValue(binary.getRHS());
boolean swap = false;
if (property == null || value == null) {
property = extractProperty(binary.getRHS());
value = extractValue(binary.getLHS());
swap = true;
}
if (value instanceof Literal) {
final Literal lit = (Literal) value;
final URI dt = lit.getDatatype();
if (dt == null || dt.equals(XMLSchema.STRING)) {
value = lit.stringValue();
} else if (dt.equals(XMLSchema.BOOLEAN)) {
value = lit.booleanValue();
} else if (dt.equals(XMLSchema.DATE) || dt.equals(XMLSchema.DATETIME)) {
value = lit.calendarValue().toGregorianCalendar().getTime();
} else if (dt.equals(XMLSchema.INT) || dt.equals(XMLSchema.LONG)
|| dt.equals(XMLSchema.DOUBLE) || dt.equals(XMLSchema.FLOAT)
|| dt.equals(XMLSchema.SHORT) || dt.equals(XMLSchema.BYTE)
|| dt.equals(XMLSchema.DECIMAL) || dt.equals(XMLSchema.INTEGER)
|| dt.equals(XMLSchema.NON_NEGATIVE_INTEGER)
|| dt.equals(XMLSchema.NON_POSITIVE_INTEGER)
|| dt.equals(XMLSchema.NEGATIVE_INTEGER)
|| dt.equals(XMLSchema.POSITIVE_INTEGER)) {
value = lit.doubleValue();
} else if (dt.equals(XMLSchema.NORMALIZEDSTRING)
|| dt.equals(XMLSchema.TOKEN) || dt.equals(XMLSchema.NMTOKEN)
|| dt.equals(XMLSchema.LANGUAGE) || dt.equals(XMLSchema.NAME)
|| dt.equals(XMLSchema.NCNAME)) {
value = lit.getLabel();
}
}
if (property != null && value != null) {
if ("=".equals(binary.getOperator())) {
valueOrRange = value;
} else if (value instanceof Comparable<?>) {
final Comparable<?> comp = (Comparable<?>) value;
if (">".equals(binary.getOperator())) {
valueOrRange = swap ? Range.lessThan(comp) : Range
.greaterThan(comp);
} else if (">=".equals(binary.getOperator())) {
valueOrRange = swap ? Range.atMost(comp) : Range.atLeast(comp);
} else if ("<".equals(binary.getOperator())) {
valueOrRange = swap ? Range.greaterThan(comp) : Range
.lessThan(comp);
} else if ("<=".equals(binary.getOperator())) {
valueOrRange = swap ? Range.atLeast(comp) : Range.atMost(comp);
}
}
}
}
boolean processed = false;
if (property != null && valueOrRange != null) {
Set<Object> set = restrictions.get(property);
if (set == null) {
set = ImmutableSet.of(valueOrRange);
restrictions.put(property, set);
processed = true;
} else {
final Object oldValue = set.iterator().next();
if (oldValue instanceof Range) {
final Range oldRange = (Range) oldValue;
if (valueOrRange instanceof Range) {
final Range newRange = (Range) valueOrRange;
if (oldRange.isConnected(newRange)) {
restrictions.put(property,
ImmutableSet.of(oldRange.intersection(newRange)));
processed = true;
}
} else if (valueOrRange instanceof Comparable) {
if (oldRange.contains((Comparable) valueOrRange)) {
restrictions.put(property, ImmutableSet.of(valueOrRange));
processed = true;
}
}
}
}
}
if (!processed) {
remaining = remaining == null ? node : FACTORY.createAndExpr(remaining, node);
}
}
return remaining == null ? null : parse(this.support.namespaces, remaining.getText());
} catch (final JaxenException ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}
|
class class_name[name] begin[{]
method[decompose, return_type[type[XPath]], modifier[final public], parameter[restrictions]] begin[{]
call[Preconditions.checkNotNull, parameter[member[.restrictions]]]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=remaining)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Expr, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=valueOrRange)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=LocationPath, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=FunctionCallExpr, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BinaryExpr, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BinaryExpr, sub_type=None)), name=binary)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BinaryExpr, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLHS, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=extractProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRHS, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=extractValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=swap)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRHS, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=extractProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLHS, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=extractValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=swap, 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=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Literal, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Literal, sub_type=None)), name=lit)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Literal, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDatatype, postfix_operators=[], prefix_operators=[], qualifier=lit, selectors=[], type_arguments=None), name=dt)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=DATETIME, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=INT, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=LONG, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=FLOAT, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=SHORT, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=BYTE, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=DECIMAL, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=INTEGER, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=NON_NEGATIVE_INTEGER, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=NON_POSITIVE_INTEGER, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=NEGATIVE_INTEGER, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=POSITIVE_INTEGER, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=NORMALIZEDSTRING, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=TOKEN, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=NMTOKEN, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=LANGUAGE, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=NCNAME, postfix_operators=[], prefix_operators=[], qualifier=XMLSchema, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=lit, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=lit, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=calendarValue, postfix_operators=[], prefix_operators=[], qualifier=lit, selectors=[MethodInvocation(arguments=[], member=toGregorianCalendar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=booleanValue, postfix_operators=[], prefix_operators=[], qualifier=lit, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=stringValue, postfix_operators=[], prefix_operators=[], qualifier=lit, selectors=[], type_arguments=None)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOperator, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="="), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Comparable, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Comparable, sub_type=None)), name=comp)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Comparable, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOperator, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=">"), else_statement=IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOperator, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=">="), else_statement=IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOperator, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="<"), else_statement=IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOperator, postfix_operators=[], prefix_operators=[], qualifier=binary, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="<="), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=atMost, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=atLeast, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lessThan, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=greaterThan, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=atLeast, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=atMost, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=greaterThan, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lessThan, postfix_operators=[], prefix_operators=[], qualifier=Range, selectors=[], type_arguments=None))), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FunctionCallExpr, sub_type=None)), name=call)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=FunctionCallExpr, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFunctionName, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="not"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Expr, sub_type=None))], member=extractProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=FALSE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[])), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=TRUE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=processed)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=restrictions, selectors=[], type_arguments=None), name=set)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=oldValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Range, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Range, sub_type=None)), name=oldRange)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Range, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Range, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Comparable, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Cast(expression=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Comparable, sub_type=None))], member=contains, postfix_operators=[], prefix_operators=[], qualifier=oldRange, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableSet, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=restrictions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Range, sub_type=None)), name=newRange)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Range, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=newRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isConnected, postfix_operators=[], prefix_operators=[], qualifier=oldRange, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=newRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intersection, postfix_operators=[], prefix_operators=[], qualifier=oldRange, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableSet, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=restrictions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]))]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=valueOrRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableSet, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=restrictions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))])), IfStatement(condition=MemberReference(member=processed, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createAndExpr, postfix_operators=[], prefix_operators=[], qualifier=FACTORY, selectors=[], type_arguments=None), if_true=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=support, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=expr, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=toCNF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Expr, sub_type=None))), label=None), ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=support, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=namespaces, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=remaining, selectors=[], type_arguments=None)], member=parse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['JaxenException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] annotation[@] identifier[Nullable] Keyword[public] Keyword[final] identifier[XPath] identifier[decompose] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[URI] , identifier[Set] operator[<] identifier[Object] operator[>] operator[>] identifier[restrictions] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[restrictions] operator[SEP] operator[SEP] Keyword[try] {
identifier[Expr] identifier[remaining] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Expr] identifier[node] operator[:] identifier[toCNF] operator[SEP] Keyword[this] operator[SEP] identifier[support] operator[SEP] identifier[expr] operator[SEP] operator[SEP] {
identifier[URI] identifier[property] operator[=] Other[null] operator[SEP] identifier[Object] identifier[valueOrRange] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[LocationPath] operator[SEP] {
identifier[property] operator[=] identifier[extractProperty] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[valueOrRange] operator[=] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[FunctionCallExpr] operator[SEP] {
Keyword[final] identifier[FunctionCallExpr] identifier[call] operator[=] operator[SEP] identifier[FunctionCallExpr] operator[SEP] identifier[node] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[call] operator[SEP] identifier[getFunctionName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[property] operator[=] identifier[extractProperty] operator[SEP] operator[SEP] identifier[Expr] operator[SEP] identifier[call] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[valueOrRange] operator[=] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[BinaryExpr] operator[SEP] {
Keyword[final] identifier[BinaryExpr] identifier[binary] operator[=] operator[SEP] identifier[BinaryExpr] operator[SEP] identifier[node] operator[SEP] identifier[property] operator[=] identifier[extractProperty] operator[SEP] identifier[binary] operator[SEP] identifier[getLHS] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[extractValue] operator[SEP] identifier[binary] operator[SEP] identifier[getRHS] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[swap] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[==] Other[null] operator[||] identifier[value] operator[==] Other[null] operator[SEP] {
identifier[property] operator[=] identifier[extractProperty] operator[SEP] identifier[binary] operator[SEP] identifier[getRHS] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[extractValue] operator[SEP] identifier[binary] operator[SEP] identifier[getLHS] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[swap] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Literal] operator[SEP] {
Keyword[final] identifier[Literal] identifier[lit] operator[=] operator[SEP] identifier[Literal] operator[SEP] identifier[value] operator[SEP] Keyword[final] identifier[URI] identifier[dt] operator[=] identifier[lit] operator[SEP] identifier[getDatatype] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dt] operator[==] Other[null] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[STRING] operator[SEP] operator[SEP] {
identifier[value] operator[=] identifier[lit] operator[SEP] identifier[stringValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[BOOLEAN] operator[SEP] operator[SEP] {
identifier[value] operator[=] identifier[lit] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[DATE] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[DATETIME] operator[SEP] operator[SEP] {
identifier[value] operator[=] identifier[lit] operator[SEP] identifier[calendarValue] operator[SEP] operator[SEP] operator[SEP] identifier[toGregorianCalendar] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[INT] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[LONG] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[DOUBLE] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[FLOAT] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[SHORT] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[BYTE] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[DECIMAL] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[INTEGER] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[NON_NEGATIVE_INTEGER] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[NON_POSITIVE_INTEGER] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[NEGATIVE_INTEGER] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[POSITIVE_INTEGER] operator[SEP] operator[SEP] {
identifier[value] operator[=] identifier[lit] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[NORMALIZEDSTRING] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[TOKEN] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[NMTOKEN] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[LANGUAGE] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[NAME] operator[SEP] operator[||] identifier[dt] operator[SEP] identifier[equals] operator[SEP] identifier[XMLSchema] operator[SEP] identifier[NCNAME] operator[SEP] operator[SEP] {
identifier[value] operator[=] identifier[lit] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[property] operator[!=] Other[null] operator[&&] identifier[value] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[binary] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[valueOrRange] operator[=] identifier[value] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Comparable] operator[<] operator[?] operator[>] operator[SEP] {
Keyword[final] identifier[Comparable] operator[<] operator[?] operator[>] identifier[comp] operator[=] operator[SEP] identifier[Comparable] operator[<] operator[?] operator[>] operator[SEP] identifier[value] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[binary] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[valueOrRange] operator[=] identifier[swap] operator[?] identifier[Range] operator[SEP] identifier[lessThan] operator[SEP] identifier[comp] operator[SEP] operator[:] identifier[Range] operator[SEP] identifier[greaterThan] operator[SEP] identifier[comp] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[binary] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[valueOrRange] operator[=] identifier[swap] operator[?] identifier[Range] operator[SEP] identifier[atMost] operator[SEP] identifier[comp] operator[SEP] operator[:] identifier[Range] operator[SEP] identifier[atLeast] operator[SEP] identifier[comp] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[binary] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[valueOrRange] operator[=] identifier[swap] operator[?] identifier[Range] operator[SEP] identifier[greaterThan] operator[SEP] identifier[comp] operator[SEP] operator[:] identifier[Range] operator[SEP] identifier[lessThan] operator[SEP] identifier[comp] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[binary] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[valueOrRange] operator[=] identifier[swap] operator[?] identifier[Range] operator[SEP] identifier[atLeast] operator[SEP] identifier[comp] operator[SEP] operator[:] identifier[Range] operator[SEP] identifier[atMost] operator[SEP] identifier[comp] operator[SEP] operator[SEP]
}
}
}
}
Keyword[boolean] identifier[processed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[!=] Other[null] operator[&&] identifier[valueOrRange] operator[!=] Other[null] operator[SEP] {
identifier[Set] operator[<] identifier[Object] operator[>] identifier[set] operator[=] identifier[restrictions] operator[SEP] identifier[get] operator[SEP] identifier[property] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[set] operator[==] Other[null] operator[SEP] {
identifier[set] operator[=] identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] identifier[valueOrRange] operator[SEP] operator[SEP] identifier[restrictions] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[set] operator[SEP] operator[SEP] identifier[processed] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[Object] identifier[oldValue] operator[=] identifier[set] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldValue] Keyword[instanceof] identifier[Range] operator[SEP] {
Keyword[final] identifier[Range] identifier[oldRange] operator[=] operator[SEP] identifier[Range] operator[SEP] identifier[oldValue] operator[SEP] Keyword[if] operator[SEP] identifier[valueOrRange] Keyword[instanceof] identifier[Range] operator[SEP] {
Keyword[final] identifier[Range] identifier[newRange] operator[=] operator[SEP] identifier[Range] operator[SEP] identifier[valueOrRange] operator[SEP] Keyword[if] operator[SEP] identifier[oldRange] operator[SEP] identifier[isConnected] operator[SEP] identifier[newRange] operator[SEP] operator[SEP] {
identifier[restrictions] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] identifier[oldRange] operator[SEP] identifier[intersection] operator[SEP] identifier[newRange] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processed] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[valueOrRange] Keyword[instanceof] identifier[Comparable] operator[SEP] {
Keyword[if] operator[SEP] identifier[oldRange] operator[SEP] identifier[contains] operator[SEP] operator[SEP] identifier[Comparable] operator[SEP] identifier[valueOrRange] operator[SEP] operator[SEP] {
identifier[restrictions] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] identifier[valueOrRange] operator[SEP] operator[SEP] operator[SEP] identifier[processed] operator[=] literal[boolean] operator[SEP]
}
}
}
}
}
Keyword[if] operator[SEP] operator[!] identifier[processed] operator[SEP] {
identifier[remaining] operator[=] identifier[remaining] operator[==] Other[null] operator[?] identifier[node] operator[:] identifier[FACTORY] operator[SEP] identifier[createAndExpr] operator[SEP] identifier[remaining] , identifier[node] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[remaining] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[parse] operator[SEP] Keyword[this] operator[SEP] identifier[support] operator[SEP] identifier[namespaces] , identifier[remaining] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[JaxenException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP]
}
}
|
protected void connect(SocketAddress address, int timeout)
throws IOException {
boolean connected = false;
try {
if (address == null || !(address instanceof InetSocketAddress))
throw new IllegalArgumentException("unsupported address type");
InetSocketAddress addr = (InetSocketAddress) address;
if (addr.isUnresolved())
throw new UnknownHostException(addr.getHostName());
this.port = addr.getPort();
this.address = addr.getAddress();
connectToAddress(this.address, port, timeout);
connected = true;
} finally {
if (!connected) {
try {
close();
} catch (IOException ioe) {
/* Do nothing. If connect threw an exception then
it will be passed up the call stack */
}
}
}
}
|
class class_name[name] begin[{]
method[connect, return_type[void], modifier[protected], parameter[address, timeout]] begin[{]
local_variable[type[boolean], connected]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None), operator=instanceof), operator=||), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unsupported address type")], 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)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), name=addr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isUnresolved, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getHostName, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnknownHostException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=port, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[], member=getPort, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=address, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[], member=getAddress, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=address, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=connectToAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=connected, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None)
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[connect] operator[SEP] identifier[SocketAddress] identifier[address] , Keyword[int] identifier[timeout] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[boolean] identifier[connected] operator[=] literal[boolean] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[address] operator[==] Other[null] operator[||] operator[!] operator[SEP] identifier[address] Keyword[instanceof] identifier[InetSocketAddress] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[InetSocketAddress] identifier[addr] operator[=] operator[SEP] identifier[InetSocketAddress] operator[SEP] identifier[address] operator[SEP] Keyword[if] operator[SEP] identifier[addr] operator[SEP] identifier[isUnresolved] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[UnknownHostException] operator[SEP] identifier[addr] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[port] operator[=] identifier[addr] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[address] operator[=] identifier[addr] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] identifier[connectToAddress] operator[SEP] Keyword[this] operator[SEP] identifier[address] , identifier[port] , identifier[timeout] operator[SEP] operator[SEP] identifier[connected] operator[=] literal[boolean] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] operator[!] identifier[connected] operator[SEP] {
Keyword[try] {
identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] {
}
}
}
}
|
public Collection essentialCycles() {
Collection result = new HashSet();
//minimize();
for (Object subgraphBase : subgraphBases) {
SimpleCycleBasis cycleBasis = (SimpleCycleBasis) subgraphBase;
result.addAll(cycleBasis.essentialCycles());
}
return result;
}
|
class class_name[name] begin[{]
method[essentialCycles, return_type[type[Collection]], modifier[public], parameter[]] begin[{]
local_variable[type[Collection], result]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=subgraphBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SimpleCycleBasis, sub_type=None)), name=cycleBasis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SimpleCycleBasis, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=essentialCycles, postfix_operators=[], prefix_operators=[], qualifier=cycleBasis, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=subgraphBases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subgraphBase)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}]
|
Keyword[public] identifier[Collection] identifier[essentialCycles] operator[SEP] operator[SEP] {
identifier[Collection] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[subgraphBase] operator[:] identifier[subgraphBases] operator[SEP] {
identifier[SimpleCycleBasis] identifier[cycleBasis] operator[=] operator[SEP] identifier[SimpleCycleBasis] operator[SEP] identifier[subgraphBase] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[cycleBasis] operator[SEP] identifier[essentialCycles] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public ProxySettings setCredentials(String id, String password)
{
return setId(id).setPassword(password);
}
|
class class_name[name] begin[{]
method[setCredentials, return_type[type[ProxySettings]], modifier[public], parameter[id, password]] begin[{]
return[call[.setId, parameter[member[.id]]]]
end[}]
END[}]
|
Keyword[public] identifier[ProxySettings] identifier[setCredentials] operator[SEP] identifier[String] identifier[id] , identifier[String] identifier[password] operator[SEP] {
Keyword[return] identifier[setId] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[setPassword] operator[SEP] identifier[password] operator[SEP] operator[SEP]
}
|
public double[] getColumn(int column) {
checkIndices(0, column);
rowReadLock.lock();
double[] values = new double[rows.get()];
for (int row = 0; row < rows.get(); ++row)
values[row] = get(row, column);
rowReadLock.unlock();
return values;
}
|
class class_name[name] begin[{]
method[getColumn, return_type[type[double]], modifier[public], parameter[column]] begin[{]
call[.checkIndices, parameter[literal[0], member[.column]]]
call[rowReadLock.lock, parameter[]]
local_variable[type[double], values]
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=row, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
call[rowReadLock.unlock, parameter[]]
return[member[.values]]
end[}]
END[}]
|
Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[getColumn] operator[SEP] Keyword[int] identifier[column] operator[SEP] {
identifier[checkIndices] operator[SEP] Other[0] , identifier[column] operator[SEP] operator[SEP] identifier[rowReadLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[values] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[rows] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[row] operator[=] Other[0] operator[SEP] identifier[row] operator[<] identifier[rows] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[row] operator[SEP] identifier[values] operator[SEP] identifier[row] operator[SEP] operator[=] identifier[get] operator[SEP] identifier[row] , identifier[column] operator[SEP] operator[SEP] identifier[rowReadLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[values] operator[SEP]
}
|
public static AssetUpdater updater(final String pathServiceSid,
final String pathSid,
final String friendlyName) {
return new AssetUpdater(pathServiceSid, pathSid, friendlyName);
}
|
class class_name[name] begin[{]
method[updater, return_type[type[AssetUpdater]], modifier[public static], parameter[pathServiceSid, pathSid, friendlyName]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=pathServiceSid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pathSid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=friendlyName, 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=AssetUpdater, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[AssetUpdater] identifier[updater] operator[SEP] Keyword[final] identifier[String] identifier[pathServiceSid] , Keyword[final] identifier[String] identifier[pathSid] , Keyword[final] identifier[String] identifier[friendlyName] operator[SEP] {
Keyword[return] Keyword[new] identifier[AssetUpdater] operator[SEP] identifier[pathServiceSid] , identifier[pathSid] , identifier[friendlyName] operator[SEP] operator[SEP]
}
|
public void marshall(EnableKeyRequest enableKeyRequest, ProtocolMarshaller protocolMarshaller) {
if (enableKeyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(enableKeyRequest.getKeyId(), KEYID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
|
class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[enableKeyRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.enableKeyRequest], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeyId, postfix_operators=[], prefix_operators=[], qualifier=enableKeyRequest, selectors=[], type_arguments=None), MemberReference(member=KEYID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[EnableKeyRequest] identifier[enableKeyRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[enableKeyRequest] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[enableKeyRequest] operator[SEP] identifier[getKeyId] operator[SEP] operator[SEP] , identifier[KEYID_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static void setBgColor(View view, final Config config) {
int[] colors = view.getContext().getResources().getIntArray(R.array.bg_colors);
final int bgColor = colors[config.bgColor];
view.setBackgroundColor(bgColor);
}
|
class class_name[name] begin[{]
method[setBgColor, return_type[void], modifier[public static], parameter[view, config]] begin[{]
local_variable[type[int], colors]
local_variable[type[int], bgColor]
call[view.setBackgroundColor, parameter[member[.bgColor]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[setBgColor] operator[SEP] identifier[View] identifier[view] , Keyword[final] identifier[Config] identifier[config] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[colors] operator[=] identifier[view] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getIntArray] operator[SEP] identifier[R] operator[SEP] identifier[array] operator[SEP] identifier[bg_colors] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[bgColor] operator[=] identifier[colors] operator[SEP] identifier[config] operator[SEP] identifier[bgColor] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[setBackgroundColor] operator[SEP] identifier[bgColor] operator[SEP] operator[SEP]
}
|
public static FeaturableConfig imports(Xml root)
{
Check.notNull(root);
final String clazz;
if (root.hasChild(ATT_CLASS))
{
clazz = root.getChild(ATT_CLASS).getText();
}
else
{
clazz = DEFAULT_CLASS_NAME;
}
final String setup;
if (root.hasChild(ATT_SETUP))
{
setup = root.getChild(ATT_SETUP).getText();
}
else
{
setup = Constant.EMPTY_STRING;
}
return new FeaturableConfig(clazz, setup);
}
|
class class_name[name] begin[{]
method[imports, return_type[type[FeaturableConfig]], modifier[public static], parameter[root]] begin[{]
call[Check.notNull, parameter[member[.root]]]
local_variable[type[String], clazz]
if[call[root.hasChild, parameter[member[.ATT_CLASS]]]] begin[{]
assign[member[.clazz], call[root.getChild, parameter[member[.ATT_CLASS]]]]
else begin[{]
assign[member[.clazz], member[.DEFAULT_CLASS_NAME]]
end[}]
local_variable[type[String], setup]
if[call[root.hasChild, parameter[member[.ATT_SETUP]]]] begin[{]
assign[member[.setup], call[root.getChild, parameter[member[.ATT_SETUP]]]]
else begin[{]
assign[member[.setup], member[Constant.EMPTY_STRING]]
end[}]
return[ClassCreator(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=setup, 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=FeaturableConfig, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[FeaturableConfig] identifier[imports] operator[SEP] identifier[Xml] identifier[root] operator[SEP] {
identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[root] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[clazz] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[SEP] identifier[hasChild] operator[SEP] identifier[ATT_CLASS] operator[SEP] operator[SEP] {
identifier[clazz] operator[=] identifier[root] operator[SEP] identifier[getChild] operator[SEP] identifier[ATT_CLASS] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[clazz] operator[=] identifier[DEFAULT_CLASS_NAME] operator[SEP]
}
Keyword[final] identifier[String] identifier[setup] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[SEP] identifier[hasChild] operator[SEP] identifier[ATT_SETUP] operator[SEP] operator[SEP] {
identifier[setup] operator[=] identifier[root] operator[SEP] identifier[getChild] operator[SEP] identifier[ATT_SETUP] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[setup] operator[=] identifier[Constant] operator[SEP] identifier[EMPTY_STRING] operator[SEP]
}
Keyword[return] Keyword[new] identifier[FeaturableConfig] operator[SEP] identifier[clazz] , identifier[setup] operator[SEP] operator[SEP]
}
|
final void setCcsid(Object value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setCcsid", value);
// If the value is null, then clear the field
if (value == null) {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
}
// If it is an Integer, then we just store it
else if (value instanceof Integer) {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID_DATA, value);
}
// If it is a String (most likely) we have to convert it into an int value first
/*
* else if (value instanceof String) {
* try {
* int ccsid = CCSID.getCCSID((String)value);
* jmo.getPayloadPart().setIntField(JsPayloadAccess.CCSID_DATA, ccsid);
* }
* catch (UnsupportedEncodingException e) {
* // FFDC it, then clear the field
* FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.JsApiHdrsImpl.setCcsid", "866");
* jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
* }
* }
*/
// If it isn't of a suitable type, clear the field
else {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setCcsid");
}
|
class class_name[name] begin[{]
method[setCcsid, return_type[void], modifier[final], parameter[value]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["setCcsid"], member[.value]]]
else begin[{]
None
end[}]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
call[jmo.getPayloadPart, parameter[]]
else begin[{]
if[binary_operation[member[.value], instanceof, type[Integer]]] begin[{]
call[jmo.getPayloadPart, parameter[]]
else begin[{]
call[jmo.getPayloadPart, parameter[]]
end[}]
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["setCcsid"]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[final] Keyword[void] identifier[setCcsid] operator[SEP] identifier[Object] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
identifier[jmo] operator[SEP] identifier[getPayloadPart] operator[SEP] operator[SEP] operator[SEP] identifier[setField] operator[SEP] identifier[JsPayloadAccess] operator[SEP] identifier[CCSID] , identifier[JsPayloadAccess] operator[SEP] identifier[IS_CCSID_EMPTY] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Integer] operator[SEP] {
identifier[jmo] operator[SEP] identifier[getPayloadPart] operator[SEP] operator[SEP] operator[SEP] identifier[setField] operator[SEP] identifier[JsPayloadAccess] operator[SEP] identifier[CCSID_DATA] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[jmo] operator[SEP] identifier[getPayloadPart] operator[SEP] operator[SEP] operator[SEP] identifier[setField] operator[SEP] identifier[JsPayloadAccess] operator[SEP] identifier[CCSID] , identifier[JsPayloadAccess] operator[SEP] identifier[IS_CCSID_EMPTY] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
protected String getFileEncoding(CmsObject cms, String filename) {
try {
return cms.readPropertyObject(filename, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true).getValue(
OpenCms.getSystemInfo().getDefaultEncoding());
} catch (CmsException e) {
return OpenCms.getSystemInfo().getDefaultEncoding();
}
}
|
class class_name[name] begin[{]
method[getFileEncoding, return_type[type[String]], modifier[protected], parameter[cms, filename]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PROPERTY_CONTENT_ENCODING, postfix_operators=[], prefix_operators=[], qualifier=CmsPropertyDefinition, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=readPropertyObject, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSystemInfo, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[], member=getDefaultEncoding, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getSystemInfo, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[], member=getDefaultEncoding, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[protected] identifier[String] identifier[getFileEncoding] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[String] identifier[filename] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[cms] operator[SEP] identifier[readPropertyObject] operator[SEP] identifier[filename] , identifier[CmsPropertyDefinition] operator[SEP] identifier[PROPERTY_CONTENT_ENCODING] , literal[boolean] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getSystemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
Keyword[return] identifier[OpenCms] operator[SEP] identifier[getSystemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultEncoding] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static String[] splitOptions(String input) {
//Note that we use a regex matching all "|" characters not prefixed by "\"
//Since we define a regex for matching, the input delimiter "|" needs to be escaped, as well as "\",
//which is even double-escaped - one escaping is due to the String, one due to the regex.
// emulate missing lookbehinds in JS regexes by first reversing the input,
// then using a split with lookaheads, and finally reversing the parts resulting
// from the split
String reverse = reverse(input);
String[] parts = reverse.split("\\|(?!\\\\)");
String[] finalParts = new String[parts.length];
int lastIndex = parts.length - 1;
for (int i = 0; i < parts.length; i++) {
finalParts[lastIndex - i] = reverse(parts[i]);
}
return finalParts;
}
|
class class_name[name] begin[{]
method[splitOptions, return_type[type[String]], modifier[public static], parameter[input]] begin[{]
local_variable[type[String], reverse]
local_variable[type[String], parts]
local_variable[type[String], finalParts]
local_variable[type[int], lastIndex]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=finalParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=lastIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=reverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, 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[.finalParts]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[splitOptions] operator[SEP] identifier[String] identifier[input] operator[SEP] {
identifier[String] identifier[reverse] operator[=] identifier[reverse] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[reverse] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[finalParts] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[lastIndex] operator[=] identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parts] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[finalParts] operator[SEP] identifier[lastIndex] operator[-] identifier[i] operator[SEP] operator[=] identifier[reverse] operator[SEP] identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[finalParts] operator[SEP]
}
|
@SuppressWarnings({"WeakerAccess", "unused"})
public void renderToCanvas(Canvas canvas, RenderOptions renderOptions)
{
if (renderOptions == null)
renderOptions = new RenderOptions();
if (!renderOptions.hasViewPort()) {
renderOptions.viewPort(0f, 0f, (float) canvas.getWidth(), (float) canvas.getHeight());
}
SVGAndroidRenderer renderer = new SVGAndroidRenderer(canvas, this.renderDPI);
renderer.renderDocument(this, renderOptions);
}
|
class class_name[name] begin[{]
method[renderToCanvas, return_type[void], modifier[public], parameter[canvas, renderOptions]] begin[{]
if[binary_operation[member[.renderOptions], ==, literal[null]]] begin[{]
assign[member[.renderOptions], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RenderOptions, sub_type=None))]
else begin[{]
None
end[}]
if[call[renderOptions.hasViewPort, parameter[]]] begin[{]
call[renderOptions.viewPort, parameter[literal[0f], literal[0f], Cast(expression=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=canvas, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=float)), Cast(expression=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=canvas, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=float))]]
else begin[{]
None
end[}]
local_variable[type[SVGAndroidRenderer], renderer]
call[renderer.renderDocument, parameter[THIS[], member[.renderOptions]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[public] Keyword[void] identifier[renderToCanvas] operator[SEP] identifier[Canvas] identifier[canvas] , identifier[RenderOptions] identifier[renderOptions] operator[SEP] {
Keyword[if] operator[SEP] identifier[renderOptions] operator[==] Other[null] operator[SEP] identifier[renderOptions] operator[=] Keyword[new] identifier[RenderOptions] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[renderOptions] operator[SEP] identifier[hasViewPort] operator[SEP] operator[SEP] operator[SEP] {
identifier[renderOptions] operator[SEP] identifier[viewPort] operator[SEP] literal[Float] , literal[Float] , operator[SEP] Keyword[float] operator[SEP] identifier[canvas] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , operator[SEP] Keyword[float] operator[SEP] identifier[canvas] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[SVGAndroidRenderer] identifier[renderer] operator[=] Keyword[new] identifier[SVGAndroidRenderer] operator[SEP] identifier[canvas] , Keyword[this] operator[SEP] identifier[renderDPI] operator[SEP] operator[SEP] identifier[renderer] operator[SEP] identifier[renderDocument] operator[SEP] Keyword[this] , identifier[renderOptions] operator[SEP] operator[SEP]
}
|
@Override
public void setTargetHistoryToken(final String targetHistoryToken) {
this.targetHistoryToken = targetHistoryToken;
if (targetHistoryToken != null) {
final String hash = History.encodeHistoryToken(targetHistoryToken);
getAnchorElement().setHref("#" + hash);
}
}
|
class class_name[name] begin[{]
method[setTargetHistoryToken, return_type[void], modifier[public], parameter[targetHistoryToken]] begin[{]
assign[THIS[member[None.targetHistoryToken]], member[.targetHistoryToken]]
if[binary_operation[member[.targetHistoryToken], !=, literal[null]]] begin[{]
local_variable[type[String], hash]
call[.getAnchorElement, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setTargetHistoryToken] operator[SEP] Keyword[final] identifier[String] identifier[targetHistoryToken] operator[SEP] {
Keyword[this] operator[SEP] identifier[targetHistoryToken] operator[=] identifier[targetHistoryToken] operator[SEP] Keyword[if] operator[SEP] identifier[targetHistoryToken] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[String] identifier[hash] operator[=] identifier[History] operator[SEP] identifier[encodeHistoryToken] operator[SEP] identifier[targetHistoryToken] operator[SEP] operator[SEP] identifier[getAnchorElement] operator[SEP] operator[SEP] operator[SEP] identifier[setHref] operator[SEP] literal[String] operator[+] identifier[hash] operator[SEP] operator[SEP]
}
}
|
public static int[] cs_post(int[] parent, int n)
{
int j, k = 0, post[], w[], head[], next[], stack[] ;
if (parent == null) return (null) ; /* check inputs */
post = new int [n] ; /* allocate result */
w = new int [3*n] ; /* get workspace */
if (w == null || post == null) return (cs_idone (post, null, w, false)) ;
head = w ; next = w ;
int next_offset = n ;
stack = w ;
int stack_offset = 2*n ;
for (j = 0 ; j < n ; j++) head [j] = -1 ; /* empty linked lists */
for (j = n-1 ; j >= 0 ; j--) /* traverse nodes in reverse order*/
{
if (parent [j] == -1) continue; /* j is a root */
next [next_offset + j] = head [parent [j]] ; /* add j to list of its parent */
head [parent [j]] = j ;
}
for (j = 0 ; j < n ; j++)
{
if (parent [j] != -1) continue ; /* skip j if it is not a root */
k = cs_tdfs(j, k, head, 0, next, next_offset, post, 0, stack, stack_offset) ;
}
return (post) ;
}
|
class class_name[name] begin[{]
method[cs_post, return_type[type[int]], modifier[public static], parameter[parent, n]] begin[{]
local_variable[type[int], j]
if[binary_operation[member[.parent], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.post], ArrayCreator(dimensions=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
assign[member[.w], ArrayCreator(dimensions=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
if[binary_operation[binary_operation[member[.w], ==, literal[null]], ||, binary_operation[member[.post], ==, literal[null]]]] begin[{]
return[call[.cs_idone, parameter[member[.post], literal[null], member[.w], literal[false]]]]
else begin[{]
None
end[}]
assign[member[.head], member[.w]]
assign[member[.next], member[.w]]
local_variable[type[int], next_offset]
assign[member[.stack], member[.w]]
local_variable[type[int], stack_offset]
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=head, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, 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=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=next_offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MemberReference(member=head, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=head, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))]), type==, value=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=[Assignment(expressionl=MemberReference(member=j, 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=-))], update=[MemberReference(member=j, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, 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=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=head, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=next_offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=post, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stack_offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cs_tdfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.post]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[cs_post] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[parent] , Keyword[int] identifier[n] operator[SEP] {
Keyword[int] identifier[j] , identifier[k] operator[=] Other[0] , identifier[post] operator[SEP] operator[SEP] , identifier[w] operator[SEP] operator[SEP] , identifier[head] operator[SEP] operator[SEP] , identifier[next] operator[SEP] operator[SEP] , identifier[stack] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[post] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[n] operator[SEP] operator[SEP] identifier[w] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[3] operator[*] identifier[n] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[w] operator[==] Other[null] operator[||] identifier[post] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[cs_idone] operator[SEP] identifier[post] , Other[null] , identifier[w] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[head] operator[=] identifier[w] operator[SEP] identifier[next] operator[=] identifier[w] operator[SEP] Keyword[int] identifier[next_offset] operator[=] identifier[n] operator[SEP] identifier[stack] operator[=] identifier[w] operator[SEP] Keyword[int] identifier[stack_offset] operator[=] Other[2] operator[*] identifier[n] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[n] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[head] operator[SEP] identifier[j] operator[SEP] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] identifier[n] operator[-] Other[1] operator[SEP] identifier[j] operator[>=] Other[0] operator[SEP] identifier[j] operator[--] operator[SEP] {
Keyword[if] operator[SEP] identifier[parent] operator[SEP] identifier[j] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] Keyword[continue] operator[SEP] identifier[next] operator[SEP] identifier[next_offset] operator[+] identifier[j] operator[SEP] operator[=] identifier[head] operator[SEP] identifier[parent] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] identifier[head] operator[SEP] identifier[parent] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[=] identifier[j] operator[SEP]
}
Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[n] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[parent] operator[SEP] identifier[j] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] Keyword[continue] operator[SEP] identifier[k] operator[=] identifier[cs_tdfs] operator[SEP] identifier[j] , identifier[k] , identifier[head] , Other[0] , identifier[next] , identifier[next_offset] , identifier[post] , Other[0] , identifier[stack] , identifier[stack_offset] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[post] operator[SEP] operator[SEP]
}
|
@NotNull
public OptionalDouble map(@NotNull DoubleUnaryOperator mapper) {
if (!isPresent()) {
return empty();
}
Objects.requireNonNull(mapper);
return OptionalDouble.of(mapper.applyAsDouble(value));
}
|
class class_name[name] begin[{]
method[map, return_type[type[OptionalDouble]], modifier[public], parameter[mapper]] begin[{]
if[call[.isPresent, parameter[]]] begin[{]
return[call[.empty, parameter[]]]
else begin[{]
None
end[}]
call[Objects.requireNonNull, parameter[member[.mapper]]]
return[call[OptionalDouble.of, parameter[call[mapper.applyAsDouble, parameter[member[.value]]]]]]
end[}]
END[}]
|
annotation[@] identifier[NotNull] Keyword[public] identifier[OptionalDouble] identifier[map] operator[SEP] annotation[@] identifier[NotNull] identifier[DoubleUnaryOperator] identifier[mapper] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[empty] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[mapper] operator[SEP] operator[SEP] Keyword[return] identifier[OptionalDouble] operator[SEP] identifier[of] operator[SEP] identifier[mapper] operator[SEP] identifier[applyAsDouble] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
|
public StreamingOutput getResource(final String resourceName,
final Map<QueryParameter, String> queryParams) throws JaxRxException {
final StreamingOutput streamingOutput = new StreamingOutput() {
@Override
public void write(final OutputStream output) throws IOException, JaxRxException {
final String revision = queryParams.get(QueryParameter.REVISION);
final String wrap = queryParams.get(QueryParameter.WRAP);
final String nodeId = queryParams.get(QueryParameter.OUTPUT);
final boolean wrapResult = (wrap == null) ? false : wrap.equalsIgnoreCase(YESSTRING);
final boolean nodeid = (nodeId == null) ? false : nodeId.equalsIgnoreCase(YESSTRING);
try {
if (revision == null) {
serialize(resourceName, null, nodeid, output, wrapResult);
} else {
// pattern which have to match against the input
final Pattern pattern = Pattern.compile("[0-9]+[-]{1}[1-9]+");
final Matcher matcher = pattern.matcher(revision);
if (matcher.matches()) {
getModificHistory(resourceName, revision, nodeid, output, wrapResult);
} else {
serialize(resourceName, Long.valueOf(revision), nodeid, output, wrapResult);
}
}
} catch (final NumberFormatException exce) {
throw new JaxRxException(400, exce.getMessage());
} catch (final TTException exce) {
throw new JaxRxException(exce);
}
}
};
return streamingOutput;
}
|
class class_name[name] begin[{]
method[getResource, return_type[type[StreamingOutput]], modifier[public], parameter[resourceName, queryParams]] begin[{]
local_variable[type[StreamingOutput], streamingOutput]
return[member[.streamingOutput]]
end[}]
END[}]
|
Keyword[public] identifier[StreamingOutput] identifier[getResource] operator[SEP] Keyword[final] identifier[String] identifier[resourceName] , Keyword[final] identifier[Map] operator[<] identifier[QueryParameter] , identifier[String] operator[>] identifier[queryParams] operator[SEP] Keyword[throws] identifier[JaxRxException] {
Keyword[final] identifier[StreamingOutput] identifier[streamingOutput] operator[=] Keyword[new] identifier[StreamingOutput] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write] operator[SEP] Keyword[final] identifier[OutputStream] identifier[output] operator[SEP] Keyword[throws] identifier[IOException] , identifier[JaxRxException] {
Keyword[final] identifier[String] identifier[revision] operator[=] identifier[queryParams] operator[SEP] identifier[get] operator[SEP] identifier[QueryParameter] operator[SEP] identifier[REVISION] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[wrap] operator[=] identifier[queryParams] operator[SEP] identifier[get] operator[SEP] identifier[QueryParameter] operator[SEP] identifier[WRAP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[nodeId] operator[=] identifier[queryParams] operator[SEP] identifier[get] operator[SEP] identifier[QueryParameter] operator[SEP] identifier[OUTPUT] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[wrapResult] operator[=] operator[SEP] identifier[wrap] operator[==] Other[null] operator[SEP] operator[?] literal[boolean] operator[:] identifier[wrap] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[YESSTRING] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[nodeid] operator[=] operator[SEP] identifier[nodeId] operator[==] Other[null] operator[SEP] operator[?] literal[boolean] operator[:] identifier[nodeId] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[YESSTRING] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[revision] operator[==] Other[null] operator[SEP] {
identifier[serialize] operator[SEP] identifier[resourceName] , Other[null] , identifier[nodeid] , identifier[output] , identifier[wrapResult] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[Pattern] identifier[pattern] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Matcher] identifier[matcher] operator[=] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[revision] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] {
identifier[getModificHistory] operator[SEP] identifier[resourceName] , identifier[revision] , identifier[nodeid] , identifier[output] , identifier[wrapResult] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[serialize] operator[SEP] identifier[resourceName] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[revision] operator[SEP] , identifier[nodeid] , identifier[output] , identifier[wrapResult] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[NumberFormatException] identifier[exce] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JaxRxException] operator[SEP] Other[400] , identifier[exce] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[TTException] identifier[exce] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JaxRxException] operator[SEP] identifier[exce] operator[SEP] operator[SEP]
}
}
} operator[SEP] Keyword[return] identifier[streamingOutput] operator[SEP]
}
|
@Nonnull
public static <T> List<T> filter( @Nonnull List<?> base, @Nonnull Class<T> type ) {
return filter((Iterable)base,type);
}
|
class class_name[name] begin[{]
method[filter, return_type[type[List]], modifier[public static], parameter[base, type]] begin[{]
return[call[.filter, parameter[Cast(expression=MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Iterable, sub_type=None)), member[.type]]]]
end[}]
END[}]
|
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[filter] operator[SEP] annotation[@] identifier[Nonnull] identifier[List] operator[<] operator[?] operator[>] identifier[base] , annotation[@] identifier[Nonnull] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] {
Keyword[return] identifier[filter] operator[SEP] operator[SEP] identifier[Iterable] operator[SEP] identifier[base] , identifier[type] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
@Override
public <E> int delete(final Class<? extends E> entityType, final Object... keys) {
@SuppressWarnings("rawtypes")
EntityHandler handler = this.getEntityHandler();
if (!handler.getEntityType().isAssignableFrom(entityType)) {
throw new IllegalArgumentException("Entity type not supported");
}
try {
TableMetadata metadata = handler.getMetadata(this.transactionManager, entityType);
TableMetadata.Column keyColumn = null;
List<? extends TableMetadata.Column> keyColumns = metadata.getKeyColumns();
if (keyColumns.size() == 1) {
keyColumn = keyColumns.get(0);
} else if (keyColumns.isEmpty()) {
keyColumn = metadata.getColumns().get(0);
} else {
throw new IllegalArgumentException("Entity has multiple keys");
}
return delete(entityType).in(keyColumn.getCamelColumnName(), keys).count();
} catch (SQLException e) {
throw new EntitySqlRuntimeException(SqlKind.DELETE, e);
}
}
|
class class_name[name] begin[{]
method[delete, return_type[type[int]], modifier[public], parameter[entityType, keys]] begin[{]
local_variable[type[EntityHandler], handler]
if[call[handler.getEntityType, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity type not supported")], 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[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=transactionManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=entityType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMetadata, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), name=metadata)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TableMetadata, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=keyColumn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TableMetadata, sub_type=ReferenceType(arguments=None, dimensions=None, name=Column, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKeyColumns, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), name=keyColumns)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=TableMetadata, sub_type=ReferenceType(arguments=None, dimensions=None, name=Column, sub_type=None)))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=keyColumns, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=keyColumns, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity has multiple keys")], 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)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=keyColumns, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=entityType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCamelColumnName, postfix_operators=[], prefix_operators=[], qualifier=keyColumn, selectors=[], type_arguments=None), MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=in, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=count, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=DELETE, postfix_operators=[], prefix_operators=[], qualifier=SqlKind, selectors=[]), 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=EntitySqlRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] operator[<] identifier[E] operator[>] Keyword[int] identifier[delete] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] identifier[entityType] , Keyword[final] identifier[Object] operator[...] identifier[keys] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[EntityHandler] identifier[handler] operator[=] Keyword[this] operator[SEP] identifier[getEntityHandler] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[handler] operator[SEP] identifier[getEntityType] operator[SEP] operator[SEP] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[TableMetadata] identifier[metadata] operator[=] identifier[handler] operator[SEP] identifier[getMetadata] operator[SEP] Keyword[this] operator[SEP] identifier[transactionManager] , identifier[entityType] operator[SEP] operator[SEP] identifier[TableMetadata] operator[SEP] identifier[Column] identifier[keyColumn] operator[=] Other[null] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[TableMetadata] operator[SEP] identifier[Column] operator[>] identifier[keyColumns] operator[=] identifier[metadata] operator[SEP] identifier[getKeyColumns] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyColumns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[keyColumn] operator[=] identifier[keyColumns] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[keyColumns] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[keyColumn] operator[=] identifier[metadata] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[delete] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[keyColumn] operator[SEP] identifier[getCamelColumnName] operator[SEP] operator[SEP] , identifier[keys] operator[SEP] operator[SEP] identifier[count] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[EntitySqlRuntimeException] operator[SEP] identifier[SqlKind] operator[SEP] identifier[DELETE] , identifier[e] operator[SEP] operator[SEP]
}
}
|
<T extends INode> T addNode(String path, T newNode, boolean inheritPermission
) throws FileNotFoundException {
byte[][] pathComponents = getPathComponents(path);
if(addToParent(pathComponents, newNode, inheritPermission, true) == null)
return null;
return newNode;
}
|
class class_name[name] begin[{]
method[addNode, return_type[type[T]], modifier[default], parameter[path, newNode, inheritPermission]] begin[{]
local_variable[type[byte], pathComponents]
if[binary_operation[call[.addToParent, parameter[member[.pathComponents], member[.newNode], member[.inheritPermission], literal[true]]], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[member[.newNode]]
end[}]
END[}]
|
operator[<] identifier[T] Keyword[extends] identifier[INode] operator[>] identifier[T] identifier[addNode] operator[SEP] identifier[String] identifier[path] , identifier[T] identifier[newNode] , Keyword[boolean] identifier[inheritPermission] operator[SEP] Keyword[throws] identifier[FileNotFoundException] {
Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pathComponents] operator[=] identifier[getPathComponents] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[addToParent] operator[SEP] identifier[pathComponents] , identifier[newNode] , identifier[inheritPermission] , literal[boolean] operator[SEP] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[newNode] operator[SEP]
}
|
public static final void setPosition(UIObject o, Rect pos) {
Style style = o.getElement().getStyle();
style.setPropertyPx("left", pos.x);
style.setPropertyPx("top", pos.y);
}
|
class class_name[name] begin[{]
method[setPosition, return_type[void], modifier[final public static], parameter[o, pos]] begin[{]
local_variable[type[Style], style]
call[style.setPropertyPx, parameter[literal["left"], member[pos.x]]]
call[style.setPropertyPx, parameter[literal["top"], member[pos.y]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[final] Keyword[void] identifier[setPosition] operator[SEP] identifier[UIObject] identifier[o] , identifier[Rect] identifier[pos] operator[SEP] {
identifier[Style] identifier[style] operator[=] identifier[o] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[style] operator[SEP] identifier[setPropertyPx] operator[SEP] literal[String] , identifier[pos] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[style] operator[SEP] identifier[setPropertyPx] operator[SEP] literal[String] , identifier[pos] operator[SEP] identifier[y] operator[SEP] operator[SEP]
}
|
public static Method[] getAccessibleMethods(Class clazz, final Class limit) {
Package topPackage = clazz.getPackage();
List<Method> methodList = new ArrayList<>();
int topPackageHash = topPackage == null ? 0 : topPackage.hashCode();
boolean top = true;
do {
if (clazz == null) {
break;
}
Method[] declaredMethods = clazz.getDeclaredMethods();
for (Method method : declaredMethods) {
if (Modifier.isVolatile(method.getModifiers())) {
continue;
}
// if (Modifier.isAbstract(method.getModifiers())) {
// continue;
// }
if (top) { // add all top declared methods
methodList.add(method);
continue;
}
int modifier = method.getModifiers();
if (Modifier.isPrivate(modifier)) {
continue; // ignore super private methods
}
if (Modifier.isAbstract(modifier)) { // ignore super abstract methods
continue;
}
if (Modifier.isPublic(modifier)) {
addMethodIfNotExist(methodList, method); // add super public methods
continue;
}
if (Modifier.isProtected(modifier)) {
addMethodIfNotExist(methodList, method); // add super protected methods
continue;
}
// add super default methods from the same package
Package pckg = method.getDeclaringClass().getPackage();
int pckgHash = pckg == null ? 0 : pckg.hashCode();
if (pckgHash == topPackageHash) {
addMethodIfNotExist(methodList, method);
}
}
top = false;
} while ((clazz = clazz.getSuperclass()) != limit);
Method[] methods = new Method[methodList.size()];
for (int i = 0; i < methods.length; i++) {
methods[i] = methodList.get(i);
}
return methods;
}
|
class class_name[name] begin[{]
method[getAccessibleMethods, return_type[type[Method]], modifier[public static], parameter[clazz, limit]] begin[{]
local_variable[type[Package], topPackage]
local_variable[type[List], methodList]
local_variable[type[int], topPackageHash]
local_variable[type[boolean], top]
do[binary_operation[assign[member[.clazz], call[clazz.getSuperclass, parameter[]]], !=, member[.limit]]] begin[{]
if[binary_operation[member[.clazz], ==, literal[null]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
local_variable[type[Method], declaredMethods]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None)], member=isVolatile, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=methodList, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=modifier)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=modifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPrivate, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=modifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAbstract, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=modifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPublic, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMethodIfNotExist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=modifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isProtected, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMethodIfNotExist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[], member=getPackage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=pckg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Package, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=pckg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=hashCode, postfix_operators=[], prefix_operators=[], qualifier=pckg, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), name=pckgHash)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pckgHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=topPackageHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMethodIfNotExist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=declaredMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None)
assign[member[.top], literal[false]]
end[}]
local_variable[type[Method], methods]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=methodList, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=methods, 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[.methods]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Method] operator[SEP] operator[SEP] identifier[getAccessibleMethods] operator[SEP] identifier[Class] identifier[clazz] , Keyword[final] identifier[Class] identifier[limit] operator[SEP] {
identifier[Package] identifier[topPackage] operator[=] identifier[clazz] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Method] operator[>] identifier[methodList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[topPackageHash] operator[=] identifier[topPackage] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[topPackage] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[top] operator[=] literal[boolean] operator[SEP] Keyword[do] {
Keyword[if] operator[SEP] identifier[clazz] operator[==] Other[null] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[Method] operator[SEP] operator[SEP] identifier[declaredMethods] operator[=] identifier[clazz] operator[SEP] identifier[getDeclaredMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Method] identifier[method] operator[:] identifier[declaredMethods] operator[SEP] {
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isVolatile] operator[SEP] identifier[method] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[top] operator[SEP] {
identifier[methodList] operator[SEP] identifier[add] operator[SEP] identifier[method] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[int] identifier[modifier] operator[=] identifier[method] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isPrivate] operator[SEP] identifier[modifier] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[modifier] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[modifier] operator[SEP] operator[SEP] {
identifier[addMethodIfNotExist] operator[SEP] identifier[methodList] , identifier[method] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isProtected] operator[SEP] identifier[modifier] operator[SEP] operator[SEP] {
identifier[addMethodIfNotExist] operator[SEP] identifier[methodList] , identifier[method] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
identifier[Package] identifier[pckg] operator[=] identifier[method] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pckgHash] operator[=] identifier[pckg] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[pckg] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pckgHash] operator[==] identifier[topPackageHash] operator[SEP] {
identifier[addMethodIfNotExist] operator[SEP] identifier[methodList] , identifier[method] operator[SEP] operator[SEP]
}
}
identifier[top] operator[=] literal[boolean] operator[SEP]
}
Keyword[while] operator[SEP] operator[SEP] identifier[clazz] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] operator[!=] identifier[limit] operator[SEP] operator[SEP] identifier[Method] operator[SEP] operator[SEP] identifier[methods] operator[=] Keyword[new] identifier[Method] operator[SEP] identifier[methodList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[methods] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[methods] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[methodList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[return] identifier[methods] operator[SEP]
}
|
public Observable<Page<SiteInner>> listWebAppsNextAsync(final String nextPageLink) {
return listWebAppsNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<SiteInner>>, Page<SiteInner>>() {
@Override
public Page<SiteInner> call(ServiceResponse<Page<SiteInner>> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[listWebAppsNextAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{]
return[call[.listWebAppsNextWithServiceResponseAsync, parameter[member[.nextPageLink]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] identifier[listWebAppsNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] {
Keyword[return] identifier[listWebAppsNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[SiteInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public SearchResponse searchAll(String[] indices, String type) {
return searchAll(indices, JMArrays.buildArray(type));
}
|
class class_name[name] begin[{]
method[searchAll, return_type[type[SearchResponse]], modifier[public], parameter[indices, type]] begin[{]
return[call[.searchAll, parameter[member[.indices], call[JMArrays.buildArray, parameter[member[.type]]]]]]
end[}]
END[}]
|
Keyword[public] identifier[SearchResponse] identifier[searchAll] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[indices] , identifier[String] identifier[type] operator[SEP] {
Keyword[return] identifier[searchAll] operator[SEP] identifier[indices] , identifier[JMArrays] operator[SEP] identifier[buildArray] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP]
}
|
private AstNode parseCreateIndex( final DdlTokenStream tokens,
final AstNode parentNode ) throws ParsingException {
assert tokens != null;
assert parentNode != null;
assert (tokens.matches(STMT_CREATE_INDEX) || tokens.matches(STMT_CREATE_UNIQUE_INDEX) || tokens.matches(STMT_CREATE_BITMAP_INDEX));
markStartOfStatement(tokens);
tokens.consume(CREATE);
final boolean isUnique = tokens.canConsume(UNIQUE);
final boolean isBitmap = tokens.canConsume("BITMAP");
tokens.consume(INDEX);
final String indexName = parseName(tokens);
tokens.consume(ON);
AstNode indexNode = null;
if (tokens.canConsume("CLUSTER")) {
// table-cluster_index_clause
indexNode = nodeFactory().node(indexName, parentNode, TYPE_CREATE_CLUSTER_INDEX_STATEMENT);
indexNode.setProperty(OracleDdlLexicon.INDEX_TYPE, OracleDdlConstants.IndexTypes.CLUSTER);
final String clusterName = parseName(tokens);
indexNode.setProperty(OracleDdlLexicon.CLUSTER_NAME, clusterName);
} else {
final String tableName = parseName(tokens);
if (!tokens.matches('(')) {
// must be a table-index-clause as this has to be table-alias
final String tableAlias = tokens.consume();
indexNode = nodeFactory().node(indexName, parentNode, TYPE_CREATE_TABLE_INDEX_STATEMENT);
indexNode.setProperty(OracleDdlLexicon.INDEX_TYPE, OracleDdlConstants.IndexTypes.TABLE);
indexNode.setProperty(OracleDdlLexicon.TABLE_ALIAS, tableAlias);
}
// parse left-paren content right-paren
final String columnExpressionList = parseContentBetweenParens(tokens);
// must have FROM and WHERE clauses
if (tokens.canConsume("FROM")) {
indexNode = nodeFactory().node(indexName, parentNode, TYPE_CREATE_BITMAP_JOIN_INDEX_STATEMENT);
indexNode.setProperty(OracleDdlLexicon.INDEX_TYPE, OracleDdlConstants.IndexTypes.BITMAP_JOIN);
parseTableReferenceList(tokens, indexNode);
tokens.consume("WHERE");
final String whereClause = parseUntilTerminator(tokens); // this will have index attributes also:-(
indexNode.setProperty(OracleDdlLexicon.WHERE_CLAUSE, whereClause);
} else {
indexNode = nodeFactory().node(indexName, parentNode, TYPE_CREATE_TABLE_INDEX_STATEMENT);
indexNode.setProperty(OracleDdlLexicon.INDEX_TYPE, OracleDdlConstants.IndexTypes.TABLE);
}
indexNode.setProperty(OracleDdlLexicon.TABLE_NAME, tableName);
parseIndexColumnExpressionList('(' + columnExpressionList + ')', indexNode);
}
indexNode.setProperty(UNIQUE_INDEX, isUnique);
indexNode.setProperty(BITMAP_INDEX, isBitmap);
// index attributes are optional as is UNUSABLE
if (tokens.hasNext()) {
boolean unusable = false;
final List<String> indexAttributes = new ArrayList<String>();
while (tokens.hasNext() && !isTerminator(tokens)) {
String token = tokens.consume();
if ("UNUSABLE".equalsIgnoreCase(token)) {
unusable = true;
break; // must be last token found before terminator
}
// if number add it to previous
boolean processed = false;
if (token.matches("\\b\\d+\\b")) {
if (!indexAttributes.isEmpty()) {
final int index = (indexAttributes.size() - 1);
final String value = indexAttributes.get(index);
final String newValue = (value + SPACE + token);
indexAttributes.set(index, newValue);
processed = true;
}
}
if (!processed) {
indexAttributes.add(token);
}
}
if (!indexAttributes.isEmpty()) {
indexNode.setProperty(OracleDdlLexicon.INDEX_ATTRIBUTES, indexAttributes);
}
indexNode.setProperty(OracleDdlLexicon.UNUSABLE_INDEX, unusable);
}
markEndOfStatement(tokens, indexNode);
return indexNode;
}
|
class class_name[name] begin[{]
method[parseCreateIndex, return_type[type[AstNode]], modifier[private], parameter[tokens, parentNode]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=tokens, 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=parentNode, 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=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=STMT_CREATE_INDEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=STMT_CREATE_UNIQUE_INDEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=STMT_CREATE_BITMAP_INDEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), operator=||), label=None, value=None)
call[.markStartOfStatement, parameter[member[.tokens]]]
call[tokens.consume, parameter[member[.CREATE]]]
local_variable[type[boolean], isUnique]
local_variable[type[boolean], isBitmap]
call[tokens.consume, parameter[member[.INDEX]]]
local_variable[type[String], indexName]
call[tokens.consume, parameter[member[.ON]]]
local_variable[type[AstNode], indexNode]
if[call[tokens.canConsume, parameter[literal["CLUSTER"]]]] begin[{]
assign[member[.indexNode], call[.nodeFactory, parameter[]]]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.INDEX_TYPE], member[OracleDdlConstants.IndexTypes.CLUSTER]]]
local_variable[type[String], clusterName]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.CLUSTER_NAME], member[.clusterName]]]
else begin[{]
local_variable[type[String], tableName]
if[call[tokens.matches, parameter[literal['(']]]] begin[{]
local_variable[type[String], tableAlias]
assign[member[.indexNode], call[.nodeFactory, parameter[]]]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.INDEX_TYPE], member[OracleDdlConstants.IndexTypes.TABLE]]]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.TABLE_ALIAS], member[.tableAlias]]]
else begin[{]
None
end[}]
local_variable[type[String], columnExpressionList]
if[call[tokens.canConsume, parameter[literal["FROM"]]]] begin[{]
assign[member[.indexNode], call[.nodeFactory, parameter[]]]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.INDEX_TYPE], member[OracleDdlConstants.IndexTypes.BITMAP_JOIN]]]
call[.parseTableReferenceList, parameter[member[.tokens], member[.indexNode]]]
call[tokens.consume, parameter[literal["WHERE"]]]
local_variable[type[String], whereClause]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.WHERE_CLAUSE], member[.whereClause]]]
else begin[{]
assign[member[.indexNode], call[.nodeFactory, parameter[]]]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.INDEX_TYPE], member[OracleDdlConstants.IndexTypes.TABLE]]]
end[}]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.TABLE_NAME], member[.tableName]]]
call[.parseIndexColumnExpressionList, parameter[binary_operation[binary_operation[literal['('], +, member[.columnExpressionList]], +, literal[')']], member[.indexNode]]]
end[}]
call[indexNode.setProperty, parameter[member[.UNIQUE_INDEX], member[.isUnique]]]
call[indexNode.setProperty, parameter[member[.BITMAP_INDEX], member[.isBitmap]]]
if[call[tokens.hasNext, parameter[]]] begin[{]
local_variable[type[boolean], unusable]
local_variable[type[List], indexAttributes]
while[binary_operation[call[tokens.hasNext, parameter[]], &&, call[.isTerminator, parameter[member[.tokens]]]]] begin[{]
local_variable[type[String], token]
if[literal["UNUSABLE"]] begin[{]
assign[member[.unusable], literal[true]]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
local_variable[type[boolean], processed]
if[call[token.matches, parameter[literal["\\b\\d+\\b"]]]] begin[{]
if[call[indexAttributes.isEmpty, parameter[]]] begin[{]
local_variable[type[int], index]
local_variable[type[String], value]
local_variable[type[String], newValue]
call[indexAttributes.set, parameter[member[.index], member[.newValue]]]
assign[member[.processed], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[member[.processed]] begin[{]
call[indexAttributes.add, parameter[member[.token]]]
else begin[{]
None
end[}]
end[}]
if[call[indexAttributes.isEmpty, parameter[]]] begin[{]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.INDEX_ATTRIBUTES], member[.indexAttributes]]]
else begin[{]
None
end[}]
call[indexNode.setProperty, parameter[member[OracleDdlLexicon.UNUSABLE_INDEX], member[.unusable]]]
else begin[{]
None
end[}]
call[.markEndOfStatement, parameter[member[.tokens], member[.indexNode]]]
return[member[.indexNode]]
end[}]
END[}]
|
Keyword[private] identifier[AstNode] identifier[parseCreateIndex] operator[SEP] Keyword[final] identifier[DdlTokenStream] identifier[tokens] , Keyword[final] identifier[AstNode] identifier[parentNode] operator[SEP] Keyword[throws] identifier[ParsingException] {
Keyword[assert] identifier[tokens] operator[!=] Other[null] operator[SEP] Keyword[assert] identifier[parentNode] operator[!=] Other[null] operator[SEP] Keyword[assert] operator[SEP] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] identifier[STMT_CREATE_INDEX] operator[SEP] operator[||] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] identifier[STMT_CREATE_UNIQUE_INDEX] operator[SEP] operator[||] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] identifier[STMT_CREATE_BITMAP_INDEX] operator[SEP] operator[SEP] operator[SEP] identifier[markStartOfStatement] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] identifier[consume] operator[SEP] identifier[CREATE] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[isUnique] operator[=] identifier[tokens] operator[SEP] identifier[canConsume] operator[SEP] identifier[UNIQUE] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[isBitmap] operator[=] identifier[tokens] operator[SEP] identifier[canConsume] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] identifier[consume] operator[SEP] identifier[INDEX] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[indexName] operator[=] identifier[parseName] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] identifier[consume] operator[SEP] identifier[ON] operator[SEP] operator[SEP] identifier[AstNode] identifier[indexNode] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[canConsume] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[indexNode] operator[=] identifier[nodeFactory] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[indexName] , identifier[parentNode] , identifier[TYPE_CREATE_CLUSTER_INDEX_STATEMENT] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[INDEX_TYPE] , identifier[OracleDdlConstants] operator[SEP] identifier[IndexTypes] operator[SEP] identifier[CLUSTER] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[clusterName] operator[=] identifier[parseName] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[CLUSTER_NAME] , identifier[clusterName] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[String] identifier[tableName] operator[=] identifier[parseName] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[tableAlias] operator[=] identifier[tokens] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP] identifier[indexNode] operator[=] identifier[nodeFactory] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[indexName] , identifier[parentNode] , identifier[TYPE_CREATE_TABLE_INDEX_STATEMENT] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[INDEX_TYPE] , identifier[OracleDdlConstants] operator[SEP] identifier[IndexTypes] operator[SEP] identifier[TABLE] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[TABLE_ALIAS] , identifier[tableAlias] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[columnExpressionList] operator[=] identifier[parseContentBetweenParens] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[canConsume] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[indexNode] operator[=] identifier[nodeFactory] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[indexName] , identifier[parentNode] , identifier[TYPE_CREATE_BITMAP_JOIN_INDEX_STATEMENT] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[INDEX_TYPE] , identifier[OracleDdlConstants] operator[SEP] identifier[IndexTypes] operator[SEP] identifier[BITMAP_JOIN] operator[SEP] operator[SEP] identifier[parseTableReferenceList] operator[SEP] identifier[tokens] , identifier[indexNode] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] identifier[consume] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[whereClause] operator[=] identifier[parseUntilTerminator] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[WHERE_CLAUSE] , identifier[whereClause] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[indexNode] operator[=] identifier[nodeFactory] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[indexName] , identifier[parentNode] , identifier[TYPE_CREATE_TABLE_INDEX_STATEMENT] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[INDEX_TYPE] , identifier[OracleDdlConstants] operator[SEP] identifier[IndexTypes] operator[SEP] identifier[TABLE] operator[SEP] operator[SEP]
}
identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[TABLE_NAME] , identifier[tableName] operator[SEP] operator[SEP] identifier[parseIndexColumnExpressionList] operator[SEP] literal[String] operator[+] identifier[columnExpressionList] operator[+] literal[String] , identifier[indexNode] operator[SEP] operator[SEP]
}
identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[UNIQUE_INDEX] , identifier[isUnique] operator[SEP] operator[SEP] identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[BITMAP_INDEX] , identifier[isBitmap] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[unusable] operator[=] literal[boolean] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[indexAttributes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tokens] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[isTerminator] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] {
identifier[String] identifier[token] operator[=] identifier[tokens] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
identifier[unusable] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[boolean] identifier[processed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[indexAttributes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[index] operator[=] operator[SEP] identifier[indexAttributes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[=] identifier[indexAttributes] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[newValue] operator[=] operator[SEP] identifier[value] operator[+] identifier[SPACE] operator[+] identifier[token] operator[SEP] operator[SEP] identifier[indexAttributes] operator[SEP] identifier[set] operator[SEP] identifier[index] , identifier[newValue] operator[SEP] operator[SEP] identifier[processed] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[processed] operator[SEP] {
identifier[indexAttributes] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[indexAttributes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[INDEX_ATTRIBUTES] , identifier[indexAttributes] operator[SEP] operator[SEP]
}
identifier[indexNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[OracleDdlLexicon] operator[SEP] identifier[UNUSABLE_INDEX] , identifier[unusable] operator[SEP] operator[SEP]
}
identifier[markEndOfStatement] operator[SEP] identifier[tokens] , identifier[indexNode] operator[SEP] operator[SEP] Keyword[return] identifier[indexNode] operator[SEP]
}
|
public long getSoFar(final int downloadId) {
BaseDownloadTask.IRunningTask task = FileDownloadList.getImpl().get(downloadId);
if (task == null) {
return FileDownloadServiceProxy.getImpl().getSofar(downloadId);
}
return task.getOrigin().getLargeFileSoFarBytes();
}
|
class class_name[name] begin[{]
method[getSoFar, return_type[type[long]], modifier[public], parameter[downloadId]] begin[{]
local_variable[type[BaseDownloadTask], task]
if[binary_operation[member[.task], ==, literal[null]]] begin[{]
return[call[FileDownloadServiceProxy.getImpl, parameter[]]]
else begin[{]
None
end[}]
return[call[task.getOrigin, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[long] identifier[getSoFar] operator[SEP] Keyword[final] Keyword[int] identifier[downloadId] operator[SEP] {
identifier[BaseDownloadTask] operator[SEP] identifier[IRunningTask] identifier[task] operator[=] identifier[FileDownloadList] operator[SEP] identifier[getImpl] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[downloadId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[task] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[FileDownloadServiceProxy] operator[SEP] identifier[getImpl] operator[SEP] operator[SEP] operator[SEP] identifier[getSofar] operator[SEP] identifier[downloadId] operator[SEP] operator[SEP]
}
Keyword[return] identifier[task] operator[SEP] identifier[getOrigin] operator[SEP] operator[SEP] operator[SEP] identifier[getLargeFileSoFarBytes] operator[SEP] operator[SEP] operator[SEP]
}
|
public static MongoCredential createPlainCredential(final String userName, final String source, final char[] password) {
return new MongoCredential(PLAIN, userName, source, password);
}
|
class class_name[name] begin[{]
method[createPlainCredential, return_type[type[MongoCredential]], modifier[public static], parameter[userName, source, password]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=PLAIN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=password, 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=MongoCredential, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[MongoCredential] identifier[createPlainCredential] operator[SEP] Keyword[final] identifier[String] identifier[userName] , Keyword[final] identifier[String] identifier[source] , Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[password] operator[SEP] {
Keyword[return] Keyword[new] identifier[MongoCredential] operator[SEP] identifier[PLAIN] , identifier[userName] , identifier[source] , identifier[password] operator[SEP] operator[SEP]
}
|
@Override
public void handleProgressNotification(final ProgressNotification pn) {
if (this.jrebirthInitialized && pn.getProgress() >= 0.0 && pn.getProgress() <= 1.0) {
this.progressBar.setProgress(pn.getProgress());
} else {
this.messageText.setText(getMessageFromCode((int) pn.getProgress()));
}
}
|
class class_name[name] begin[{]
method[handleProgressNotification, return_type[void], modifier[public], parameter[pn]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.jrebirthInitialized]], &&, binary_operation[call[pn.getProgress, parameter[]], >=, literal[0.0]]], &&, binary_operation[call[pn.getProgress, parameter[]], <=, literal[1.0]]]] begin[{]
THIS[member[None.progressBar]call[None.setProgress, parameter[call[pn.getProgress, parameter[]]]]]
else begin[{]
THIS[member[None.messageText]call[None.setText, parameter[call[.getMessageFromCode, parameter[Cast(expression=MethodInvocation(arguments=[], member=getProgress, postfix_operators=[], prefix_operators=[], qualifier=pn, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]]]]]
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handleProgressNotification] operator[SEP] Keyword[final] identifier[ProgressNotification] identifier[pn] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[jrebirthInitialized] operator[&&] identifier[pn] operator[SEP] identifier[getProgress] operator[SEP] operator[SEP] operator[>=] literal[Float] operator[&&] identifier[pn] operator[SEP] identifier[getProgress] operator[SEP] operator[SEP] operator[<=] literal[Float] operator[SEP] {
Keyword[this] operator[SEP] identifier[progressBar] operator[SEP] identifier[setProgress] operator[SEP] identifier[pn] operator[SEP] identifier[getProgress] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[messageText] operator[SEP] identifier[setText] operator[SEP] identifier[getMessageFromCode] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[pn] operator[SEP] identifier[getProgress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public SetSubtitleVodNonDvdOperation buildSetSubtitleVodNonDvdOperation(String track, String color, int fontSize, int position, String encoding, String timeOffset){
return new SetSubtitleVodNonDvdOperation(getOperationFactory(), track, color, fontSize, position, encoding, timeOffset);
}
|
class class_name[name] begin[{]
method[buildSetSubtitleVodNonDvdOperation, return_type[type[SetSubtitleVodNonDvdOperation]], modifier[public], parameter[track, color, fontSize, position, encoding, timeOffset]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getOperationFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=track, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fontSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeOffset, 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=SetSubtitleVodNonDvdOperation, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[SetSubtitleVodNonDvdOperation] identifier[buildSetSubtitleVodNonDvdOperation] operator[SEP] identifier[String] identifier[track] , identifier[String] identifier[color] , Keyword[int] identifier[fontSize] , Keyword[int] identifier[position] , identifier[String] identifier[encoding] , identifier[String] identifier[timeOffset] operator[SEP] {
Keyword[return] Keyword[new] identifier[SetSubtitleVodNonDvdOperation] operator[SEP] identifier[getOperationFactory] operator[SEP] operator[SEP] , identifier[track] , identifier[color] , identifier[fontSize] , identifier[position] , identifier[encoding] , identifier[timeOffset] operator[SEP] operator[SEP]
}
|
void initAndroidDevices() throws AndroidDeviceException {
deviceManager =
new DefaultDeviceManager(AndroidSdk.adb().getAbsolutePath(),
serverConfiguration.shouldKeepAdbAlive());
deviceStore = new DeviceStore(serverConfiguration.getEmulatorPort(), deviceManager);
deviceStore.initAndroidDevices(new DefaultHardwareDeviceListener(deviceStore, this),
serverConfiguration.shouldKeepAdbAlive());
}
|
class class_name[name] begin[{]
method[initAndroidDevices, return_type[void], modifier[default], parameter[]] begin[{]
assign[member[.deviceManager], ClassCreator(arguments=[MethodInvocation(arguments=[], member=adb, postfix_operators=[], prefix_operators=[], qualifier=AndroidSdk, selectors=[MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=shouldKeepAdbAlive, postfix_operators=[], prefix_operators=[], qualifier=serverConfiguration, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultDeviceManager, sub_type=None))]
assign[member[.deviceStore], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getEmulatorPort, postfix_operators=[], prefix_operators=[], qualifier=serverConfiguration, selectors=[], type_arguments=None), MemberReference(member=deviceManager, 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=DeviceStore, sub_type=None))]
call[deviceStore.initAndroidDevices, parameter[ClassCreator(arguments=[MemberReference(member=deviceStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultHardwareDeviceListener, sub_type=None)), call[serverConfiguration.shouldKeepAdbAlive, parameter[]]]]
end[}]
END[}]
|
Keyword[void] identifier[initAndroidDevices] operator[SEP] operator[SEP] Keyword[throws] identifier[AndroidDeviceException] {
identifier[deviceManager] operator[=] Keyword[new] identifier[DefaultDeviceManager] operator[SEP] identifier[AndroidSdk] operator[SEP] identifier[adb] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[serverConfiguration] operator[SEP] identifier[shouldKeepAdbAlive] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[deviceStore] operator[=] Keyword[new] identifier[DeviceStore] operator[SEP] identifier[serverConfiguration] operator[SEP] identifier[getEmulatorPort] operator[SEP] operator[SEP] , identifier[deviceManager] operator[SEP] operator[SEP] identifier[deviceStore] operator[SEP] identifier[initAndroidDevices] operator[SEP] Keyword[new] identifier[DefaultHardwareDeviceListener] operator[SEP] identifier[deviceStore] , Keyword[this] operator[SEP] , identifier[serverConfiguration] operator[SEP] identifier[shouldKeepAdbAlive] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void throwPageMigratedException(String msg, int code, int subcode, String userTitle, String userMsg) {
// This SUCKS ASS. Messages look like:
// (#21) Page ID 114267748588304 was migrated to page ID 111013272313096. Please update your API calls to the new ID
Matcher matcher = ID_PATTERN.matcher(msg);
long oldId = this.extractNextId(matcher, msg);
long newId = this.extractNextId(matcher, msg);
throw new PageMigratedException(msg, code, subcode, userTitle, userMsg, oldId, newId);
}
|
class class_name[name] begin[{]
method[throwPageMigratedException, return_type[void], modifier[private], parameter[msg, code, subcode, userTitle, userMsg]] begin[{]
local_variable[type[Matcher], matcher]
local_variable[type[long], oldId]
local_variable[type[long], newId]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userTitle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oldId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newId, 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=PageMigratedException, sub_type=None)), label=None)
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[throwPageMigratedException] operator[SEP] identifier[String] identifier[msg] , Keyword[int] identifier[code] , Keyword[int] identifier[subcode] , identifier[String] identifier[userTitle] , identifier[String] identifier[userMsg] operator[SEP] {
identifier[Matcher] identifier[matcher] operator[=] identifier[ID_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[long] identifier[oldId] operator[=] Keyword[this] operator[SEP] identifier[extractNextId] operator[SEP] identifier[matcher] , identifier[msg] operator[SEP] operator[SEP] Keyword[long] identifier[newId] operator[=] Keyword[this] operator[SEP] identifier[extractNextId] operator[SEP] identifier[matcher] , identifier[msg] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[PageMigratedException] operator[SEP] identifier[msg] , identifier[code] , identifier[subcode] , identifier[userTitle] , identifier[userMsg] , identifier[oldId] , identifier[newId] operator[SEP] operator[SEP]
}
|
public static void shutdownExecutorService(ExecutorService executorService, Optional<Logger> logger) {
shutdownExecutorService(executorService, logger, EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT,
EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT_TIMEUNIT);
}
|
class class_name[name] begin[{]
method[shutdownExecutorService, return_type[void], modifier[public static], parameter[executorService, logger]] begin[{]
call[.shutdownExecutorService, parameter[member[.executorService], member[.logger], member[.EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT], member[.EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT_TIMEUNIT]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[shutdownExecutorService] operator[SEP] identifier[ExecutorService] identifier[executorService] , identifier[Optional] operator[<] identifier[Logger] operator[>] identifier[logger] operator[SEP] {
identifier[shutdownExecutorService] operator[SEP] identifier[executorService] , identifier[logger] , identifier[EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT] , identifier[EXECUTOR_SERVICE_SHUTDOWN_TIMEOUT_TIMEUNIT] operator[SEP] operator[SEP]
}
|
public void validate() throws ValidateException
{
if ((this.xaDataSourceClass == null || this.xaDataSourceClass.trim().length() == 0) &&
(this.driver == null || this.driver.trim().length() == 0))
throw new ValidateException(bundle.requiredElementMissing(XML.ELEMENT_XA_DATASOURCE_CLASS,
this.getClass().getCanonicalName()));
if (this.xaDataSourceProperty.isEmpty())
throw new ValidateException(bundle.requiredElementMissing(XML.ELEMENT_XA_DATASOURCE_PROPERTY,
this.getClass().getCanonicalName()));
}
|
class class_name[name] begin[{]
method[validate, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[binary_operation[THIS[member[None.xaDataSourceClass]], ==, literal[null]], ||, binary_operation[THIS[member[None.xaDataSourceClass]call[None.trim, parameter[]]call[None.length, parameter[]]], ==, literal[0]]], &&, binary_operation[binary_operation[THIS[member[None.driver]], ==, literal[null]], ||, binary_operation[THIS[member[None.driver]call[None.trim, parameter[]]call[None.length, parameter[]]], ==, literal[0]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ELEMENT_XA_DATASOURCE_CLASS, postfix_operators=[], prefix_operators=[], qualifier=XML, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=requiredElementMissing, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValidateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[THIS[member[None.xaDataSourceProperty]call[None.isEmpty, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ELEMENT_XA_DATASOURCE_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=XML, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=requiredElementMissing, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValidateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[validate] operator[SEP] operator[SEP] Keyword[throws] identifier[ValidateException] {
Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[xaDataSourceClass] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[xaDataSourceClass] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[driver] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[driver] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ValidateException] operator[SEP] identifier[bundle] operator[SEP] identifier[requiredElementMissing] operator[SEP] identifier[XML] operator[SEP] identifier[ELEMENT_XA_DATASOURCE_CLASS] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[xaDataSourceProperty] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ValidateException] operator[SEP] identifier[bundle] operator[SEP] identifier[requiredElementMissing] operator[SEP] identifier[XML] operator[SEP] identifier[ELEMENT_XA_DATASOURCE_PROPERTY] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(RtmpCaptionInfoDestinationSettings rtmpCaptionInfoDestinationSettings, ProtocolMarshaller protocolMarshaller) {
if (rtmpCaptionInfoDestinationSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
|
class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[rtmpCaptionInfoDestinationSettings, protocolMarshaller]] begin[{]
if[binary_operation[member[.rtmpCaptionInfoDestinationSettings], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[RtmpCaptionInfoDestinationSettings] identifier[rtmpCaptionInfoDestinationSettings] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[rtmpCaptionInfoDestinationSettings] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void writeNativeResponse(NativeResponse resp, Writer writer) throws IOException {
JsonGenerator gen = factory().getJsonFactory().createGenerator(writer);
writeNativeResponse(resp, gen);
}
|
class class_name[name] begin[{]
method[writeNativeResponse, return_type[void], modifier[public], parameter[resp, writer]] begin[{]
local_variable[type[JsonGenerator], gen]
call[.writeNativeResponse, parameter[member[.resp], member[.gen]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[writeNativeResponse] operator[SEP] identifier[NativeResponse] identifier[resp] , identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[JsonGenerator] identifier[gen] operator[=] identifier[factory] operator[SEP] operator[SEP] operator[SEP] identifier[getJsonFactory] operator[SEP] operator[SEP] operator[SEP] identifier[createGenerator] operator[SEP] identifier[writer] operator[SEP] operator[SEP] identifier[writeNativeResponse] operator[SEP] identifier[resp] , identifier[gen] operator[SEP] operator[SEP]
}
|
public synchronized RPC<V> call() {
++_callCnt;
// completer will not be carried over to remote
// add it to the RPC call.
if(_dt.getCompleter() != null){
CountedCompleter cc = _dt.getCompleter();
assert cc instanceof H2OCountedCompleter;
boolean alreadyIn = false;
if(_fjtasks != null)
for( H2OCountedCompleter hcc : _fjtasks )
if( hcc == cc) alreadyIn = true;
if( !alreadyIn ) addCompleter((H2OCountedCompleter)cc);
_dt.setCompleter(null);
}
// If running on self, just submit to queues & do locally
if( _target==H2O.SELF ) {
assert _dt.getCompleter()==null;
_dt.setCompleter(new H2O.H2OCallback<DTask>() {
@Override public void callback(DTask dt){
assert dt==_dt;
synchronized(RPC.this) {
assert !_done; // F/J guarentees called once
_done = true;
RPC.this.notifyAll();
}
doAllCompletions();
}
@Override public boolean onExceptionalCompletion(Throwable ex, CountedCompleter dt){
assert dt==_dt;
synchronized(RPC.this) { // Might be called several times
if( _done ) return true; // Filter down to 1st exceptional completion
_dt.setException(ex);
_done = true; // must be set as the last thing before notify, the waiting thread can wake up any at any time!
RPC.this.notifyAll();
}
doAllCompletions();
return true;
}
});
H2O.submitTask(_dt);
return this;
}
// Keep a global record, for awhile
if( _target != null ) _target.taskPut(_tasknum,this);
try {
// We could be racing timeouts-vs-replies. Blow off timeout if we have an answer.
if( isDone() ) {
if( _target != null ) _target.taskRemove(_tasknum);
return this;
}
// Default strategy: (re)fire the packet and (re)start the timeout. We
// "count" exactly 1 failure: just whether or not we shipped via TCP ever
// once. After that we fearlessly (re)send UDP-sized packets until the
// server replies.
// Pack classloader/class & the instance data into the outgoing
// AutoBuffer. If it fits in a single UDP packet, ship it. If not,
// finish off the current AutoBuffer (which is now going TCP style), and
// make a new UDP-sized packet. On a re-send of a TCP-sized hunk, just
// send the basic UDP control packet.
if( !_sentTcp ) {
// Ship the UDP packet!
while( true ) { // Retry loop for broken TCP sends
AutoBuffer ab = new AutoBuffer(_target);
try {
ab.putTask(UDP.udp.exec,_tasknum).put1(CLIENT_UDP_SEND).put(_dt);
boolean t = ab.hasTCP();
assert sz_check(ab) : "Resend of "+_dt.getClass()+" changes size from "+_size+" to "+ab.size()+" for task#"+_tasknum;
ab.close(); // Then close; send final byte
_sentTcp = t; // Set after close (and any other possible fail)
break; // Break out of retry loop
} catch( AutoBuffer.AutoBufferException e ) {
Log.info_no_DKV(Log.Tag.Sys.WATER, "IOException during RPC call: " + e._ioe.getMessage() + ", AB=" + ab + ", for task#" + _tasknum + ", waiting and retrying...");
ab.drainClose();
try { Thread.sleep(500); } catch (InterruptedException ignore) {}
}
} // end of while(true)
} else {
// Else it was sent via TCP in a prior attempt, and we've timed out.
// This means the caller's ACK/answer probably got dropped and we need
// him to resend it (or else the caller is still processing our
// request). Send a UDP reminder - but with the CLIENT_TCP_SEND flag
// instead of the UDP send, and no DTask (since it previously went via
// TCP, no need to resend it).
AutoBuffer ab = new AutoBuffer(_target).putTask(UDP.udp.exec,_tasknum);
ab.put1(CLIENT_TCP_SEND).close();
}
// Double retry until we exceed existing age. This is the time to delay
// until we try again. Note that we come here immediately on creation,
// so the first doubling happens before anybody does any waiting. Also
// note the generous 5sec cap: ping at least every 5 sec.
_retry += (_retry < 5000 ) ? _retry : 5000;
// Put self on the "TBD" list of tasks awaiting Timeout.
// So: dont really 'forget' but remember me in a little bit.
UDPTimeOutThread.PENDING.add(this);
return this;
} catch(Error t) {
throw Log.err(t);
}
}
|
class class_name[name] begin[{]
method[call, return_type[type[RPC]], modifier[synchronized public], parameter[]] begin[{]
member[._callCnt]
if[binary_operation[call[_dt.getCompleter, parameter[]], !=, literal[null]]] begin[{]
local_variable[type[CountedCompleter], cc]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=cc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=H2OCountedCompleter, sub_type=None), operator=instanceof), label=None, value=None)
local_variable[type[boolean], alreadyIn]
if[binary_operation[member[._fjtasks], !=, literal[null]]] begin[{]
ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=hcc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=alreadyIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)), control=EnhancedForControl(iterable=MemberReference(member=_fjtasks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hcc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=H2OCountedCompleter, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[member[.alreadyIn]] begin[{]
call[.addCompleter, parameter[Cast(expression=MemberReference(member=cc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=H2OCountedCompleter, sub_type=None))]]
else begin[{]
None
end[}]
call[_dt.setCompleter, parameter[literal[null]]]
else begin[{]
None
end[}]
if[binary_operation[member[._target], ==, member[H2O.SELF]]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCompleter, postfix_operators=[], prefix_operators=[], qualifier=_dt, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), label=None, value=None)
call[_dt.setCompleter, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=dt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_dt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None, value=None), SynchronizedStatement(block=[AssertStatement(condition=MemberReference(member=_done, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), label=None, value=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=RPC, selectors=[MethodInvocation(arguments=[], member=notifyAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=RPC, selectors=[])), StatementExpression(expression=MethodInvocation(arguments=[], member=doAllCompletions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=callback, parameters=[FormalParameter(annotations=[], modifiers=set(), name=dt, type=ReferenceType(arguments=None, dimensions=[], name=DTask, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=dt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_dt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None, value=None), SynchronizedStatement(block=[IfStatement(condition=MemberReference(member=_done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setException, postfix_operators=[], prefix_operators=[], qualifier=_dt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=RPC, selectors=[MethodInvocation(arguments=[], member=notifyAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=RPC, selectors=[])), StatementExpression(expression=MethodInvocation(arguments=[], member=doAllCompletions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], documentation=None, modifiers={'public'}, name=onExceptionalCompletion, parameters=[FormalParameter(annotations=[], modifiers=set(), name=ex, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=dt, type=ReferenceType(arguments=None, dimensions=[], name=CountedCompleter, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=H2O, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DTask, sub_type=None))], dimensions=None, name=H2OCallback, sub_type=None)))]]
call[H2O.submitTask, parameter[member[._dt]]]
return[THIS[]]
else begin[{]
None
end[}]
if[binary_operation[member[._target], !=, literal[null]]] begin[{]
call[_target.taskPut, parameter[member[._tasknum], THIS[]]]
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_tasknum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=taskRemove, postfix_operators=[], prefix_operators=[], qualifier=_target, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), label=None)])), IfStatement(condition=MemberReference(member=_sentTcp, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=_target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=UDP.udp, selectors=[]), MemberReference(member=_tasknum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putTask, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AutoBuffer, sub_type=None)), name=ab)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AutoBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLIENT_TCP_SEND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put1, postfix_operators=[], prefix_operators=[], qualifier=ab, selectors=[MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=_target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AutoBuffer, sub_type=None)), name=ab)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AutoBuffer, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=UDP.udp, selectors=[]), MemberReference(member=_tasknum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putTask, postfix_operators=[], prefix_operators=[], qualifier=ab, selectors=[MethodInvocation(arguments=[MemberReference(member=CLIENT_UDP_SEND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=_dt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=hasTCP, postfix_operators=[], prefix_operators=[], qualifier=ab, selectors=[], type_arguments=None), name=t)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), AssertStatement(condition=MethodInvocation(arguments=[MemberReference(member=ab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sz_check, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Resend of "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=_dt, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" changes size from "), operator=+), operandr=MemberReference(member=_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=ab, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for task#"), operator=+), operandr=MemberReference(member=_tasknum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=ab, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_sentTcp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WATER, postfix_operators=[], prefix_operators=[], qualifier=Log.Tag.Sys, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException during RPC call: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e._ioe, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", AB="), operator=+), operandr=MemberReference(member=ab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", for task#"), operator=+), operandr=MemberReference(member=_tasknum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", waiting and retrying..."), operator=+)], member=info_no_DKV, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=drainClose, postfix_operators=[], prefix_operators=[], qualifier=ab, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=500)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['InterruptedException']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AutoBuffer.AutoBufferException']))], finally_block=None, label=None, resources=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_retry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=_retry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5000), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5000), if_true=MemberReference(member=_retry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=UDPTimeOutThread.PENDING, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=err, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Error']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[synchronized] identifier[RPC] operator[<] identifier[V] operator[>] identifier[call] operator[SEP] operator[SEP] {
operator[++] identifier[_callCnt] operator[SEP] Keyword[if] operator[SEP] identifier[_dt] operator[SEP] identifier[getCompleter] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[CountedCompleter] identifier[cc] operator[=] identifier[_dt] operator[SEP] identifier[getCompleter] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[cc] Keyword[instanceof] identifier[H2OCountedCompleter] operator[SEP] Keyword[boolean] identifier[alreadyIn] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[_fjtasks] operator[!=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[H2OCountedCompleter] identifier[hcc] operator[:] identifier[_fjtasks] operator[SEP] Keyword[if] operator[SEP] identifier[hcc] operator[==] identifier[cc] operator[SEP] identifier[alreadyIn] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[alreadyIn] operator[SEP] identifier[addCompleter] operator[SEP] operator[SEP] identifier[H2OCountedCompleter] operator[SEP] identifier[cc] operator[SEP] operator[SEP] identifier[_dt] operator[SEP] identifier[setCompleter] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_target] operator[==] identifier[H2O] operator[SEP] identifier[SELF] operator[SEP] {
Keyword[assert] identifier[_dt] operator[SEP] identifier[getCompleter] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[_dt] operator[SEP] identifier[setCompleter] operator[SEP] Keyword[new] identifier[H2O] operator[SEP] identifier[H2OCallback] operator[<] identifier[DTask] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[callback] operator[SEP] identifier[DTask] identifier[dt] operator[SEP] {
Keyword[assert] identifier[dt] operator[==] identifier[_dt] operator[SEP] Keyword[synchronized] operator[SEP] identifier[RPC] operator[SEP] Keyword[this] operator[SEP] {
Keyword[assert] operator[!] identifier[_done] operator[SEP] identifier[_done] operator[=] literal[boolean] operator[SEP] identifier[RPC] operator[SEP] Keyword[this] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP]
}
identifier[doAllCompletions] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[onExceptionalCompletion] operator[SEP] identifier[Throwable] identifier[ex] , identifier[CountedCompleter] identifier[dt] operator[SEP] {
Keyword[assert] identifier[dt] operator[==] identifier[_dt] operator[SEP] Keyword[synchronized] operator[SEP] identifier[RPC] operator[SEP] Keyword[this] operator[SEP] {
Keyword[if] operator[SEP] identifier[_done] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[_dt] operator[SEP] identifier[setException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] identifier[_done] operator[=] literal[boolean] operator[SEP] identifier[RPC] operator[SEP] Keyword[this] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP]
}
identifier[doAllCompletions] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[H2O] operator[SEP] identifier[submitTask] operator[SEP] identifier[_dt] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_target] operator[!=] Other[null] operator[SEP] identifier[_target] operator[SEP] identifier[taskPut] operator[SEP] identifier[_tasknum] , Keyword[this] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[isDone] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[_target] operator[!=] Other[null] operator[SEP] identifier[_target] operator[SEP] identifier[taskRemove] operator[SEP] identifier[_tasknum] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[_sentTcp] operator[SEP] {
Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[AutoBuffer] identifier[ab] operator[=] Keyword[new] identifier[AutoBuffer] operator[SEP] identifier[_target] operator[SEP] operator[SEP] Keyword[try] {
identifier[ab] operator[SEP] identifier[putTask] operator[SEP] identifier[UDP] operator[SEP] identifier[udp] operator[SEP] identifier[exec] , identifier[_tasknum] operator[SEP] operator[SEP] identifier[put1] operator[SEP] identifier[CLIENT_UDP_SEND] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[_dt] operator[SEP] operator[SEP] Keyword[boolean] identifier[t] operator[=] identifier[ab] operator[SEP] identifier[hasTCP] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[sz_check] operator[SEP] identifier[ab] operator[SEP] operator[:] literal[String] operator[+] identifier[_dt] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[_size] operator[+] literal[String] operator[+] identifier[ab] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[_tasknum] operator[SEP] identifier[ab] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[_sentTcp] operator[=] identifier[t] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[AutoBuffer] operator[SEP] identifier[AutoBufferException] identifier[e] operator[SEP] {
identifier[Log] operator[SEP] identifier[info_no_DKV] operator[SEP] identifier[Log] operator[SEP] identifier[Tag] operator[SEP] identifier[Sys] operator[SEP] identifier[WATER] , literal[String] operator[+] identifier[e] operator[SEP] identifier[_ioe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[ab] operator[+] literal[String] operator[+] identifier[_tasknum] operator[+] literal[String] operator[SEP] operator[SEP] identifier[ab] operator[SEP] identifier[drainClose] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[500] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ignore] operator[SEP] {
}
}
}
}
Keyword[else] {
identifier[AutoBuffer] identifier[ab] operator[=] Keyword[new] identifier[AutoBuffer] operator[SEP] identifier[_target] operator[SEP] operator[SEP] identifier[putTask] operator[SEP] identifier[UDP] operator[SEP] identifier[udp] operator[SEP] identifier[exec] , identifier[_tasknum] operator[SEP] operator[SEP] identifier[ab] operator[SEP] identifier[put1] operator[SEP] identifier[CLIENT_TCP_SEND] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
identifier[_retry] operator[+=] operator[SEP] identifier[_retry] operator[<] Other[5000] operator[SEP] operator[?] identifier[_retry] operator[:] Other[5000] operator[SEP] identifier[UDPTimeOutThread] operator[SEP] identifier[PENDING] operator[SEP] identifier[add] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Error] identifier[t] operator[SEP] {
Keyword[throw] identifier[Log] operator[SEP] identifier[err] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
|
protected String getMultiGetQueryCacheQuery(EntityKey[] keys) {
int numberOfKeys = keys.length;
String query = multiGetQueryCache.get( numberOfKeys );
if ( query == null ) {
query = createMultiGetOnMultiplePropertiesId( numberOfKeys );
String cached = multiGetQueryCache.putIfAbsent( numberOfKeys, query );
if ( cached != null ) {
query = cached;
}
}
return query;
}
|
class class_name[name] begin[{]
method[getMultiGetQueryCacheQuery, return_type[type[String]], modifier[protected], parameter[keys]] begin[{]
local_variable[type[int], numberOfKeys]
local_variable[type[String], query]
if[binary_operation[member[.query], ==, literal[null]]] begin[{]
assign[member[.query], call[.createMultiGetOnMultiplePropertiesId, parameter[member[.numberOfKeys]]]]
local_variable[type[String], cached]
if[binary_operation[member[.cached], !=, literal[null]]] begin[{]
assign[member[.query], member[.cached]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.query]]
end[}]
END[}]
|
Keyword[protected] identifier[String] identifier[getMultiGetQueryCacheQuery] operator[SEP] identifier[EntityKey] operator[SEP] operator[SEP] identifier[keys] operator[SEP] {
Keyword[int] identifier[numberOfKeys] operator[=] identifier[keys] operator[SEP] identifier[length] operator[SEP] identifier[String] identifier[query] operator[=] identifier[multiGetQueryCache] operator[SEP] identifier[get] operator[SEP] identifier[numberOfKeys] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[query] operator[==] Other[null] operator[SEP] {
identifier[query] operator[=] identifier[createMultiGetOnMultiplePropertiesId] operator[SEP] identifier[numberOfKeys] operator[SEP] operator[SEP] identifier[String] identifier[cached] operator[=] identifier[multiGetQueryCache] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[numberOfKeys] , identifier[query] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cached] operator[!=] Other[null] operator[SEP] {
identifier[query] operator[=] identifier[cached] operator[SEP]
}
}
Keyword[return] identifier[query] operator[SEP]
}
|
private void add_snake_case_properties(List<PropertyDescriptor> pdl) throws IntrospectionException {
List<PropertyDescriptor> alternatives = new ArrayList<PropertyDescriptor>();
for (PropertyDescriptor descriptor : pdl) {
String camelCase = descriptor.getName();
if (camelCase.equals("rendererType")) {
continue;
}
if (camelCase.equals("localValueSet")) {
continue;
}
if (camelCase.equals("submittedValue")) {
continue;
}
String snake_case = BsfUtils.camelCaseToSnakeCase(camelCase);
if (snake_case != camelCase) { // in this particular case, we don't
// need to use equals!
if (descriptor.getReadMethod() != null && descriptor.getWriteMethod() != null) {
String getter = descriptor.getReadMethod().getName();
String setter = descriptor.getWriteMethod().getName();
if (UIComponent.class != descriptor.getReadMethod().getDeclaringClass()) {
PropertyDescriptor alternative = new PropertyDescriptor(snake_case, getDecoratedClass(), getter,
setter);
alternative.setBound(true);
alternatives.add(alternative);
// more alternatives
if (camelCase.equals("styleClass")) {
alternative = new PropertyDescriptor("class", getDecoratedClass(), getter, setter);
alternative.setBound(true);
alternatives.add(alternative);
}
}
}
}
}
if (alternatives.size() > 0) {
pdl.addAll(alternatives);
}
}
|
class class_name[name] begin[{]
method[add_snake_case_properties, return_type[void], modifier[private], parameter[pdl]] begin[{]
local_variable[type[List], alternatives]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), name=camelCase)], 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="rendererType")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=camelCase, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="localValueSet")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=camelCase, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="submittedValue")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=camelCase, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=camelCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=camelCaseToSnakeCase, postfix_operators=[], prefix_operators=[], qualifier=BsfUtils, selectors=[], type_arguments=None), name=snake_case)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=snake_case, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=camelCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getReadMethod, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getReadMethod, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=getter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=setter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UIComponent, sub_type=None)), operandr=MethodInvocation(arguments=[], member=getReadMethod, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[MethodInvocation(arguments=[], member=getDeclaringClass, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=snake_case, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDecoratedClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=getter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=setter, 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=PropertyDescriptor, sub_type=None)), name=alternative)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setBound, postfix_operators=[], prefix_operators=[], qualifier=alternative, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=alternative, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=alternatives, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="styleClass")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=camelCase, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alternative, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class"), MethodInvocation(arguments=[], member=getDecoratedClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=getter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=setter, 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=PropertyDescriptor, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setBound, postfix_operators=[], prefix_operators=[], qualifier=alternative, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=alternative, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=alternatives, selectors=[], type_arguments=None), label=None)]))]))]))]))]), control=EnhancedForControl(iterable=MemberReference(member=pdl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=descriptor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))), label=None)
if[binary_operation[call[alternatives.size, parameter[]], >, literal[0]]] begin[{]
call[pdl.addAll, parameter[member[.alternatives]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[add_snake_case_properties] operator[SEP] identifier[List] operator[<] identifier[PropertyDescriptor] operator[>] identifier[pdl] operator[SEP] Keyword[throws] identifier[IntrospectionException] {
identifier[List] operator[<] identifier[PropertyDescriptor] operator[>] identifier[alternatives] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[PropertyDescriptor] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyDescriptor] identifier[descriptor] operator[:] identifier[pdl] operator[SEP] {
identifier[String] identifier[camelCase] operator[=] identifier[descriptor] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[camelCase] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[camelCase] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[camelCase] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] identifier[snake_case] operator[=] identifier[BsfUtils] operator[SEP] identifier[camelCaseToSnakeCase] operator[SEP] identifier[camelCase] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[snake_case] operator[!=] identifier[camelCase] operator[SEP] {
Keyword[if] operator[SEP] identifier[descriptor] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[descriptor] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[getter] operator[=] identifier[descriptor] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[setter] operator[=] identifier[descriptor] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[UIComponent] operator[SEP] Keyword[class] operator[!=] identifier[descriptor] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] {
identifier[PropertyDescriptor] identifier[alternative] operator[=] Keyword[new] identifier[PropertyDescriptor] operator[SEP] identifier[snake_case] , identifier[getDecoratedClass] operator[SEP] operator[SEP] , identifier[getter] , identifier[setter] operator[SEP] operator[SEP] identifier[alternative] operator[SEP] identifier[setBound] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[alternatives] operator[SEP] identifier[add] operator[SEP] identifier[alternative] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[camelCase] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[alternative] operator[=] Keyword[new] identifier[PropertyDescriptor] operator[SEP] literal[String] , identifier[getDecoratedClass] operator[SEP] operator[SEP] , identifier[getter] , identifier[setter] operator[SEP] operator[SEP] identifier[alternative] operator[SEP] identifier[setBound] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[alternatives] operator[SEP] identifier[add] operator[SEP] identifier[alternative] operator[SEP] operator[SEP]
}
}
}
}
}
Keyword[if] operator[SEP] identifier[alternatives] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[pdl] operator[SEP] identifier[addAll] operator[SEP] identifier[alternatives] operator[SEP] operator[SEP]
}
}
|
public static SimpleFeatureCollection readShapefile( String path ) throws IOException {
OmsShapefileFeatureReader reader = new OmsShapefileFeatureReader();
reader.file = path;
reader.readFeatureCollection();
return reader.geodata;
}
|
class class_name[name] begin[{]
method[readShapefile, return_type[type[SimpleFeatureCollection]], modifier[public static], parameter[path]] begin[{]
local_variable[type[OmsShapefileFeatureReader], reader]
assign[member[reader.file], member[.path]]
call[reader.readFeatureCollection, parameter[]]
return[member[reader.geodata]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[SimpleFeatureCollection] identifier[readShapefile] operator[SEP] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[OmsShapefileFeatureReader] identifier[reader] operator[=] Keyword[new] identifier[OmsShapefileFeatureReader] operator[SEP] operator[SEP] operator[SEP] identifier[reader] operator[SEP] identifier[file] operator[=] identifier[path] operator[SEP] identifier[reader] operator[SEP] identifier[readFeatureCollection] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[reader] operator[SEP] identifier[geodata] operator[SEP]
}
|
@Override
public Pair<byte[][], byte[][]> getStartEndKeys() throws IOException {
List<HRegionLocation> regions = getAllRegionLocations();
byte[][] startKeys = new byte[regions.size()][];
byte[][] endKeys = new byte[regions.size()][];
int i = 0;
for(HRegionLocation region : regions) {
startKeys[i] = region.getRegionInfo().getStartKey();
endKeys[i] = region.getRegionInfo().getEndKey();
i++;
}
return Pair.newPair(startKeys, endKeys);
}
|
class class_name[name] begin[{]
method[getStartEndKeys, return_type[type[Pair]], modifier[public], parameter[]] begin[{]
local_variable[type[List], regions]
local_variable[type[byte], startKeys]
local_variable[type[byte], endKeys]
local_variable[type[int], i]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=startKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getRegionInfo, postfix_operators=[], prefix_operators=[], qualifier=region, selectors=[MethodInvocation(arguments=[], member=getStartKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=endKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getRegionInfo, postfix_operators=[], prefix_operators=[], qualifier=region, selectors=[MethodInvocation(arguments=[], member=getEndKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=regions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=region)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HRegionLocation, sub_type=None))), label=None)
return[call[Pair.newPair, parameter[member[.startKeys], member[.endKeys]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Pair] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[>] identifier[getStartEndKeys] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[List] operator[<] identifier[HRegionLocation] operator[>] identifier[regions] operator[=] identifier[getAllRegionLocations] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[startKeys] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[regions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[endKeys] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[regions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[HRegionLocation] identifier[region] operator[:] identifier[regions] operator[SEP] {
identifier[startKeys] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[region] operator[SEP] identifier[getRegionInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getStartKey] operator[SEP] operator[SEP] operator[SEP] identifier[endKeys] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[region] operator[SEP] identifier[getRegionInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getEndKey] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP]
}
Keyword[return] identifier[Pair] operator[SEP] identifier[newPair] operator[SEP] identifier[startKeys] , identifier[endKeys] operator[SEP] operator[SEP]
}
|
public void addScreenComponent(Container parent, Converter fieldInfo, JComponent component)
{
String strName = fieldInfo.getFieldName(); // Almost always
if (strName != null)
component.setName(strName);
component.addFocusListener(this);
// todo(don) Note: I never remove this focus listener.
this.setComponentConstraints(component);
parent.add(component);
fieldInfo.addComponent(component);
}
|
class class_name[name] begin[{]
method[addScreenComponent, return_type[void], modifier[public], parameter[parent, fieldInfo, component]] begin[{]
local_variable[type[String], strName]
if[binary_operation[member[.strName], !=, literal[null]]] begin[{]
call[component.setName, parameter[member[.strName]]]
else begin[{]
None
end[}]
call[component.addFocusListener, parameter[THIS[]]]
THIS[call[None.setComponentConstraints, parameter[member[.component]]]]
call[parent.add, parameter[member[.component]]]
call[fieldInfo.addComponent, parameter[member[.component]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addScreenComponent] operator[SEP] identifier[Container] identifier[parent] , identifier[Converter] identifier[fieldInfo] , identifier[JComponent] identifier[component] operator[SEP] {
identifier[String] identifier[strName] operator[=] identifier[fieldInfo] operator[SEP] identifier[getFieldName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strName] operator[!=] Other[null] operator[SEP] identifier[component] operator[SEP] identifier[setName] operator[SEP] identifier[strName] operator[SEP] operator[SEP] identifier[component] operator[SEP] identifier[addFocusListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setComponentConstraints] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[add] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[fieldInfo] operator[SEP] identifier[addComponent] operator[SEP] identifier[component] operator[SEP] operator[SEP]
}
|
public static String encipher(String key, String clearText) {
if (key == null) {
throw new NullPointerException("key may not be null");
}
if (key == "") {
return clearText;
}
if (clearText == null) {
return null;
}
byte[] keyBytes = convertKeyToByteArray(key);
byte[] clearTextBytes = convertClearTextToByteArray(clearText);
byte[] cipherBytes = applyCipher(keyBytes, clearTextBytes);
return Base64.encodeToString(cipherBytes);
}
|
class class_name[name] begin[{]
method[encipher, return_type[type[String]], modifier[public static], parameter[key, clearText]] begin[{]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="key may not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.key], ==, literal[""]]] begin[{]
return[member[.clearText]]
else begin[{]
None
end[}]
if[binary_operation[member[.clearText], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[byte], keyBytes]
local_variable[type[byte], clearTextBytes]
local_variable[type[byte], cipherBytes]
return[call[Base64.encodeToString, parameter[member[.cipherBytes]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[encipher] operator[SEP] identifier[String] identifier[key] , identifier[String] identifier[clearText] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[==] literal[String] operator[SEP] {
Keyword[return] identifier[clearText] operator[SEP]
}
Keyword[if] operator[SEP] identifier[clearText] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[keyBytes] operator[=] identifier[convertKeyToByteArray] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[clearTextBytes] operator[=] identifier[convertClearTextToByteArray] operator[SEP] identifier[clearText] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[cipherBytes] operator[=] identifier[applyCipher] operator[SEP] identifier[keyBytes] , identifier[clearTextBytes] operator[SEP] operator[SEP] Keyword[return] identifier[Base64] operator[SEP] identifier[encodeToString] operator[SEP] identifier[cipherBytes] operator[SEP] operator[SEP]
}
|
public void accept(final TokenType tokenType) {
if (lexer.getCurrentToken().getType() != tokenType) {
throw new SQLParsingException(lexer, tokenType);
}
lexer.nextToken();
}
|
class class_name[name] begin[{]
method[accept, return_type[void], modifier[public], parameter[tokenType]] begin[{]
if[binary_operation[call[lexer.getCurrentToken, parameter[]], !=, member[.tokenType]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=lexer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tokenType, 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=SQLParsingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[lexer.nextToken, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[accept] operator[SEP] Keyword[final] identifier[TokenType] identifier[tokenType] operator[SEP] {
Keyword[if] operator[SEP] identifier[lexer] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[!=] identifier[tokenType] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SQLParsingException] operator[SEP] identifier[lexer] , identifier[tokenType] operator[SEP] operator[SEP]
}
identifier[lexer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP]
}
|
public void debug(String message) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.debug(pluginId, loggerName, message);
}
|
class class_name[name] begin[{]
method[debug, return_type[void], modifier[public], parameter[message]] begin[{]
if[binary_operation[member[.loggingService], ==, literal[null]]] begin[{]
call[System.out.println, parameter[member[.message]]]
return[None]
else begin[{]
None
end[}]
call[loggingService.debug, parameter[member[.pluginId], member[.loggerName], member[.message]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[debug] operator[SEP] identifier[String] identifier[message] operator[SEP] {
Keyword[if] operator[SEP] identifier[loggingService] operator[==] Other[null] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[loggingService] operator[SEP] identifier[debug] operator[SEP] identifier[pluginId] , identifier[loggerName] , identifier[message] operator[SEP] operator[SEP]
}
|
public static ClickHandler chain (final ClickHandler... handlers)
{
return new ClickHandler() {
public void onClick (ClickEvent event) {
for (ClickHandler handler : handlers) {
try {
handler.onClick(event);
} catch (Exception e) {
Console.log("Chained click handler failed", "handler", handler, e);
}
}
}
};
}
|
class class_name[name] begin[{]
method[chain, return_type[type[ClickHandler]], modifier[public static], parameter[handlers]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onClick, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Chained click handler failed"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="handler"), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=Console, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=handlers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=handler)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClickHandler, sub_type=None))), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=ClickEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickHandler, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[ClickHandler] identifier[chain] operator[SEP] Keyword[final] identifier[ClickHandler] operator[...] identifier[handlers] operator[SEP] {
Keyword[return] Keyword[new] identifier[ClickHandler] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[ClickEvent] identifier[event] operator[SEP] {
Keyword[for] operator[SEP] identifier[ClickHandler] identifier[handler] operator[:] identifier[handlers] operator[SEP] {
Keyword[try] {
identifier[handler] operator[SEP] identifier[onClick] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[Console] operator[SEP] identifier[log] operator[SEP] literal[String] , literal[String] , identifier[handler] , identifier[e] operator[SEP] operator[SEP]
}
}
}
} operator[SEP]
}
|
public UpdateRouteRequest withRequestModels(java.util.Map<String, String> requestModels) {
setRequestModels(requestModels);
return this;
}
|
class class_name[name] begin[{]
method[withRequestModels, return_type[type[UpdateRouteRequest]], modifier[public], parameter[requestModels]] begin[{]
call[.setRequestModels, parameter[member[.requestModels]]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[UpdateRouteRequest] identifier[withRequestModels] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[requestModels] operator[SEP] {
identifier[setRequestModels] operator[SEP] identifier[requestModels] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static StringBuilder elapsedAndSize(long startTimeNanos, long endTimeNanos, long size) {
final StringBuilder buf = new StringBuilder(16);
appendElapsedAndSize(buf, startTimeNanos, endTimeNanos, size);
return buf;
}
|
class class_name[name] begin[{]
method[elapsedAndSize, return_type[type[StringBuilder]], modifier[public static], parameter[startTimeNanos, endTimeNanos, size]] begin[{]
local_variable[type[StringBuilder], buf]
call[.appendElapsedAndSize, parameter[member[.buf], member[.startTimeNanos], member[.endTimeNanos], member[.size]]]
return[member[.buf]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[StringBuilder] identifier[elapsedAndSize] operator[SEP] Keyword[long] identifier[startTimeNanos] , Keyword[long] identifier[endTimeNanos] , Keyword[long] identifier[size] operator[SEP] {
Keyword[final] identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[16] operator[SEP] operator[SEP] identifier[appendElapsedAndSize] operator[SEP] identifier[buf] , identifier[startTimeNanos] , identifier[endTimeNanos] , identifier[size] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP]
}
|
public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body();
}
|
class class_name[name] begin[{]
method[start, return_type[void], modifier[public], parameter[resourceGroupName, networkWatcherName, connectionMonitorName]] begin[{]
call[.startWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.networkWatcherName], member[.connectionMonitorName]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[start] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[networkWatcherName] , identifier[String] identifier[connectionMonitorName] operator[SEP] {
identifier[startWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[networkWatcherName] , identifier[connectionMonitorName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public PBKey getPBKey()
{
if (pbKey == null)
{
log.error("## PBKey not set, Database isOpen=" + isOpen + " ##");
if (!isOpen) throw new DatabaseClosedException("Database is not open");
}
return pbKey;
}
|
class class_name[name] begin[{]
method[getPBKey, return_type[type[PBKey]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.pbKey], ==, literal[null]]] begin[{]
call[log.error, parameter[binary_operation[binary_operation[literal["## PBKey not set, Database isOpen="], +, member[.isOpen]], +, literal[" ##"]]]]
if[member[.isOpen]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Database is not open")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseClosedException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.pbKey]]
end[}]
END[}]
|
Keyword[public] identifier[PBKey] identifier[getPBKey] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[pbKey] operator[==] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[isOpen] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isOpen] operator[SEP] Keyword[throw] Keyword[new] identifier[DatabaseClosedException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[pbKey] operator[SEP]
}
|
public static Matcher matcher(
Pattern pattern,
CharSequence charSequence,
long timeoutInMilliseconds
) {
// Substitute in our exploding CharSequence implementation.
if (!(charSequence instanceof TimeLimitedCharSequence)) {
charSequence = new TimeLimitedCharSequence(
charSequence,
timeoutInMilliseconds,
pattern,
charSequence
);
}
return pattern.matcher(charSequence);
}
|
class class_name[name] begin[{]
method[matcher, return_type[type[Matcher]], modifier[public static], parameter[pattern, charSequence, timeoutInMilliseconds]] begin[{]
if[binary_operation[member[.charSequence], instanceof, type[TimeLimitedCharSequence]]] begin[{]
assign[member[.charSequence], ClassCreator(arguments=[MemberReference(member=charSequence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeoutInMilliseconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charSequence, 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=TimeLimitedCharSequence, sub_type=None))]
else begin[{]
None
end[}]
return[call[pattern.matcher, parameter[member[.charSequence]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Matcher] identifier[matcher] operator[SEP] identifier[Pattern] identifier[pattern] , identifier[CharSequence] identifier[charSequence] , Keyword[long] identifier[timeoutInMilliseconds] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[charSequence] Keyword[instanceof] identifier[TimeLimitedCharSequence] operator[SEP] operator[SEP] {
identifier[charSequence] operator[=] Keyword[new] identifier[TimeLimitedCharSequence] operator[SEP] identifier[charSequence] , identifier[timeoutInMilliseconds] , identifier[pattern] , identifier[charSequence] operator[SEP] operator[SEP]
}
Keyword[return] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[charSequence] operator[SEP] operator[SEP]
}
|
public BrowseCursor getBrowseCursor(SelectionCriteria criteria) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getBrowseCursor", criteria);
SibTr.exit(tc, "getBrowseCursor");
}
return _aih.newBrowseCursor(criteria);
}
|
class class_name[name] begin[{]
method[getBrowseCursor, return_type[type[BrowseCursor]], modifier[public], parameter[criteria]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["getBrowseCursor"], member[.criteria]]]
call[SibTr.exit, parameter[member[.tc], literal["getBrowseCursor"]]]
else begin[{]
None
end[}]
return[call[_aih.newBrowseCursor, parameter[member[.criteria]]]]
end[}]
END[}]
|
Keyword[public] identifier[BrowseCursor] identifier[getBrowseCursor] operator[SEP] identifier[SelectionCriteria] identifier[criteria] operator[SEP] Keyword[throws] identifier[SIResourceException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[criteria] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[_aih] operator[SEP] identifier[newBrowseCursor] operator[SEP] identifier[criteria] operator[SEP] operator[SEP]
}
|
public ArrayList getConsumerListForExpression(
String topicExpression,
boolean selector,
boolean isWildcarded)
{
if (tc.isEntryEnabled())
SibTr.entry(tc,
"getConsumerListForExpression",
new Object[]{topicExpression,
new Boolean(selector),
new Boolean(isWildcarded)});
ArrayList consumerList = null;
if(selector)
{
if(isWildcarded)
{
// Selector and wildcarded
consumerList = (ArrayList)_wildcardSelectorSubs.get(topicExpression);
}
else
{
// Selector but not wildcarded
consumerList = (ArrayList)_exactSelectorSubs.get(topicExpression);
}
}
else
{
// No Selector expression
if(isWildcarded)
{
// No selector and wildcarded
consumerList = (ArrayList)_wildcardNonSelectorSubs.get(topicExpression);
}
else
{
// No selector and not wildcarded
consumerList = (ArrayList)_exactNonSelectorSubs.get(topicExpression);
}
}
if (tc.isEntryEnabled()) SibTr.exit(tc, "getConsumerListForExpression", consumerList);
return consumerList;
}
|
class class_name[name] begin[{]
method[getConsumerListForExpression, return_type[type[ArrayList]], modifier[public], parameter[topicExpression, selector, isWildcarded]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["getConsumerListForExpression"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=topicExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=selector, 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=Boolean, sub_type=None)), ClassCreator(arguments=[MemberReference(member=isWildcarded, 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=Boolean, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[ArrayList], consumerList]
if[member[.selector]] begin[{]
if[member[.isWildcarded]] begin[{]
assign[member[.consumerList], Cast(expression=MethodInvocation(arguments=[MemberReference(member=topicExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_wildcardSelectorSubs, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ArrayList, sub_type=None))]
else begin[{]
assign[member[.consumerList], Cast(expression=MethodInvocation(arguments=[MemberReference(member=topicExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_exactSelectorSubs, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ArrayList, sub_type=None))]
end[}]
else begin[{]
if[member[.isWildcarded]] begin[{]
assign[member[.consumerList], Cast(expression=MethodInvocation(arguments=[MemberReference(member=topicExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_wildcardNonSelectorSubs, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ArrayList, sub_type=None))]
else begin[{]
assign[member[.consumerList], Cast(expression=MethodInvocation(arguments=[MemberReference(member=topicExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_exactNonSelectorSubs, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ArrayList, sub_type=None))]
end[}]
end[}]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["getConsumerListForExpression"], member[.consumerList]]]
else begin[{]
None
end[}]
return[member[.consumerList]]
end[}]
END[}]
|
Keyword[public] identifier[ArrayList] identifier[getConsumerListForExpression] operator[SEP] identifier[String] identifier[topicExpression] , Keyword[boolean] identifier[selector] , Keyword[boolean] identifier[isWildcarded] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[topicExpression] , Keyword[new] identifier[Boolean] operator[SEP] identifier[selector] operator[SEP] , Keyword[new] identifier[Boolean] operator[SEP] identifier[isWildcarded] operator[SEP]
} operator[SEP] operator[SEP] identifier[ArrayList] identifier[consumerList] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[selector] operator[SEP] {
Keyword[if] operator[SEP] identifier[isWildcarded] operator[SEP] {
identifier[consumerList] operator[=] operator[SEP] identifier[ArrayList] operator[SEP] identifier[_wildcardSelectorSubs] operator[SEP] identifier[get] operator[SEP] identifier[topicExpression] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[consumerList] operator[=] operator[SEP] identifier[ArrayList] operator[SEP] identifier[_exactSelectorSubs] operator[SEP] identifier[get] operator[SEP] identifier[topicExpression] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[isWildcarded] operator[SEP] {
identifier[consumerList] operator[=] operator[SEP] identifier[ArrayList] operator[SEP] identifier[_wildcardNonSelectorSubs] operator[SEP] identifier[get] operator[SEP] identifier[topicExpression] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[consumerList] operator[=] operator[SEP] identifier[ArrayList] operator[SEP] identifier[_exactNonSelectorSubs] operator[SEP] identifier[get] operator[SEP] identifier[topicExpression] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] 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[consumerList] operator[SEP] operator[SEP] Keyword[return] identifier[consumerList] operator[SEP]
}
|
private boolean isHibernateExtendedBeanManagerSupported() {
try {
Class.forName(HIBERNATE_EXTENDED_BEANMANAGER);
return true;
} catch (ClassNotFoundException ignore) {
return false;
} catch (NoClassDefFoundError ignore) {
return false;
}
}
|
class class_name[name] begin[{]
method[isHibernateExtendedBeanManagerSupported, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=HIBERNATE_EXTENDED_BEANMANAGER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['ClassNotFoundException'])), CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['NoClassDefFoundError']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[private] Keyword[boolean] identifier[isHibernateExtendedBeanManagerSupported] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[HIBERNATE_EXTENDED_BEANMANAGER] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[ignore] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoClassDefFoundError] identifier[ignore] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
|
public void connectToPredecessors(Map<IntermediateDataSetID, IntermediateResult> intermediateDataSets) throws JobException {
List<JobEdge> inputs = jobVertex.getInputs();
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Connecting ExecutionJobVertex %s (%s) to %d predecessors.", jobVertex.getID(), jobVertex.getName(), inputs.size()));
}
for (int num = 0; num < inputs.size(); num++) {
JobEdge edge = inputs.get(num);
if (LOG.isDebugEnabled()) {
if (edge.getSource() == null) {
LOG.debug(String.format("Connecting input %d of vertex %s (%s) to intermediate result referenced via ID %s.",
num, jobVertex.getID(), jobVertex.getName(), edge.getSourceId()));
} else {
LOG.debug(String.format("Connecting input %d of vertex %s (%s) to intermediate result referenced via predecessor %s (%s).",
num, jobVertex.getID(), jobVertex.getName(), edge.getSource().getProducer().getID(), edge.getSource().getProducer().getName()));
}
}
// fetch the intermediate result via ID. if it does not exist, then it either has not been created, or the order
// in which this method is called for the job vertices is not a topological order
IntermediateResult ires = intermediateDataSets.get(edge.getSourceId());
if (ires == null) {
throw new JobException("Cannot connect this job graph to the previous graph. No previous intermediate result found for ID "
+ edge.getSourceId());
}
this.inputs.add(ires);
int consumerIndex = ires.registerConsumer();
for (int i = 0; i < parallelism; i++) {
ExecutionVertex ev = taskVertices[i];
ev.connectSource(num, ires, edge, consumerIndex);
}
}
}
|
class class_name[name] begin[{]
method[connectToPredecessors, return_type[void], modifier[public], parameter[intermediateDataSets]] begin[{]
local_variable[type[List], inputs]
if[call[LOG.isDebugEnabled, parameter[]]] begin[{]
call[LOG.debug, parameter[call[String.format, parameter[literal["Connecting ExecutionJobVertex %s (%s) to %d predecessors."], call[jobVertex.getID, parameter[]], call[jobVertex.getName, parameter[]], call[inputs.size, parameter[]]]]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=inputs, selectors=[], type_arguments=None), name=edge)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JobEdge, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connecting input %d of vertex %s (%s) to intermediate result referenced via predecessor %s (%s)."), MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=jobVertex, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=jobVertex, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[MethodInvocation(arguments=[], member=getProducer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[MethodInvocation(arguments=[], member=getProducer, 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=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connecting input %d of vertex %s (%s) to intermediate result referenced via ID %s."), MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=jobVertex, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=jobVertex, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSourceId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSourceId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=intermediateDataSets, selectors=[], type_arguments=None), name=ires)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntermediateResult, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ires, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot connect this job graph to the previous graph. No previous intermediate result found for ID "), operandr=MethodInvocation(arguments=[], member=getSourceId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JobException, sub_type=None)), label=None)])), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=inputs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ires, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=registerConsumer, postfix_operators=[], prefix_operators=[], qualifier=ires, selectors=[], type_arguments=None), name=consumerIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=taskVertices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=ev)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExecutionVertex, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ires, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=edge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=consumerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=connectSource, postfix_operators=[], prefix_operators=[], qualifier=ev, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=parallelism, 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)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=inputs, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=num)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=num, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[connectToPredecessors] operator[SEP] identifier[Map] operator[<] identifier[IntermediateDataSetID] , identifier[IntermediateResult] operator[>] identifier[intermediateDataSets] operator[SEP] Keyword[throws] identifier[JobException] {
identifier[List] operator[<] identifier[JobEdge] operator[>] identifier[inputs] operator[=] identifier[jobVertex] operator[SEP] identifier[getInputs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[jobVertex] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[jobVertex] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[inputs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[num] operator[=] Other[0] operator[SEP] identifier[num] operator[<] identifier[inputs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[num] operator[++] operator[SEP] {
identifier[JobEdge] identifier[edge] operator[=] identifier[inputs] operator[SEP] identifier[get] operator[SEP] identifier[num] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[edge] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[num] , identifier[jobVertex] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[jobVertex] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[edge] operator[SEP] identifier[getSourceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[num] , identifier[jobVertex] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[jobVertex] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[edge] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] identifier[getProducer] operator[SEP] operator[SEP] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[edge] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] identifier[getProducer] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[IntermediateResult] identifier[ires] operator[=] identifier[intermediateDataSets] operator[SEP] identifier[get] operator[SEP] identifier[edge] operator[SEP] identifier[getSourceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ires] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JobException] operator[SEP] literal[String] operator[+] identifier[edge] operator[SEP] identifier[getSourceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[inputs] operator[SEP] identifier[add] operator[SEP] identifier[ires] operator[SEP] operator[SEP] Keyword[int] identifier[consumerIndex] operator[=] identifier[ires] operator[SEP] identifier[registerConsumer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parallelism] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[ExecutionVertex] identifier[ev] operator[=] identifier[taskVertices] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ev] operator[SEP] identifier[connectSource] operator[SEP] identifier[num] , identifier[ires] , identifier[edge] , identifier[consumerIndex] operator[SEP] operator[SEP]
}
}
}
|
private VoltTable runQuery(String description, String SQL) throws Exception {
System.out.println(description);
ClientResponse resp = client.callProcedure("@AdHoc", SQL);
System.out.println("SQL query: " + SQL);
System.out.println();
VoltTable table = resp.getResults()[0];
System.out.println(table.toFormattedString());
System.out.println();
return table;
}
|
class class_name[name] begin[{]
method[runQuery, return_type[type[VoltTable]], modifier[private], parameter[description, SQL]] begin[{]
call[System.out.println, parameter[member[.description]]]
local_variable[type[ClientResponse], resp]
call[System.out.println, parameter[binary_operation[literal["SQL query: "], +, member[.SQL]]]]
call[System.out.println, parameter[]]
local_variable[type[VoltTable], table]
call[System.out.println, parameter[call[table.toFormattedString, parameter[]]]]
call[System.out.println, parameter[]]
return[member[.table]]
end[}]
END[}]
|
Keyword[private] identifier[VoltTable] identifier[runQuery] operator[SEP] identifier[String] identifier[description] , identifier[String] identifier[SQL] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[description] operator[SEP] operator[SEP] identifier[ClientResponse] identifier[resp] operator[=] identifier[client] operator[SEP] identifier[callProcedure] operator[SEP] literal[String] , identifier[SQL] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[SQL] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] identifier[VoltTable] identifier[table] operator[=] identifier[resp] operator[SEP] identifier[getResults] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[table] operator[SEP] identifier[toFormattedString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[table] operator[SEP]
}
|
public Array readWithCE(ucar.nc2.Variable v, String CE) throws IOException
{
Array dataArray;
try {
DataDDS dataDDS = readDataDDSfromServer(CE);
DodsV root = DodsV.parseDataDDS(dataDDS);
DodsV want = root.children.get(0); // can only be one
if (v.isMemberOfStructure())
dataArray = convertD2N.convertNestedVariable(v, null, want, true);
else
dataArray = convertD2N.convertTopVariable(v, null, want);
} catch (DAP2Exception ex) {
ex.printStackTrace();
throw new IOException(ex.getMessage());
} catch (ParseException ex) {
ex.printStackTrace();
throw new IOException(ex.getMessage());
}
return dataArray;
}
|
class class_name[name] begin[{]
method[readWithCE, return_type[type[Array]], modifier[public], parameter[v, CE]] begin[{]
local_variable[type[Array], dataArray]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=CE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readDataDDSfromServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=dataDDS)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataDDS, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dataDDS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseDataDDS, postfix_operators=[], prefix_operators=[], qualifier=DodsV, selectors=[], type_arguments=None), name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DodsV, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=root.children, selectors=[], type_arguments=None), name=want)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DodsV, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isMemberOfStructure, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=want, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertTopVariable, postfix_operators=[], prefix_operators=[], qualifier=convertD2N, selectors=[], type_arguments=None)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=want, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=convertNestedVariable, postfix_operators=[], prefix_operators=[], qualifier=convertD2N, selectors=[], type_arguments=None)), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['DAP2Exception'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['ParseException']))], finally_block=None, label=None, resources=None)
return[member[.dataArray]]
end[}]
END[}]
|
Keyword[public] identifier[Array] identifier[readWithCE] operator[SEP] identifier[ucar] operator[SEP] identifier[nc2] operator[SEP] identifier[Variable] identifier[v] , identifier[String] identifier[CE] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Array] identifier[dataArray] operator[SEP] Keyword[try] {
identifier[DataDDS] identifier[dataDDS] operator[=] identifier[readDataDDSfromServer] operator[SEP] identifier[CE] operator[SEP] operator[SEP] identifier[DodsV] identifier[root] operator[=] identifier[DodsV] operator[SEP] identifier[parseDataDDS] operator[SEP] identifier[dataDDS] operator[SEP] operator[SEP] identifier[DodsV] identifier[want] operator[=] identifier[root] operator[SEP] identifier[children] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[SEP] identifier[isMemberOfStructure] operator[SEP] operator[SEP] operator[SEP] identifier[dataArray] operator[=] identifier[convertD2N] operator[SEP] identifier[convertNestedVariable] operator[SEP] identifier[v] , Other[null] , identifier[want] , literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[dataArray] operator[=] identifier[convertD2N] operator[SEP] identifier[convertTopVariable] operator[SEP] identifier[v] , Other[null] , identifier[want] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DAP2Exception] identifier[ex] operator[SEP] {
identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[ex] operator[SEP] {
identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[dataArray] operator[SEP]
}
|
public final double getDouble() {
if (count == 0) {
return 0.0;
}
StringBuffer temp = getStringBuffer();
temp.append('.');
temp.append(digits, 0, count);
temp.append('E');
temp.append(decimalAt);
return Double.parseDouble(temp.toString());
}
|
class class_name[name] begin[{]
method[getDouble, return_type[type[double]], modifier[final public], parameter[]] begin[{]
if[binary_operation[member[.count], ==, literal[0]]] begin[{]
return[literal[0.0]]
else begin[{]
None
end[}]
local_variable[type[StringBuffer], temp]
call[temp.append, parameter[literal['.']]]
call[temp.append, parameter[member[.digits], literal[0], member[.count]]]
call[temp.append, parameter[literal['E']]]
call[temp.append, parameter[member[.decimalAt]]]
return[call[Double.parseDouble, parameter[call[temp.toString, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[final] Keyword[double] identifier[getDouble] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[count] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[Float] operator[SEP]
}
identifier[StringBuffer] identifier[temp] operator[=] identifier[getStringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[append] operator[SEP] identifier[digits] , Other[0] , identifier[count] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[append] operator[SEP] identifier[decimalAt] operator[SEP] operator[SEP] Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[temp] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Class<?> tryLoadClass(String className) throws ClassNotFoundException {
try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
return contextClassLoader.loadClass(className);
}
}
|
class class_name[name] begin[{]
method[tryLoadClass, return_type[type[Class]], modifier[public static], parameter[className]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=getContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=contextClassLoader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=contextClassLoader, 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)
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[tryLoadClass] operator[SEP] identifier[String] identifier[className] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] {
Keyword[try] {
Keyword[return] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[className] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
identifier[ClassLoader] identifier[contextClassLoader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[contextClassLoader] operator[SEP] identifier[loadClass] operator[SEP] identifier[className] operator[SEP] operator[SEP]
}
}
|
public GetPresetResponse getPreset(String name) {
GetPresetRequest request = new GetPresetRequest();
request.setName(name);
return getPreset(request);
}
|
class class_name[name] begin[{]
method[getPreset, return_type[type[GetPresetResponse]], modifier[public], parameter[name]] begin[{]
local_variable[type[GetPresetRequest], request]
call[request.setName, parameter[member[.name]]]
return[call[.getPreset, parameter[member[.request]]]]
end[}]
END[}]
|
Keyword[public] identifier[GetPresetResponse] identifier[getPreset] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[GetPresetRequest] identifier[request] operator[=] Keyword[new] identifier[GetPresetRequest] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[getPreset] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void reset(){
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "reset");
streamIndex = 0;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "reset");
}
|
class class_name[name] begin[{]
method[reset, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["reset"]]]
else begin[{]
None
end[}]
assign[member[.streamIndex], literal[0]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["reset"]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[reset] 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[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[streamIndex] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public Status route(final CharSequence method, final CharSequence path, final Result<T> result) {
result.captor.optionalTrailingSlash(optionalTrailingSlash);
final RouteTarget<T> route = trie.lookup(path, result.captor);
if (route == null) {
return result.notFound().status();
}
final Target<T> target = route.lookup(method);
if (target == null) {
return result.notAllowed(route).status();
}
return result.success(path, route, target).status();
}
|
class class_name[name] begin[{]
method[route, return_type[type[Status]], modifier[public], parameter[method, path, result]] begin[{]
call[result.captor.optionalTrailingSlash, parameter[member[.optionalTrailingSlash]]]
local_variable[type[RouteTarget], route]
if[binary_operation[member[.route], ==, literal[null]]] begin[{]
return[call[result.notFound, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[Target], target]
if[binary_operation[member[.target], ==, literal[null]]] begin[{]
return[call[result.notAllowed, parameter[member[.route]]]]
else begin[{]
None
end[}]
return[call[result.success, parameter[member[.path], member[.route], member[.target]]]]
end[}]
END[}]
|
Keyword[public] identifier[Status] identifier[route] operator[SEP] Keyword[final] identifier[CharSequence] identifier[method] , Keyword[final] identifier[CharSequence] identifier[path] , Keyword[final] identifier[Result] operator[<] identifier[T] operator[>] identifier[result] operator[SEP] {
identifier[result] operator[SEP] identifier[captor] operator[SEP] identifier[optionalTrailingSlash] operator[SEP] identifier[optionalTrailingSlash] operator[SEP] operator[SEP] Keyword[final] identifier[RouteTarget] operator[<] identifier[T] operator[>] identifier[route] operator[=] identifier[trie] operator[SEP] identifier[lookup] operator[SEP] identifier[path] , identifier[result] operator[SEP] identifier[captor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[route] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[result] operator[SEP] identifier[notFound] operator[SEP] operator[SEP] operator[SEP] identifier[status] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[Target] operator[<] identifier[T] operator[>] identifier[target] operator[=] identifier[route] operator[SEP] identifier[lookup] operator[SEP] identifier[method] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[result] operator[SEP] identifier[notAllowed] operator[SEP] identifier[route] operator[SEP] operator[SEP] identifier[status] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP] identifier[success] operator[SEP] identifier[path] , identifier[route] , identifier[target] operator[SEP] operator[SEP] identifier[status] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Content getContent(String spaceId, String contentId, Long startByte, Long endByte)
throws ContentStoreException {
//validate args
if (startByte == null || startByte < 0) {
throw new IllegalArgumentException("startByte must be equal to or greater than zero.");
} else if (endByte != null && endByte <= startByte) {
throw new IllegalArgumentException("endByte must be null or greater than the startByte.");
}
return execute(() -> {
try {
final HttpResponse response = doGetContent(spaceId, contentId, startByte, endByte);
return toContent(response, spaceId, contentId, startByte, endByte);
} catch (IOException ex) {
throw new ContentStoreException(ex.getMessage(), ex);
}
});
}
|
class class_name[name] begin[{]
method[getContent, return_type[type[Content]], modifier[public], parameter[spaceId, contentId, startByte, endByte]] begin[{]
if[binary_operation[binary_operation[member[.startByte], ==, literal[null]], ||, binary_operation[member[.startByte], <, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="startByte must be equal to or greater than zero.")], 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[{]
if[binary_operation[binary_operation[member[.endByte], !=, literal[null]], &&, binary_operation[member[.endByte], <=, member[.startByte]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="endByte must be null or greater than the startByte.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
return[call[.execute, parameter[LambdaExpression(body=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doGetContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=response)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=HttpResponse, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), 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=ContentStoreException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None)], parameters=[])]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Content] identifier[getContent] operator[SEP] identifier[String] identifier[spaceId] , identifier[String] identifier[contentId] , identifier[Long] identifier[startByte] , identifier[Long] identifier[endByte] operator[SEP] Keyword[throws] identifier[ContentStoreException] {
Keyword[if] operator[SEP] identifier[startByte] operator[==] Other[null] operator[||] identifier[startByte] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[endByte] operator[!=] Other[null] operator[&&] identifier[endByte] operator[<=] identifier[startByte] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] {
Keyword[try] {
Keyword[final] identifier[HttpResponse] identifier[response] operator[=] identifier[doGetContent] operator[SEP] identifier[spaceId] , identifier[contentId] , identifier[startByte] , identifier[endByte] operator[SEP] operator[SEP] Keyword[return] identifier[toContent] operator[SEP] identifier[response] , identifier[spaceId] , identifier[contentId] , identifier[startByte] , identifier[endByte] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ContentStoreException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static void unwrap(File zip, final File outputDir) {
unwrap(zip, outputDir, IdentityNameMapper.INSTANCE);
}
|
class class_name[name] begin[{]
method[unwrap, return_type[void], modifier[public static], parameter[zip, outputDir]] begin[{]
call[.unwrap, parameter[member[.zip], member[.outputDir], member[IdentityNameMapper.INSTANCE]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[unwrap] operator[SEP] identifier[File] identifier[zip] , Keyword[final] identifier[File] identifier[outputDir] operator[SEP] {
identifier[unwrap] operator[SEP] identifier[zip] , identifier[outputDir] , identifier[IdentityNameMapper] operator[SEP] identifier[INSTANCE] operator[SEP] operator[SEP]
}
|
static public void encodeGeography(final FastSerializer fs, GeographyValue value)
throws IOException {
ByteBuffer bb = ByteBuffer.allocate(value.getLengthInBytes());
bb.order(ByteOrder.nativeOrder());
value.flattenToBuffer(bb);
byte[] array = bb.array();
fs.writeInt(array.length);
fs.write(array);
}
|
class class_name[name] begin[{]
method[encodeGeography, return_type[void], modifier[public static], parameter[fs, value]] begin[{]
local_variable[type[ByteBuffer], bb]
call[bb.order, parameter[call[ByteOrder.nativeOrder, parameter[]]]]
call[value.flattenToBuffer, parameter[member[.bb]]]
local_variable[type[byte], array]
call[fs.writeInt, parameter[member[array.length]]]
call[fs.write, parameter[member[.array]]]
end[}]
END[}]
|
Keyword[static] Keyword[public] Keyword[void] identifier[encodeGeography] operator[SEP] Keyword[final] identifier[FastSerializer] identifier[fs] , identifier[GeographyValue] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ByteBuffer] identifier[bb] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[value] operator[SEP] identifier[getLengthInBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bb] operator[SEP] identifier[order] operator[SEP] identifier[ByteOrder] operator[SEP] identifier[nativeOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[SEP] identifier[flattenToBuffer] operator[SEP] identifier[bb] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[array] operator[=] identifier[bb] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] identifier[fs] operator[SEP] identifier[writeInt] operator[SEP] identifier[array] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[fs] operator[SEP] identifier[write] operator[SEP] identifier[array] operator[SEP] operator[SEP]
}
|
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case XtextPackage.CROSS_REFERENCE__TYPE:
return basicSetType(null, msgs);
case XtextPackage.CROSS_REFERENCE__TERMINAL:
return basicSetTerminal(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
|
class class_name[name] begin[{]
method[eInverseRemove, return_type[type[NotificationChain]], modifier[public], parameter[otherEnd, featureID, msgs]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=CROSS_REFERENCE__TYPE, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=msgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=basicSetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=CROSS_REFERENCE__TERMINAL, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=msgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=basicSetTerminal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=otherEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eInverseRemove, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[NotificationChain] identifier[eInverseRemove] operator[SEP] identifier[InternalEObject] identifier[otherEnd] , Keyword[int] identifier[featureID] , identifier[NotificationChain] identifier[msgs] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[XtextPackage] operator[SEP] identifier[CROSS_REFERENCE__TYPE] operator[:] Keyword[return] identifier[basicSetType] operator[SEP] Other[null] , identifier[msgs] operator[SEP] operator[SEP] Keyword[case] identifier[XtextPackage] operator[SEP] identifier[CROSS_REFERENCE__TERMINAL] operator[:] Keyword[return] identifier[basicSetTerminal] operator[SEP] Other[null] , identifier[msgs] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eInverseRemove] operator[SEP] identifier[otherEnd] , identifier[featureID] , identifier[msgs] operator[SEP] operator[SEP]
}
|
public void marshall(Hits hits, ProtocolMarshaller protocolMarshaller) {
if (hits == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(hits.getFound(), FOUND_BINDING);
protocolMarshaller.marshall(hits.getStart(), START_BINDING);
protocolMarshaller.marshall(hits.getCursor(), CURSOR_BINDING);
protocolMarshaller.marshall(hits.getHit(), HIT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
|
class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[hits, protocolMarshaller]] begin[{]
if[binary_operation[member[.hits], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFound, postfix_operators=[], prefix_operators=[], qualifier=hits, selectors=[], type_arguments=None), MemberReference(member=FOUND_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=hits, selectors=[], type_arguments=None), MemberReference(member=START_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCursor, postfix_operators=[], prefix_operators=[], qualifier=hits, selectors=[], type_arguments=None), MemberReference(member=CURSOR_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHit, postfix_operators=[], prefix_operators=[], qualifier=hits, selectors=[], type_arguments=None), MemberReference(member=HIT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[Hits] identifier[hits] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[hits] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[hits] operator[SEP] identifier[getFound] operator[SEP] operator[SEP] , identifier[FOUND_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[hits] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] , identifier[START_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[hits] operator[SEP] identifier[getCursor] operator[SEP] operator[SEP] , identifier[CURSOR_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[hits] operator[SEP] identifier[getHit] operator[SEP] operator[SEP] , identifier[HIT_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@NotNull
public static <T, U, A, R> Collector<T, ?, R> flatMapping(
@NotNull final Function<? super T, ? extends Stream<? extends U>> mapper,
@NotNull final Collector<? super U, A, R> downstream) {
final BiConsumer<A, ? super U> accumulator = downstream.accumulator();
return new CollectorsImpl<T, A, R>(
downstream.supplier(),
new BiConsumer<A, T>() {
@Override
public void accept(final A a, T t) {
final Stream<? extends U> stream = mapper.apply(t);
if (stream == null) return;
stream.forEach(new Consumer<U>() {
@Override
public void accept(U u) {
accumulator.accept(a, u);
}
});
}
},
downstream.finisher()
);
}
|
class class_name[name] begin[{]
method[flatMapping, return_type[type[Collector]], modifier[public static], parameter[mapper, downstream]] begin[{]
local_variable[type[BiConsumer], accumulator]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=supplier, postfix_operators=[], prefix_operators=[], qualifier=downstream, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), name=stream)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=[], name=Stream, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=stream, 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=ReturnStatement(expression=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=accumulator, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers=set(), name=u, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=None, name=Consumer, sub_type=None))], member=forEach, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=a, type=ReferenceType(arguments=None, dimensions=[], name=A, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=A, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=BiConsumer, sub_type=None)), MethodInvocation(arguments=[], member=finisher, postfix_operators=[], prefix_operators=[], qualifier=downstream, 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=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=A, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=CollectorsImpl, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[NotNull] Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[U] , identifier[A] , identifier[R] operator[>] identifier[Collector] operator[<] identifier[T] , operator[?] , identifier[R] operator[>] identifier[flatMapping] operator[SEP] annotation[@] identifier[NotNull] Keyword[final] identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[Stream] operator[<] operator[?] Keyword[extends] identifier[U] operator[>] operator[>] identifier[mapper] , annotation[@] identifier[NotNull] Keyword[final] identifier[Collector] operator[<] operator[?] Keyword[super] identifier[U] , identifier[A] , identifier[R] operator[>] identifier[downstream] operator[SEP] {
Keyword[final] identifier[BiConsumer] operator[<] identifier[A] , operator[?] Keyword[super] identifier[U] operator[>] identifier[accumulator] operator[=] identifier[downstream] operator[SEP] identifier[accumulator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CollectorsImpl] operator[<] identifier[T] , identifier[A] , identifier[R] operator[>] operator[SEP] identifier[downstream] operator[SEP] identifier[supplier] operator[SEP] operator[SEP] , Keyword[new] identifier[BiConsumer] operator[<] identifier[A] , identifier[T] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[accept] operator[SEP] Keyword[final] identifier[A] identifier[a] , identifier[T] identifier[t] operator[SEP] {
Keyword[final] identifier[Stream] operator[<] operator[?] Keyword[extends] identifier[U] operator[>] identifier[stream] operator[=] identifier[mapper] operator[SEP] identifier[apply] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stream] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[stream] operator[SEP] identifier[forEach] operator[SEP] Keyword[new] identifier[Consumer] operator[<] identifier[U] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[accept] operator[SEP] identifier[U] identifier[u] operator[SEP] {
identifier[accumulator] operator[SEP] identifier[accept] operator[SEP] identifier[a] , identifier[u] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
} , identifier[downstream] operator[SEP] identifier[finisher] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected Enumeration getContextAttributeNames()
{
if (_attributes.size()==0)
return getHttpContext().getAttributeNames();
HashSet set=new HashSet(_attributes.keySet());
Enumeration e=getHttpContext().getAttributeNames();
while(e.hasMoreElements())
set.add(e.nextElement());
return Collections.enumeration(set);
}
|
class class_name[name] begin[{]
method[getContextAttributeNames, return_type[type[Enumeration]], modifier[protected], parameter[]] begin[{]
if[binary_operation[call[_attributes.size, parameter[]], ==, literal[0]]] begin[{]
return[call[.getHttpContext, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[HashSet], set]
local_variable[type[Enumeration], e]
while[call[e.hasMoreElements, parameter[]]] begin[{]
call[set.add, parameter[call[e.nextElement, parameter[]]]]
end[}]
return[call[Collections.enumeration, parameter[member[.set]]]]
end[}]
END[}]
|
Keyword[protected] identifier[Enumeration] identifier[getContextAttributeNames] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[_attributes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] identifier[getHttpContext] operator[SEP] operator[SEP] operator[SEP] identifier[getAttributeNames] operator[SEP] operator[SEP] operator[SEP] identifier[HashSet] identifier[set] operator[=] Keyword[new] identifier[HashSet] operator[SEP] identifier[_attributes] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Enumeration] identifier[e] operator[=] identifier[getHttpContext] operator[SEP] operator[SEP] operator[SEP] identifier[getAttributeNames] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[enumeration] operator[SEP] identifier[set] operator[SEP] operator[SEP]
}
|
public static boolean nodeNameEquals(Node node, String desiredName) {
Assert.notNull(node, "Node must not be null");
Assert.notNull(desiredName, "Desired name must not be null");
return nodeNameMatch(node, desiredName);
}
|
class class_name[name] begin[{]
method[nodeNameEquals, return_type[type[boolean]], modifier[public static], parameter[node, desiredName]] begin[{]
call[Assert.notNull, parameter[member[.node], literal["Node must not be null"]]]
call[Assert.notNull, parameter[member[.desiredName], literal["Desired name must not be null"]]]
return[call[.nodeNameMatch, parameter[member[.node], member[.desiredName]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[nodeNameEquals] operator[SEP] identifier[Node] identifier[node] , identifier[String] identifier[desiredName] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[node] , literal[String] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[desiredName] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[nodeNameMatch] operator[SEP] identifier[node] , identifier[desiredName] operator[SEP] operator[SEP]
}
|
public Permission getPermission() throws IOException {
int port = url.getPort();
port = port < 0 ? 80 : port;
String host = url.getHost() + ":" + port;
Permission permission = new SocketPermission(host, "connect");
return permission;
}
|
class class_name[name] begin[{]
method[getPermission, return_type[type[Permission]], modifier[public], parameter[]] begin[{]
local_variable[type[int], port]
assign[member[.port], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=80))]
local_variable[type[String], host]
local_variable[type[Permission], permission]
return[member[.permission]]
end[}]
END[}]
|
Keyword[public] identifier[Permission] identifier[getPermission] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[port] operator[=] identifier[url] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] identifier[port] operator[=] identifier[port] operator[<] Other[0] operator[?] Other[80] operator[:] identifier[port] operator[SEP] identifier[String] identifier[host] operator[=] identifier[url] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[port] operator[SEP] identifier[Permission] identifier[permission] operator[=] Keyword[new] identifier[SocketPermission] operator[SEP] identifier[host] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[permission] operator[SEP]
}
|
public Map<String,Object> propertiesForFunction() {
val fields = DifferentialFunctionClassHolder.getInstance().getFieldsForFunction(this);
Map<String,Object> ret = new LinkedHashMap<>();
for(val entry : fields.entrySet()) {
try {
ret.put(entry.getKey(),fields.get(entry.getKey()).get(this));
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
return ret;
}
|
class class_name[name] begin[{]
method[propertiesForFunction, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[val], fields]
local_variable[type[Map], ret]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None)
return[member[.ret]]
end[}]
END[}]
|
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[propertiesForFunction] operator[SEP] operator[SEP] {
identifier[val] identifier[fields] operator[=] identifier[DifferentialFunctionClassHolder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldsForFunction] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[ret] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[val] identifier[entry] operator[:] identifier[fields] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[ret] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[fields] operator[SEP] identifier[get] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[ret] operator[SEP]
}
|
@GET
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.TRANSLATION_READ)
public Response getTranslations(@QueryParam(PAGE_INDEX) Long pageIndex, @QueryParam(PAGE_SIZE) Integer pageSize,
@QueryParam(IS_MISSING) Boolean isMissing, @QueryParam(IS_APPROX) Boolean isApprox,
@QueryParam(IS_OUTDATED) Boolean isOutdated, @QueryParam(SEARCH_NAME) String searchName) {
Response response = Response.noContent().build();
if (pageIndex != null && pageSize != null) {
KeySearchCriteria criteria = new KeySearchCriteria(isMissing, isApprox, isOutdated, searchName, locale);
response = Response.ok(translationFinder.findAllTranslations(new Page(pageIndex, pageSize), criteria))
.build();
} else {
List<TranslationRepresentation> translations = translationFinder.findTranslations(locale);
if (!translations.isEmpty()) {
response = Response.ok(translations).build();
}
}
return response;
}
|
class class_name[name] begin[{]
method[getTranslations, return_type[type[Response]], modifier[public], parameter[pageIndex, pageSize, isMissing, isApprox, isOutdated, searchName]] begin[{]
local_variable[type[Response], response]
if[binary_operation[binary_operation[member[.pageIndex], !=, literal[null]], &&, binary_operation[member[.pageSize], !=, literal[null]]]] begin[{]
local_variable[type[KeySearchCriteria], criteria]
assign[member[.response], call[Response.ok, parameter[call[translationFinder.findAllTranslations, parameter[ClassCreator(arguments=[MemberReference(member=pageIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pageSize, 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=Page, sub_type=None)), member[.criteria]]]]]]
else begin[{]
local_variable[type[List], translations]
if[call[translations.isEmpty, parameter[]]] begin[{]
assign[member[.response], call[Response.ok, parameter[member[.translations]]]]
else begin[{]
None
end[}]
end[}]
return[member[.response]]
end[}]
END[}]
|
annotation[@] identifier[GET] annotation[@] identifier[Produces] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] annotation[@] identifier[RequiresPermissions] operator[SEP] identifier[I18nPermissions] operator[SEP] identifier[TRANSLATION_READ] operator[SEP] Keyword[public] identifier[Response] identifier[getTranslations] operator[SEP] annotation[@] identifier[QueryParam] operator[SEP] identifier[PAGE_INDEX] operator[SEP] identifier[Long] identifier[pageIndex] , annotation[@] identifier[QueryParam] operator[SEP] identifier[PAGE_SIZE] operator[SEP] identifier[Integer] identifier[pageSize] , annotation[@] identifier[QueryParam] operator[SEP] identifier[IS_MISSING] operator[SEP] identifier[Boolean] identifier[isMissing] , annotation[@] identifier[QueryParam] operator[SEP] identifier[IS_APPROX] operator[SEP] identifier[Boolean] identifier[isApprox] , annotation[@] identifier[QueryParam] operator[SEP] identifier[IS_OUTDATED] operator[SEP] identifier[Boolean] identifier[isOutdated] , annotation[@] identifier[QueryParam] operator[SEP] identifier[SEARCH_NAME] operator[SEP] identifier[String] identifier[searchName] operator[SEP] {
identifier[Response] identifier[response] operator[=] identifier[Response] operator[SEP] identifier[noContent] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pageIndex] operator[!=] Other[null] operator[&&] identifier[pageSize] operator[!=] Other[null] operator[SEP] {
identifier[KeySearchCriteria] identifier[criteria] operator[=] Keyword[new] identifier[KeySearchCriteria] operator[SEP] identifier[isMissing] , identifier[isApprox] , identifier[isOutdated] , identifier[searchName] , identifier[locale] operator[SEP] operator[SEP] identifier[response] operator[=] identifier[Response] operator[SEP] identifier[ok] operator[SEP] identifier[translationFinder] operator[SEP] identifier[findAllTranslations] operator[SEP] Keyword[new] identifier[Page] operator[SEP] identifier[pageIndex] , identifier[pageSize] operator[SEP] , identifier[criteria] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[List] operator[<] identifier[TranslationRepresentation] operator[>] identifier[translations] operator[=] identifier[translationFinder] operator[SEP] identifier[findTranslations] operator[SEP] identifier[locale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[translations] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[response] operator[=] identifier[Response] operator[SEP] identifier[ok] operator[SEP] identifier[translations] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[response] operator[SEP]
}
|
public static String removeFirst(String str, char c) {
return (Strs.isEmpty(str) || c != str.charAt(0)) ? str : str.substring(1);
}
|
class class_name[name] begin[{]
method[removeFirst, return_type[type[String]], modifier[public static], parameter[str, c]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=Strs, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operator=!=), operator=||), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), if_true=MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[removeFirst] operator[SEP] identifier[String] identifier[str] , Keyword[char] identifier[c] operator[SEP] {
Keyword[return] operator[SEP] identifier[Strs] operator[SEP] identifier[isEmpty] operator[SEP] identifier[str] operator[SEP] operator[||] identifier[c] operator[!=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[?] identifier[str] operator[:] identifier[str] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
|
private static void setUniqueIdReferences(final Node node, final String id, final String fixedId) {
final NamedNodeMap attributes = node.getAttributes();
if (attributes != null) {
for (int i = 0; i < attributes.getLength(); ++i) {
final Attr attr = (Attr) attributes.item(i);
// Ignore id attributes, as we only care about references (ie linkend)
if (!(attr.getName().equalsIgnoreCase("id") || attr.getName().equalsIgnoreCase("xml:id"))) {
final String attributeValue = attr.getValue();
if (attributeValue.equals(id)) {
attributes.item(i).setNodeValue(fixedId);
}
}
}
}
final NodeList elements = node.getChildNodes();
for (int i = 0; i < elements.getLength(); ++i) {
setUniqueIdReferences(elements.item(i), id, fixedId);
}
}
|
class class_name[name] begin[{]
method[setUniqueIdReferences, return_type[void], modifier[private static], parameter[node, id, fixedId]] begin[{]
local_variable[type[NamedNodeMap], attributes]
if[binary_operation[member[.attributes], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attr, sub_type=None)), name=attr)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Attr, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="id")], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="xml:id")], member=equalsIgnoreCase, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), name=attributeValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=attributeValue, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[MethodInvocation(arguments=[MemberReference(member=fixedId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNodeValue, 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=getLength, postfix_operators=[], prefix_operators=[], qualifier=attributes, 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)
else begin[{]
None
end[}]
local_variable[type[NodeList], elements]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fixedId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setUniqueIdReferences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=elements, 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[private] Keyword[static] Keyword[void] identifier[setUniqueIdReferences] operator[SEP] Keyword[final] identifier[Node] identifier[node] , Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[String] identifier[fixedId] operator[SEP] {
Keyword[final] identifier[NamedNodeMap] identifier[attributes] operator[=] identifier[node] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributes] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[attributes] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[final] identifier[Attr] identifier[attr] operator[=] operator[SEP] identifier[Attr] operator[SEP] identifier[attributes] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[attr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[attr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[attributeValue] operator[=] identifier[attr] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributeValue] operator[SEP] identifier[equals] operator[SEP] identifier[id] operator[SEP] operator[SEP] {
identifier[attributes] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[setNodeValue] operator[SEP] identifier[fixedId] operator[SEP] operator[SEP]
}
}
}
}
Keyword[final] identifier[NodeList] identifier[elements] operator[=] identifier[node] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[elements] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[setUniqueIdReferences] operator[SEP] identifier[elements] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] , identifier[id] , identifier[fixedId] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
public static Val exec(String rapids, Session session) {
try {
H2O.incrementActiveRapidsCounter();
AstRoot ast = Rapids.parse(rapids);
// Synchronize the session, to stop back-to-back overlapping Rapids calls
// on the same session, which Flow sometimes does
synchronized (session) {
Val val = session.exec(ast, null);
// Any returned Frame has it's REFCNT raised by +1, but is exiting the
// session. If it's a global, we simply need to lower the internal refcnts
// (which won't delete on zero cnts because of the global). If it's a
// named temp, the ref cnts are accounted for by being in the temp table.
if (val.isFrame()) {
Frame frame = val.getFrame();
assert frame._key != null : "Returned frame has no key";
session.addRefCnt(frame, -1);
}
return val;
}
}
finally {
H2O.decrementActiveRapidsCounter();
}
}
|
class class_name[name] begin[{]
method[exec, return_type[type[Val]], modifier[public static], parameter[rapids, session]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=incrementActiveRapidsCounter, postfix_operators=[], prefix_operators=[], qualifier=H2O, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rapids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=Rapids, selectors=[], type_arguments=None), name=ast)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AstRoot, sub_type=None)), SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=exec, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Val, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isFrame, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFrame, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None), name=frame)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Frame, sub_type=None)), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=_key, postfix_operators=[], prefix_operators=[], qualifier=frame, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Returned frame has no key")), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=frame, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=addRefCnt, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, lock=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=decrementActiveRapidsCounter, postfix_operators=[], prefix_operators=[], qualifier=H2O, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[Val] identifier[exec] operator[SEP] identifier[String] identifier[rapids] , identifier[Session] identifier[session] operator[SEP] {
Keyword[try] {
identifier[H2O] operator[SEP] identifier[incrementActiveRapidsCounter] operator[SEP] operator[SEP] operator[SEP] identifier[AstRoot] identifier[ast] operator[=] identifier[Rapids] operator[SEP] identifier[parse] operator[SEP] identifier[rapids] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[session] operator[SEP] {
identifier[Val] identifier[val] operator[=] identifier[session] operator[SEP] identifier[exec] operator[SEP] identifier[ast] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[SEP] identifier[isFrame] operator[SEP] operator[SEP] operator[SEP] {
identifier[Frame] identifier[frame] operator[=] identifier[val] operator[SEP] identifier[getFrame] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[frame] operator[SEP] identifier[_key] operator[!=] Other[null] operator[:] literal[String] operator[SEP] identifier[session] operator[SEP] identifier[addRefCnt] operator[SEP] identifier[frame] , operator[-] Other[1] operator[SEP] operator[SEP]
}
Keyword[return] identifier[val] operator[SEP]
}
}
Keyword[finally] {
identifier[H2O] operator[SEP] identifier[decrementActiveRapidsCounter] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void subparam(String type, String name, final Object value, double min, double max, String strPattern, int maxLength, final boolean isNew) throws PageException {
// check attributes type
if (type == null) type = "any";
else type = type.trim().toLowerCase();
// cast and set value
if (!"any".equals(type)) {
// range
if ("range".equals(type)) {
boolean hasMin = Decision.isValid(min);
boolean hasMax = Decision.isValid(max);
double number = Caster.toDoubleValue(value);
if (!hasMin && !hasMax) throw new ExpressionException("you need to define one of the following attributes [min,max], when type is set to [range]");
if (hasMin && number < min)
throw new ExpressionException("The number [" + Caster.toString(number) + "] is to small, the number must be at least [" + Caster.toString(min) + "]");
if (hasMax && number > max)
throw new ExpressionException("The number [" + Caster.toString(number) + "] is to big, the number cannot be bigger than [" + Caster.toString(max) + "]");
setVariable(name, Caster.toDouble(number));
}
// regex
else if ("regex".equals(type) || "regular_expression".equals(type)) {
String str = Caster.toString(value);
if (strPattern == null) throw new ExpressionException("Missing attribute [pattern]");
if (!Perl5Util.matches(strPattern, str)) throw new ExpressionException("The value [" + str + "] doesn't match the provided pattern [" + strPattern + "]");
setVariable(name, str);
}
else if (type.equals("int") || type.equals("integer")) {
if (!Decision.isInteger(value)) throw new ExpressionException("The value [" + value + "] is not a valid integer");
setVariable(name, value);
}
else {
if (!Decision.isCastableTo(type, value, true, true, maxLength)) {
if (maxLength > -1 && ("email".equalsIgnoreCase(type) || "url".equalsIgnoreCase(type) || "string".equalsIgnoreCase(type))) {
StringBuilder msg = new StringBuilder(CasterException.createMessage(value, type));
msg.append(" with a maximum length of " + maxLength + " characters");
throw new CasterException(msg.toString());
}
throw new CasterException(value, type);
}
setVariable(name, value);
// REALCAST setVariable(name,Caster.castTo(this,type,value,true));
}
}
else if (isNew) setVariable(name, value);
}
|
class class_name[name] begin[{]
method[subparam, return_type[void], modifier[public], parameter[type, name, value, min, max, strPattern, maxLength, isNew]] begin[{]
if[binary_operation[member[.type], ==, literal[null]]] begin[{]
assign[member[.type], literal["any"]]
else begin[{]
assign[member[.type], call[type.trim, parameter[]]]
end[}]
if[literal["any"]] begin[{]
if[literal["range"]] begin[{]
local_variable[type[boolean], hasMin]
local_variable[type[boolean], hasMax]
local_variable[type[double], number]
if[binary_operation[member[.hasMin], &&, member[.hasMax]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="you need to define one of the following attributes [min,max], when type is set to [range]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExpressionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.hasMin], &&, binary_operation[member[.number], <, member[.min]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The number ["), operandr=MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Caster, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] is to small, the number must be at least ["), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Caster, 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=ExpressionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.hasMax], &&, binary_operation[member[.number], >, member[.max]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The number ["), operandr=MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Caster, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] is to big, the number cannot be bigger than ["), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Caster, 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=ExpressionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.setVariable, parameter[member[.name], call[Caster.toDouble, parameter[member[.number]]]]]
else begin[{]
if[binary_operation[literal["regex"], ||, literal["regular_expression"]]] begin[{]
local_variable[type[String], str]
if[binary_operation[member[.strPattern], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing attribute [pattern]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExpressionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[Perl5Util.matches, parameter[member[.strPattern], member[.str]]]] 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=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] doesn't match the provided pattern ["), operator=+), operandr=MemberReference(member=strPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExpressionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.setVariable, parameter[member[.name], member[.str]]]
else begin[{]
if[binary_operation[call[type.equals, parameter[literal["int"]]], ||, call[type.equals, parameter[literal["integer"]]]]] begin[{]
if[call[Decision.isInteger, parameter[member[.value]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value ["), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] is not a valid integer"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExpressionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.setVariable, parameter[member[.name], member[.value]]]
else begin[{]
if[call[Decision.isCastableTo, parameter[member[.type], member[.value], literal[true], literal[true], member[.maxLength]]]] begin[{]
if[binary_operation[binary_operation[member[.maxLength], >, literal[1]], &&, binary_operation[binary_operation[literal["email"], ||, literal["url"]], ||, literal["string"]]]] begin[{]
local_variable[type[StringBuilder], msg]
call[msg.append, parameter[binary_operation[binary_operation[literal[" with a maximum length of "], +, member[.maxLength]], +, literal[" characters"]]]]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CasterException, sub_type=None)), label=None)
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, 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=CasterException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.setVariable, parameter[member[.name], member[.value]]]
end[}]
end[}]
end[}]
else begin[{]
if[member[.isNew]] begin[{]
call[.setVariable, parameter[member[.name], member[.value]]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[subparam] operator[SEP] identifier[String] identifier[type] , identifier[String] identifier[name] , Keyword[final] identifier[Object] identifier[value] , Keyword[double] identifier[min] , Keyword[double] identifier[max] , identifier[String] identifier[strPattern] , Keyword[int] identifier[maxLength] , Keyword[final] Keyword[boolean] identifier[isNew] operator[SEP] Keyword[throws] identifier[PageException] {
Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] identifier[type] operator[=] literal[String] operator[SEP] Keyword[else] identifier[type] operator[=] identifier[type] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[hasMin] operator[=] identifier[Decision] operator[SEP] identifier[isValid] operator[SEP] identifier[min] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasMax] operator[=] identifier[Decision] operator[SEP] identifier[isValid] operator[SEP] identifier[max] operator[SEP] operator[SEP] Keyword[double] identifier[number] operator[=] identifier[Caster] operator[SEP] identifier[toDoubleValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hasMin] operator[&&] operator[!] identifier[hasMax] operator[SEP] Keyword[throw] Keyword[new] identifier[ExpressionException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasMin] operator[&&] identifier[number] operator[<] identifier[min] operator[SEP] Keyword[throw] Keyword[new] identifier[ExpressionException] operator[SEP] literal[String] operator[+] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[number] operator[SEP] operator[+] literal[String] operator[+] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[min] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasMax] operator[&&] identifier[number] operator[>] identifier[max] operator[SEP] Keyword[throw] Keyword[new] identifier[ExpressionException] operator[SEP] literal[String] operator[+] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[number] operator[SEP] operator[+] literal[String] operator[+] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[max] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[setVariable] operator[SEP] identifier[name] , identifier[Caster] operator[SEP] identifier[toDouble] operator[SEP] identifier[number] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
identifier[String] identifier[str] operator[=] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strPattern] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[ExpressionException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Perl5Util] operator[SEP] identifier[matches] operator[SEP] identifier[strPattern] , identifier[str] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ExpressionException] operator[SEP] literal[String] operator[+] identifier[str] operator[+] literal[String] operator[+] identifier[strPattern] operator[+] literal[String] operator[SEP] operator[SEP] identifier[setVariable] operator[SEP] identifier[name] , identifier[str] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[Decision] operator[SEP] identifier[isInteger] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ExpressionException] operator[SEP] literal[String] operator[+] identifier[value] operator[+] literal[String] operator[SEP] operator[SEP] identifier[setVariable] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] operator[!] identifier[Decision] operator[SEP] identifier[isCastableTo] operator[SEP] identifier[type] , identifier[value] , literal[boolean] , literal[boolean] , identifier[maxLength] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[maxLength] operator[>] operator[-] Other[1] operator[&&] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[type] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[type] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[msg] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[CasterException] operator[SEP] identifier[createMessage] operator[SEP] identifier[value] , identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[maxLength] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CasterException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[CasterException] operator[SEP] identifier[value] , identifier[type] operator[SEP] operator[SEP]
}
identifier[setVariable] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[isNew] operator[SEP] identifier[setVariable] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
|
public static Expression applyDirective(
Expression expr,
SoyJsSrcPrintDirective directive,
List<Expression> args,
SourceLocation location,
ErrorReporter errorReporter) {
List<JsExpr> argExprs = Lists.transform(args, Expression::singleExprOrName);
JsExpr applied;
try {
applied = directive.applyForJsSrc(expr.singleExprOrName(), argExprs);
} catch (Throwable t) {
applied = report(location, directive, t, errorReporter);
}
RequiresCollector.IntoImmutableSet collector = new RequiresCollector.IntoImmutableSet();
expr.collectRequires(collector);
for (Expression arg : args) {
arg.collectRequires(collector);
}
if (directive instanceof SoyLibraryAssistedJsSrcPrintDirective) {
for (String name :
((SoyLibraryAssistedJsSrcPrintDirective) directive).getRequiredJsLibNames()) {
collector.add(GoogRequire.create(name));
}
}
ImmutableList.Builder<Statement> initialStatements =
ImmutableList.<Statement>builder().addAll(expr.initialStatements());
for (Expression arg : args) {
initialStatements.addAll(arg.initialStatements());
}
return fromExpr(applied, collector.get()).withInitialStatements(initialStatements.build());
}
|
class class_name[name] begin[{]
method[applyDirective, return_type[type[Expression]], modifier[public static], parameter[expr, directive, args, location, errorReporter]] begin[{]
local_variable[type[List], argExprs]
local_variable[type[JsExpr], applied]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=applied, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=singleExprOrName, postfix_operators=[], prefix_operators=[], qualifier=expr, selectors=[], type_arguments=None), MemberReference(member=argExprs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=applyForJsSrc, postfix_operators=[], prefix_operators=[], qualifier=directive, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=applied, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=directive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=errorReporter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=report, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
local_variable[type[RequiresCollector], collector]
call[expr.collectRequires, parameter[member[.collector]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=collector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=collectRequires, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Expression, sub_type=None))), label=None)
if[binary_operation[member[.directive], instanceof, type[SoyLibraryAssistedJsSrcPrintDirective]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=GoogRequire, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=collector, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=directive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SoyLibraryAssistedJsSrcPrintDirective, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
local_variable[type[ImmutableList], initialStatements]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=initialStatements, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=initialStatements, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Expression, sub_type=None))), label=None)
return[call[.fromExpr, parameter[member[.applied], call[collector.get, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Expression] identifier[applyDirective] operator[SEP] identifier[Expression] identifier[expr] , identifier[SoyJsSrcPrintDirective] identifier[directive] , identifier[List] operator[<] identifier[Expression] operator[>] identifier[args] , identifier[SourceLocation] identifier[location] , identifier[ErrorReporter] identifier[errorReporter] operator[SEP] {
identifier[List] operator[<] identifier[JsExpr] operator[>] identifier[argExprs] operator[=] identifier[Lists] operator[SEP] identifier[transform] operator[SEP] identifier[args] , identifier[Expression] operator[::] identifier[singleExprOrName] operator[SEP] operator[SEP] identifier[JsExpr] identifier[applied] operator[SEP] Keyword[try] {
identifier[applied] operator[=] identifier[directive] operator[SEP] identifier[applyForJsSrc] operator[SEP] identifier[expr] operator[SEP] identifier[singleExprOrName] operator[SEP] operator[SEP] , identifier[argExprs] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[applied] operator[=] identifier[report] operator[SEP] identifier[location] , identifier[directive] , identifier[t] , identifier[errorReporter] operator[SEP] operator[SEP]
}
identifier[RequiresCollector] operator[SEP] identifier[IntoImmutableSet] identifier[collector] operator[=] Keyword[new] identifier[RequiresCollector] operator[SEP] identifier[IntoImmutableSet] operator[SEP] operator[SEP] operator[SEP] identifier[expr] operator[SEP] identifier[collectRequires] operator[SEP] identifier[collector] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Expression] identifier[arg] operator[:] identifier[args] operator[SEP] {
identifier[arg] operator[SEP] identifier[collectRequires] operator[SEP] identifier[collector] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[directive] Keyword[instanceof] identifier[SoyLibraryAssistedJsSrcPrintDirective] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] operator[SEP] operator[SEP] identifier[SoyLibraryAssistedJsSrcPrintDirective] operator[SEP] identifier[directive] operator[SEP] operator[SEP] identifier[getRequiredJsLibNames] operator[SEP] operator[SEP] operator[SEP] {
identifier[collector] operator[SEP] identifier[add] operator[SEP] identifier[GoogRequire] operator[SEP] identifier[create] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[Statement] operator[>] identifier[initialStatements] operator[=] identifier[ImmutableList] operator[SEP] operator[<] identifier[Statement] operator[>] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[expr] operator[SEP] identifier[initialStatements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Expression] identifier[arg] operator[:] identifier[args] operator[SEP] {
identifier[initialStatements] operator[SEP] identifier[addAll] operator[SEP] identifier[arg] operator[SEP] identifier[initialStatements] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fromExpr] operator[SEP] identifier[applied] , identifier[collector] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[withInitialStatements] operator[SEP] identifier[initialStatements] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setIcon(String icon)
{
ExtendedInfo info = getInfo(icon);
if (info != null)
info._icon = icon;
}
|
class class_name[name] begin[{]
method[setIcon, return_type[void], modifier[public], parameter[icon]] begin[{]
local_variable[type[ExtendedInfo], info]
if[binary_operation[member[.info], !=, literal[null]]] begin[{]
assign[member[info._icon], member[.icon]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setIcon] operator[SEP] identifier[String] identifier[icon] operator[SEP] {
identifier[ExtendedInfo] identifier[info] operator[=] identifier[getInfo] operator[SEP] identifier[icon] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[info] operator[!=] Other[null] operator[SEP] identifier[info] operator[SEP] identifier[_icon] operator[=] identifier[icon] operator[SEP]
}
|
@SuppressWarnings("unchecked")
private void updateXmlContents(
I_CmsReport report,
String resourcePath,
boolean inclSubFolder,
CmsObject cmsObject) {
// write parameters to report
report.println(Messages.get().container(Messages.RPT_UPDATEXML_BEGIN_UPDATE_0), I_CmsReport.FORMAT_NOTE);
report.println(Messages.get().container(Messages.RPT_UPDATEXML_PARAMETERS_0), I_CmsReport.FORMAT_HEADLINE);
report.println(
Messages.get().container(Messages.RPT_UPDATEXML_PARAMETERS_RESOURCE_PATH_1, resourcePath),
I_CmsReport.FORMAT_NOTE);
report.println(
Messages.get().container(
Messages.RPT_UPDATEXML_PARAMETERS_INC_SUBFOLDERS_1,
new Boolean(inclSubFolder).toString()),
I_CmsReport.FORMAT_NOTE);
// check for valid parameters (vfs folder)
if (CmsStringUtil.isEmpty(resourcePath)) {
report.println(Messages.get().container(Messages.RPT_UPDATEXML_NO_VFS_FOLDER_0), I_CmsReport.FORMAT_ERROR);
return;
}
// read all files in the vfs folder
report.println(Messages.get().container(Messages.RPT_UPDATEXML_START_SEARCHING_0), I_CmsReport.FORMAT_HEADLINE);
List<CmsResource> allFiles = null;
try {
allFiles = cmsObject.readResources(resourcePath, CmsResourceFilter.DEFAULT, inclSubFolder);
} catch (CmsException e) {
m_errorUpdate += 1;
report.println(Messages.get().container(Messages.RPT_UPDATEXML_SEARCH_ERROR_0), I_CmsReport.FORMAT_ERROR);
if (LOG.isErrorEnabled()) {
LOG.error(e.getMessageContainer(), e);
}
report.println(Messages.get().container(Messages.RPT_UPDATEXML_END_UPDATE_0), I_CmsReport.FORMAT_NOTE);
return;
}
// get the files to update
List<CmsResource> files2Update = new ArrayList<CmsResource>();
Iterator<CmsResource> iter = allFiles.iterator();
while (iter.hasNext()) {
CmsResource cmsResource = iter.next();
// only update Xml contents
if (cmsResource.isFile()
&& (CmsResourceTypeXmlContent.isXmlContent(cmsResource)
|| CmsResourceTypeXmlPage.isXmlPage(cmsResource))) {
files2Update.add(cmsResource);
}
}
// number of files to update
int nrOfFiles = files2Update.size();
report.println(
Messages.get().container(Messages.RPT_UPDATEXML_FILES_TO_UPDATE_1, new Integer(nrOfFiles).toString()),
I_CmsReport.FORMAT_NOTE);
// the file counter
int fileCounter = 0;
// update the files
if (nrOfFiles > 0) {
// report entry
report.println(
Messages.get().container(Messages.RPT_UPDATEXML_START_UPDATING_0),
I_CmsReport.FORMAT_HEADLINE);
// loop over all files
iter = files2Update.iterator();
while (iter.hasNext()) {
CmsResource cmsResource = iter.next();
fileCounter += 1;
// report entries
report.print(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_SUCCESSION_2,
String.valueOf(fileCounter),
String.valueOf(nrOfFiles)),
I_CmsReport.FORMAT_NOTE);
report.print(Messages.get().container(Messages.RPT_UPDATEXML_CURRENT_FILE_0), I_CmsReport.FORMAT_NOTE);
report.print(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_ARGUMENT_1,
report.removeSiteRoot(cmsResource.getRootPath())));
report.print(
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
I_CmsReport.FORMAT_DEFAULT);
// get current lock from file
try {
// try to lock the resource
if (!lockResource(cmsObject, cmsResource, report)) {
report.println(
Messages.get().container(
Messages.RPT_UPDATEXML_LOCKED_FILE_0,
cmsObject.getSitePath(cmsResource)),
I_CmsReport.FORMAT_ERROR);
continue;
}
} catch (CmsException e) {
report.println(
Messages.get().container(
Messages.RPT_UPDATEXML_LOCKED_FILE_0,
cmsObject.getSitePath(cmsResource)),
I_CmsReport.FORMAT_ERROR);
if (LOG.isErrorEnabled()) {
LOG.error(e.getMessageContainer(), e);
}
continue;
}
// write the resource
try {
// do not change the date last modified
long lastModified = cmsResource.getDateLastModified();
CmsFile cmsFile = cmsObject.readFile(cmsResource);
cmsFile.setDateLastModified(lastModified);
cmsObject.writeFile(cmsFile);
} catch (Exception e) {
m_errorUpdate += 1;
report.println(
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_FAILED_0),
I_CmsReport.FORMAT_ERROR);
if (LOG.isErrorEnabled()) {
LOG.error(e.toString());
}
continue;
}
// unlock the resource
try {
cmsObject.unlockResource(cmsObject.getSitePath(cmsResource));
} catch (CmsException e) {
m_errorUpdate += 1;
report.println(
Messages.get().container(Messages.RPT_UPDATEXML_UNLOCK_FILE_0),
I_CmsReport.FORMAT_WARNING);
if (LOG.isErrorEnabled()) {
LOG.error(e.getMessageContainer(), e);
}
continue;
}
// successfully updated
report.println(
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
I_CmsReport.FORMAT_OK);
}
} else {
// no files to update
report.println(Messages.get().container(Messages.RPT_UPDATEXML_NO_FILES_FOUND_0), I_CmsReport.FORMAT_NOTE);
}
// the results are written in the report
report.println(Messages.get().container(Messages.RPT_UPDATEXML_RESULT_0), I_CmsReport.FORMAT_HEADLINE);
report.println(
Messages.get().container(Messages.RPT_UPDATEXML_FILES_TO_UPDATE_1, new Integer(nrOfFiles).toString()),
I_CmsReport.FORMAT_NOTE);
report.println(
Messages.get().container(
Messages.RPT_UPDATEXML_UPDATE_NUMBER_ERRORS_1,
new Integer(m_errorUpdate).toString()),
I_CmsReport.FORMAT_NOTE);
report.println(
Messages.get().container(Messages.RPT_UPDATEXML_LOCKED_FILES_1, new Integer(m_lockedFiles).toString()),
I_CmsReport.FORMAT_NOTE);
if (m_lockedFiles > 0) {
report.println(Messages.get().container(Messages.RPT_UPDATEXML_UPDATE_FAILED_0), I_CmsReport.FORMAT_ERROR);
} else {
report.println(Messages.get().container(Messages.RPT_UPDATEXML_UPDATE_SUCCESS_0), I_CmsReport.FORMAT_OK);
}
report.println(Messages.get().container(Messages.RPT_UPDATEXML_END_UPDATE_0), I_CmsReport.FORMAT_NOTE);
}
|
class class_name[name] begin[{]
method[updateXmlContents, return_type[void], modifier[private], parameter[report, resourcePath, inclSubFolder, cmsObject]] begin[{]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_HEADLINE]]]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
if[call[CmsStringUtil.isEmpty, parameter[member[.resourcePath]]]] begin[{]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_ERROR]]]
return[None]
else begin[{]
None
end[}]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_HEADLINE]]]
local_variable[type[List], allFiles]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=allFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=resourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[]), MemberReference(member=inclSubFolder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readResources, postfix_operators=[], prefix_operators=[], qualifier=cmsObject, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_errorUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_UPDATEXML_SEARCH_ERROR_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessageContainer, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], 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=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_UPDATEXML_END_UPDATE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_NOTE, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
local_variable[type[List], files2Update]
local_variable[type[Iterator], iter]
while[call[iter.hasNext, parameter[]]] begin[{]
local_variable[type[CmsResource], cmsResource]
if[binary_operation[call[cmsResource.isFile, parameter[]], &&, binary_operation[call[CmsResourceTypeXmlContent.isXmlContent, parameter[member[.cmsResource]]], ||, call[CmsResourceTypeXmlPage.isXmlPage, parameter[member[.cmsResource]]]]]] begin[{]
call[files2Update.add, parameter[member[.cmsResource]]]
else begin[{]
None
end[}]
end[}]
local_variable[type[int], nrOfFiles]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
local_variable[type[int], fileCounter]
if[binary_operation[member[.nrOfFiles], >, literal[0]]] begin[{]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_HEADLINE]]]
assign[member[.iter], call[files2Update.iterator, parameter[]]]
while[call[iter.hasNext, parameter[]]] begin[{]
local_variable[type[CmsResource], cmsResource]
assign[member[.fileCounter], literal[1]]
call[report.print, parameter[call[org.opencms.report.Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
call[report.print, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
call[report.print, parameter[call[org.opencms.report.Messages.get, parameter[]]]]
call[report.print, parameter[call[org.opencms.report.Messages.get, parameter[]], member[I_CmsReport.FORMAT_DEFAULT]]]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=cmsObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cmsResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=report, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lockResource, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_UPDATEXML_LOCKED_FILE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[MemberReference(member=cmsResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=cmsObject, selectors=[], type_arguments=None)], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_UPDATEXML_LOCKED_FILE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[MemberReference(member=cmsResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=cmsObject, selectors=[], type_arguments=None)], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessageContainer, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], 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)])), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDateLastModified, postfix_operators=[], prefix_operators=[], qualifier=cmsResource, selectors=[], type_arguments=None), name=lastModified)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cmsResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFile, postfix_operators=[], prefix_operators=[], qualifier=cmsObject, selectors=[], type_arguments=None), name=cmsFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsFile, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lastModified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDateLastModified, postfix_operators=[], prefix_operators=[], qualifier=cmsFile, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cmsFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeFile, postfix_operators=[], prefix_operators=[], qualifier=cmsObject, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_errorUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_FAILED_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cmsResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=cmsObject, selectors=[], type_arguments=None)], member=unlockResource, postfix_operators=[], prefix_operators=[], qualifier=cmsObject, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_errorUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_UPDATEXML_UNLOCK_FILE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_WARNING, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessageContainer, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], 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)])), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
call[report.println, parameter[call[org.opencms.report.Messages.get, parameter[]], member[I_CmsReport.FORMAT_OK]]]
end[}]
else begin[{]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
end[}]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_HEADLINE]]]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
if[binary_operation[member[.m_lockedFiles], >, literal[0]]] begin[{]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_ERROR]]]
else begin[{]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_OK]]]
end[}]
call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[updateXmlContents] operator[SEP] identifier[I_CmsReport] identifier[report] , identifier[String] identifier[resourcePath] , Keyword[boolean] identifier[inclSubFolder] , identifier[CmsObject] identifier[cmsObject] operator[SEP] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_BEGIN_UPDATE_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_PARAMETERS_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_HEADLINE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_PARAMETERS_RESOURCE_PATH_1] , identifier[resourcePath] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_PARAMETERS_INC_SUBFOLDERS_1] , Keyword[new] identifier[Boolean] operator[SEP] identifier[inclSubFolder] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[resourcePath] operator[SEP] operator[SEP] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_NO_VFS_FOLDER_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_ERROR] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_START_SEARCHING_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_HEADLINE] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[allFiles] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[allFiles] operator[=] identifier[cmsObject] operator[SEP] identifier[readResources] operator[SEP] identifier[resourcePath] , identifier[CmsResourceFilter] operator[SEP] identifier[DEFAULT] , identifier[inclSubFolder] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[m_errorUpdate] operator[+=] Other[1] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_SEARCH_ERROR_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_ERROR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessageContainer] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_END_UPDATE_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[files2Update] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsResource] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[CmsResource] operator[>] identifier[iter] operator[=] identifier[allFiles] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsResource] identifier[cmsResource] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmsResource] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[CmsResourceTypeXmlContent] operator[SEP] identifier[isXmlContent] operator[SEP] identifier[cmsResource] operator[SEP] operator[||] identifier[CmsResourceTypeXmlPage] operator[SEP] identifier[isXmlPage] operator[SEP] identifier[cmsResource] operator[SEP] operator[SEP] operator[SEP] {
identifier[files2Update] operator[SEP] identifier[add] operator[SEP] identifier[cmsResource] operator[SEP] operator[SEP]
}
}
Keyword[int] identifier[nrOfFiles] operator[=] identifier[files2Update] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_FILES_TO_UPDATE_1] , Keyword[new] identifier[Integer] operator[SEP] identifier[nrOfFiles] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] Keyword[int] identifier[fileCounter] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[nrOfFiles] operator[>] Other[0] operator[SEP] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_START_UPDATING_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_HEADLINE] operator[SEP] operator[SEP] identifier[iter] operator[=] identifier[files2Update] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsResource] identifier[cmsResource] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[fileCounter] operator[+=] Other[1] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SUCCESSION_2] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[fileCounter] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[nrOfFiles] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_CURRENT_FILE_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_ARGUMENT_1] , identifier[report] operator[SEP] identifier[removeSiteRoot] operator[SEP] identifier[cmsResource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_DOTS_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_DEFAULT] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] operator[!] identifier[lockResource] operator[SEP] identifier[cmsObject] , identifier[cmsResource] , identifier[report] operator[SEP] operator[SEP] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_LOCKED_FILE_0] , identifier[cmsObject] operator[SEP] identifier[getSitePath] operator[SEP] identifier[cmsResource] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_ERROR] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_LOCKED_FILE_0] , identifier[cmsObject] operator[SEP] identifier[getSitePath] operator[SEP] identifier[cmsResource] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_ERROR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessageContainer] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[continue] operator[SEP]
}
Keyword[try] {
Keyword[long] identifier[lastModified] operator[=] identifier[cmsResource] operator[SEP] identifier[getDateLastModified] operator[SEP] operator[SEP] operator[SEP] identifier[CmsFile] identifier[cmsFile] operator[=] identifier[cmsObject] operator[SEP] identifier[readFile] operator[SEP] identifier[cmsResource] operator[SEP] operator[SEP] identifier[cmsFile] operator[SEP] identifier[setDateLastModified] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] identifier[cmsObject] operator[SEP] identifier[writeFile] operator[SEP] identifier[cmsFile] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[m_errorUpdate] operator[+=] Other[1] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_FAILED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_ERROR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[continue] operator[SEP]
}
Keyword[try] {
identifier[cmsObject] operator[SEP] identifier[unlockResource] operator[SEP] identifier[cmsObject] operator[SEP] identifier[getSitePath] operator[SEP] identifier[cmsResource] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[m_errorUpdate] operator[+=] Other[1] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_UNLOCK_FILE_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_WARNING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessageContainer] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[continue] operator[SEP]
}
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_OK_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_NO_FILES_FOUND_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP]
}
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_RESULT_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_HEADLINE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_FILES_TO_UPDATE_1] , Keyword[new] identifier[Integer] operator[SEP] identifier[nrOfFiles] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_UPDATE_NUMBER_ERRORS_1] , Keyword[new] identifier[Integer] operator[SEP] identifier[m_errorUpdate] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_LOCKED_FILES_1] , Keyword[new] identifier[Integer] operator[SEP] identifier[m_lockedFiles] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_lockedFiles] operator[>] Other[0] operator[SEP] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_UPDATE_FAILED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_ERROR] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_UPDATE_SUCCESS_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP]
}
identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_UPDATEXML_END_UPDATE_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP]
}
|
private void checkMQLinkExists(boolean condition, String mqlinkName)
throws SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"checkMQLinkExists",
new Object[] { new Boolean(condition), mqlinkName });
if (!condition)
{
SIMPNotPossibleInCurrentConfigurationException e =
new SIMPNotPossibleInCurrentConfigurationException(
nls_cwsik.getFormattedMessage(
"DELIVERY_ERROR_SIRC_42",
new Object[] { mqlinkName, messageProcessor.getMessagingEngineName(),
messageProcessor.getMessagingEngineBus() },
null));
e.setExceptionInserts(new String[] { mqlinkName, messageProcessor.getMessagingEngineName(), messageProcessor.getMessagingEngineBus() });
e.setExceptionReason(SIRCConstants.SIRC0042_MQ_LINK_NOT_FOUND_ERROR);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkMQLinkExists", e);
throw e;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkMQLinkExists");
}
|
class class_name[name] begin[{]
method[checkMQLinkExists, return_type[void], modifier[private], parameter[condition, mqlinkName]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["checkMQLinkExists"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[MemberReference(member=condition, 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=Boolean, sub_type=None)), MemberReference(member=mqlinkName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
if[member[.condition]] begin[{]
local_variable[type[SIMPNotPossibleInCurrentConfigurationException], e]
call[e.setExceptionInserts, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=mqlinkName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessagingEngineName, postfix_operators=[], prefix_operators=[], qualifier=messageProcessor, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMessagingEngineBus, postfix_operators=[], prefix_operators=[], qualifier=messageProcessor, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
call[e.setExceptionReason, parameter[member[SIRCConstants.SIRC0042_MQ_LINK_NOT_FOUND_ERROR]]]
call[SibTr.exception, parameter[member[.tc], member[.e]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["checkMQLinkExists"], member[.e]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["checkMQLinkExists"]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[checkMQLinkExists] operator[SEP] Keyword[boolean] identifier[condition] , identifier[String] identifier[mqlinkName] operator[SEP] Keyword[throws] identifier[SINotPossibleInCurrentConfigurationException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
Keyword[new] identifier[Boolean] operator[SEP] identifier[condition] operator[SEP] , identifier[mqlinkName]
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[condition] operator[SEP] {
identifier[SIMPNotPossibleInCurrentConfigurationException] identifier[e] operator[=] Keyword[new] identifier[SIMPNotPossibleInCurrentConfigurationException] operator[SEP] identifier[nls_cwsik] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[mqlinkName] , identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] , identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineBus] operator[SEP] operator[SEP]
} , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setExceptionInserts] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[mqlinkName] , identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] , identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineBus] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setExceptionReason] operator[SEP] identifier[SIRCConstants] operator[SEP] identifier[SIRC0042_MQ_LINK_NOT_FOUND_ERROR] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] 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[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] 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] operator[SEP] operator[SEP]
}
|
@Override public PersistentTreeMap<K,V> assoc(K key, V val) {
Box<Node<K,V>> found = new Box<>(null);
Node<K,V> t = add(tree, key, val, found);
//null == already contains key
if (t == null) {
Node<K,V> foundNode = found.val;
//note only get same collection on identity of val, not equals()
if (foundNode.getValue() == val) {
return this;
}
return new PersistentTreeMap<>(comp, replace(tree, key, val), size);
}
return new PersistentTreeMap<>(comp, t.blacken(), size + 1);
}
|
class class_name[name] begin[{]
method[assoc, return_type[type[PersistentTreeMap]], modifier[public], parameter[key, val]] begin[{]
local_variable[type[Box], found]
local_variable[type[Node], t]
if[binary_operation[member[.t], ==, literal[null]]] begin[{]
local_variable[type[Node], foundNode]
if[binary_operation[call[foundNode.getValue, parameter[]], ==, member[.val]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=size, 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=PersistentTreeMap, sub_type=None))]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=blacken, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=PersistentTreeMap, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[PersistentTreeMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[assoc] operator[SEP] identifier[K] identifier[key] , identifier[V] identifier[val] operator[SEP] {
identifier[Box] operator[<] identifier[Node] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[found] operator[=] Keyword[new] identifier[Box] operator[<] operator[>] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[Node] operator[<] identifier[K] , identifier[V] operator[>] identifier[t] operator[=] identifier[add] operator[SEP] identifier[tree] , identifier[key] , identifier[val] , identifier[found] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[==] Other[null] operator[SEP] {
identifier[Node] operator[<] identifier[K] , identifier[V] operator[>] identifier[foundNode] operator[=] identifier[found] operator[SEP] identifier[val] operator[SEP] Keyword[if] operator[SEP] identifier[foundNode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] identifier[val] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP]
}
Keyword[return] Keyword[new] identifier[PersistentTreeMap] operator[<] operator[>] operator[SEP] identifier[comp] , identifier[replace] operator[SEP] identifier[tree] , identifier[key] , identifier[val] operator[SEP] , identifier[size] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[PersistentTreeMap] operator[<] operator[>] operator[SEP] identifier[comp] , identifier[t] operator[SEP] identifier[blacken] operator[SEP] operator[SEP] , identifier[size] operator[+] Other[1] operator[SEP] operator[SEP]
}
|
@SuppressWarnings({"unchecked"})
Set<Class<? extends TrailExceptionHandler<?>>> findTrailExceptionHandlers() {
Set<Class<? extends TrailExceptionHandler<?>>> trailExceptionHandlers = auditConfig.getExceptionHandlers();
if (trailExceptionHandlers.isEmpty()) {
Collection<Class<?>> scannedTrailExceptionHandlers = auditClasses.get(TrailExceptionHandler.class);
LOGGER.info("No audit TrailExceptionHandler specified, using every handler found");
Set<Class<? extends TrailExceptionHandler<?>>> foundExceptionHandlers = new HashSet<>();
for (Class<?> scannedTrailExceptionHandler : scannedTrailExceptionHandlers) {
foundExceptionHandlers.add((Class<? extends TrailExceptionHandler<?>>) scannedTrailExceptionHandler);
LOGGER.info("Registered audit exception handler {}", scannedTrailExceptionHandler);
}
return foundExceptionHandlers;
} else {
return trailExceptionHandlers;
}
}
|
class class_name[name] begin[{]
method[findTrailExceptionHandlers, return_type[type[Set]], modifier[default], parameter[]] begin[{]
local_variable[type[Set], trailExceptionHandlers]
if[call[trailExceptionHandlers.isEmpty, parameter[]]] begin[{]
local_variable[type[Collection], scannedTrailExceptionHandlers]
call[LOGGER.info, parameter[literal["No audit TrailExceptionHandler specified, using every handler found"]]]
local_variable[type[Set], foundExceptionHandlers]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=scannedTrailExceptionHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=TrailExceptionHandler, sub_type=None))], dimensions=[], name=Class, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=foundExceptionHandlers, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Registered audit exception handler {}"), MemberReference(member=scannedTrailExceptionHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=scannedTrailExceptionHandlers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=scannedTrailExceptionHandler)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None)
return[member[.foundExceptionHandlers]]
else begin[{]
return[member[.trailExceptionHandlers]]
end[}]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String]
} operator[SEP] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[TrailExceptionHandler] operator[<] operator[?] operator[>] operator[>] operator[>] identifier[findTrailExceptionHandlers] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[TrailExceptionHandler] operator[<] operator[?] operator[>] operator[>] operator[>] identifier[trailExceptionHandlers] operator[=] identifier[auditConfig] operator[SEP] identifier[getExceptionHandlers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trailExceptionHandlers] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[Collection] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[scannedTrailExceptionHandlers] operator[=] identifier[auditClasses] operator[SEP] identifier[get] operator[SEP] identifier[TrailExceptionHandler] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[TrailExceptionHandler] operator[<] operator[?] operator[>] operator[>] operator[>] identifier[foundExceptionHandlers] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[scannedTrailExceptionHandler] operator[:] identifier[scannedTrailExceptionHandlers] operator[SEP] {
identifier[foundExceptionHandlers] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[TrailExceptionHandler] operator[<] operator[?] operator[>] operator[>] operator[SEP] identifier[scannedTrailExceptionHandler] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[scannedTrailExceptionHandler] operator[SEP] operator[SEP]
}
Keyword[return] identifier[foundExceptionHandlers] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[trailExceptionHandlers] operator[SEP]
}
}
|
synchronized public long generateId48() {
final long blockSize = 1000L; // block 1000 ms
long timestamp = System.currentTimeMillis() / blockSize;
long sequence = 0;
boolean done = false;
while (!done) {
done = true;
while (timestamp < lastTimestampMillisec.get() / blockSize) {
timestamp = waitTillNextSecond(timestamp);
}
if (timestamp == lastTimestampMillisec.get() / blockSize) {
// increase sequence
sequence = sequenceMillisec.incrementAndGet();
if (sequence > MAX_SEQUENCE_48) {
// reset sequence
sequenceMillisec.set(sequence = 0);
timestamp = waitTillNextSecond(timestamp);
done = false;
}
}
}
sequenceMillisec.set(sequence);
lastTimestampMillisec.set(timestamp * blockSize);
timestamp = ((timestamp * blockSize - TIMESTAMP_EPOCH) / blockSize) & MASK_TIMESTAMP_48;
return timestamp << SHIFT_TIMESTAMP_48 | template48 | (sequence & MASK_SEQUENCE_48);
}
|
class class_name[name] begin[{]
method[generateId48, return_type[type[long]], modifier[synchronized public], parameter[]] begin[{]
local_variable[type[long], blockSize]
local_variable[type[long], timestamp]
local_variable[type[long], sequence]
local_variable[type[boolean], done]
while[member[.done]] begin[{]
assign[member[.done], literal[true]]
while[binary_operation[member[.timestamp], <, binary_operation[call[lastTimestampMillisec.get, parameter[]], /, member[.blockSize]]]] begin[{]
assign[member[.timestamp], call[.waitTillNextSecond, parameter[member[.timestamp]]]]
end[}]
if[binary_operation[member[.timestamp], ==, binary_operation[call[lastTimestampMillisec.get, parameter[]], /, member[.blockSize]]]] begin[{]
assign[member[.sequence], call[sequenceMillisec.incrementAndGet, parameter[]]]
if[binary_operation[member[.sequence], >, member[.MAX_SEQUENCE_48]]] begin[{]
call[sequenceMillisec.set, parameter[assign[member[.sequence], literal[0]]]]
assign[member[.timestamp], call[.waitTillNextSecond, parameter[member[.timestamp]]]]
assign[member[.done], literal[false]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
call[sequenceMillisec.set, parameter[member[.sequence]]]
call[lastTimestampMillisec.set, parameter[binary_operation[member[.timestamp], *, member[.blockSize]]]]
assign[member[.timestamp], binary_operation[binary_operation[binary_operation[binary_operation[member[.timestamp], *, member[.blockSize]], -, member[.TIMESTAMP_EPOCH]], /, member[.blockSize]], &, member[.MASK_TIMESTAMP_48]]]
return[binary_operation[binary_operation[binary_operation[member[.timestamp], <<, member[.SHIFT_TIMESTAMP_48]], |, member[.template48]], |, binary_operation[member[.sequence], &, member[.MASK_SEQUENCE_48]]]]
end[}]
END[}]
|
Keyword[synchronized] Keyword[public] Keyword[long] identifier[generateId48] operator[SEP] operator[SEP] {
Keyword[final] Keyword[long] identifier[blockSize] operator[=] Other[1000L] operator[SEP] Keyword[long] identifier[timestamp] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[/] identifier[blockSize] operator[SEP] Keyword[long] identifier[sequence] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[done] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[done] operator[SEP] {
identifier[done] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[timestamp] operator[<] identifier[lastTimestampMillisec] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[/] identifier[blockSize] operator[SEP] {
identifier[timestamp] operator[=] identifier[waitTillNextSecond] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[timestamp] operator[==] identifier[lastTimestampMillisec] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[/] identifier[blockSize] operator[SEP] {
identifier[sequence] operator[=] identifier[sequenceMillisec] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sequence] operator[>] identifier[MAX_SEQUENCE_48] operator[SEP] {
identifier[sequenceMillisec] operator[SEP] identifier[set] operator[SEP] identifier[sequence] operator[=] Other[0] operator[SEP] operator[SEP] identifier[timestamp] operator[=] identifier[waitTillNextSecond] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] identifier[done] operator[=] literal[boolean] operator[SEP]
}
}
}
identifier[sequenceMillisec] operator[SEP] identifier[set] operator[SEP] identifier[sequence] operator[SEP] operator[SEP] identifier[lastTimestampMillisec] operator[SEP] identifier[set] operator[SEP] identifier[timestamp] operator[*] identifier[blockSize] operator[SEP] operator[SEP] identifier[timestamp] operator[=] operator[SEP] operator[SEP] identifier[timestamp] operator[*] identifier[blockSize] operator[-] identifier[TIMESTAMP_EPOCH] operator[SEP] operator[/] identifier[blockSize] operator[SEP] operator[&] identifier[MASK_TIMESTAMP_48] operator[SEP] Keyword[return] identifier[timestamp] operator[<<] identifier[SHIFT_TIMESTAMP_48] operator[|] identifier[template48] operator[|] operator[SEP] identifier[sequence] operator[&] identifier[MASK_SEQUENCE_48] operator[SEP] operator[SEP]
}
|
public String buildProtocolConnectOptionsString(String serverURI, boolean includeAuth, byte[] nonce) {
StringBuilder connectString = new StringBuilder();
connectString.append("{");
appendOption(connectString, Options.OPTION_LANG, Nats.CLIENT_LANGUAGE, true, false);
appendOption(connectString, Options.OPTION_VERSION, Nats.CLIENT_VERSION, true, true);
if (this.connectionName != null) {
appendOption(connectString, Options.OPTION_NAME, this.connectionName, true, true);
}
appendOption(connectString, Options.OPTION_PROTOCOL, "1", false, true);
appendOption(connectString, Options.OPTION_VERBOSE, String.valueOf(this.isVerbose()), false, true);
appendOption(connectString, Options.OPTION_PEDANTIC, String.valueOf(this.isPedantic()), false, true);
appendOption(connectString, Options.OPTION_TLS_REQUIRED, String.valueOf(this.isTLSRequired()), false, true);
appendOption(connectString, Options.OPTION_ECHO, String.valueOf(!this.isNoEcho()), false, true);
if (includeAuth && nonce != null && this.getAuthHandler() != null) {
char[] nkey = this.getAuthHandler().getID();
byte[] sig = this.getAuthHandler().sign(nonce);
char[] jwt = this.getAuthHandler().getJWT();
if (sig == null) {
sig = new byte[0];
}
if (jwt == null) {
jwt = new char[0];
}
if (nkey == null) {
nkey = new char[0];
}
String encodedSig = Base64.getUrlEncoder().withoutPadding().encodeToString(sig);
appendOption(connectString, Options.OPTION_NKEY, new String(nkey), true, true); // public key to string is ok
appendOption(connectString, Options.OPTION_SIG, encodedSig, true, true);
appendOption(connectString, Options.OPTION_JWT, new String(jwt), true, true); // public JWT to string is ok
} else if (includeAuth) {
String uriUser = null;
String uriPass = null;
String uriToken = null;
// Values from URI override options
try {
URI uri = this.createURIForServer(serverURI);
String userInfo = uri.getUserInfo();
if (userInfo != null) {
String[] info = userInfo.split(":");
if (info.length == 2) {
uriUser = info[0];
uriPass = info[1];
} else {
uriToken = userInfo;
}
}
} catch(URISyntaxException e) {
uriUser = uriToken = uriPass = null;
}
if (uriUser != null) {
appendOption(connectString, Options.OPTION_USER, uriUser, true, true);
} else if (this.username != null) {
appendOption(connectString, Options.OPTION_USER, this.username, true, true);
}
if (uriPass != null) {
appendOption(connectString, Options.OPTION_PASSWORD, uriPass, true, true);
} else if (this.password != null) {
appendOption(connectString, Options.OPTION_PASSWORD, this.password, true, true);
}
if (uriToken != null) {
appendOption(connectString, Options.OPTION_AUTH_TOKEN, uriToken, true, true);
} else if (this.token != null) {
appendOption(connectString, Options.OPTION_AUTH_TOKEN, this.token, true, true);
}
}
connectString.append("}");
return connectString.toString();
}
|
class class_name[name] begin[{]
method[buildProtocolConnectOptionsString, return_type[type[String]], modifier[public], parameter[serverURI, includeAuth, nonce]] begin[{]
local_variable[type[StringBuilder], connectString]
call[connectString.append, parameter[literal["{"]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_LANG], member[Nats.CLIENT_LANGUAGE], literal[true], literal[false]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_VERSION], member[Nats.CLIENT_VERSION], literal[true], literal[true]]]
if[binary_operation[THIS[member[None.connectionName]], !=, literal[null]]] begin[{]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_NAME], THIS[member[None.connectionName]], literal[true], literal[true]]]
else begin[{]
None
end[}]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_PROTOCOL], literal["1"], literal[false], literal[true]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_VERBOSE], call[String.valueOf, parameter[THIS[call[None.isVerbose, parameter[]]]]], literal[false], literal[true]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_PEDANTIC], call[String.valueOf, parameter[THIS[call[None.isPedantic, parameter[]]]]], literal[false], literal[true]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_TLS_REQUIRED], call[String.valueOf, parameter[THIS[call[None.isTLSRequired, parameter[]]]]], literal[false], literal[true]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_ECHO], call[String.valueOf, parameter[THIS[call[None.isNoEcho, parameter[]]]]], literal[false], literal[true]]]
if[binary_operation[binary_operation[member[.includeAuth], &&, binary_operation[member[.nonce], !=, literal[null]]], &&, binary_operation[THIS[call[None.getAuthHandler, parameter[]]], !=, literal[null]]]] begin[{]
local_variable[type[char], nkey]
local_variable[type[byte], sig]
local_variable[type[char], jwt]
if[binary_operation[member[.sig], ==, literal[null]]] begin[{]
assign[member[.sig], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))]
else begin[{]
None
end[}]
if[binary_operation[member[.jwt], ==, literal[null]]] begin[{]
assign[member[.jwt], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char))]
else begin[{]
None
end[}]
if[binary_operation[member[.nkey], ==, literal[null]]] begin[{]
assign[member[.nkey], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char))]
else begin[{]
None
end[}]
local_variable[type[String], encodedSig]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_NKEY], ClassCreator(arguments=[MemberReference(member=nkey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), literal[true], literal[true]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_SIG], member[.encodedSig], literal[true], literal[true]]]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_JWT], ClassCreator(arguments=[MemberReference(member=jwt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), literal[true], literal[true]]]
else begin[{]
if[member[.includeAuth]] begin[{]
local_variable[type[String], uriUser]
local_variable[type[String], uriPass]
local_variable[type[String], uriToken]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=serverURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createURIForServer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUserInfo, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), name=userInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=userInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=split, postfix_operators=[], prefix_operators=[], qualifier=userInfo, selectors=[], type_arguments=None), name=info)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uriToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=userInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uriUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=uriPass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uriUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Assignment(expressionl=MemberReference(member=uriToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Assignment(expressionl=MemberReference(member=uriPass, 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=['URISyntaxException']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.uriUser], !=, literal[null]]] begin[{]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_USER], member[.uriUser], literal[true], literal[true]]]
else begin[{]
if[binary_operation[THIS[member[None.username]], !=, literal[null]]] begin[{]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_USER], THIS[member[None.username]], literal[true], literal[true]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.uriPass], !=, literal[null]]] begin[{]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_PASSWORD], member[.uriPass], literal[true], literal[true]]]
else begin[{]
if[binary_operation[THIS[member[None.password]], !=, literal[null]]] begin[{]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_PASSWORD], THIS[member[None.password]], literal[true], literal[true]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.uriToken], !=, literal[null]]] begin[{]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_AUTH_TOKEN], member[.uriToken], literal[true], literal[true]]]
else begin[{]
if[binary_operation[THIS[member[None.token]], !=, literal[null]]] begin[{]
call[.appendOption, parameter[member[.connectString], member[Options.OPTION_AUTH_TOKEN], THIS[member[None.token]], literal[true], literal[true]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
call[connectString.append, parameter[literal["}"]]]
return[call[connectString.toString, parameter[]]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[buildProtocolConnectOptionsString] operator[SEP] identifier[String] identifier[serverURI] , Keyword[boolean] identifier[includeAuth] , Keyword[byte] operator[SEP] operator[SEP] identifier[nonce] operator[SEP] {
identifier[StringBuilder] identifier[connectString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[connectString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_LANG] , identifier[Nats] operator[SEP] identifier[CLIENT_LANGUAGE] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_VERSION] , identifier[Nats] operator[SEP] identifier[CLIENT_VERSION] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[connectionName] operator[!=] Other[null] operator[SEP] {
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_NAME] , Keyword[this] operator[SEP] identifier[connectionName] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_PROTOCOL] , literal[String] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_VERBOSE] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[isVerbose] operator[SEP] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_PEDANTIC] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[isPedantic] operator[SEP] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_TLS_REQUIRED] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[isTLSRequired] operator[SEP] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_ECHO] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[isNoEcho] operator[SEP] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[includeAuth] operator[&&] identifier[nonce] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[getAuthHandler] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[char] operator[SEP] operator[SEP] identifier[nkey] operator[=] Keyword[this] operator[SEP] identifier[getAuthHandler] operator[SEP] operator[SEP] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[sig] operator[=] Keyword[this] operator[SEP] identifier[getAuthHandler] operator[SEP] operator[SEP] operator[SEP] identifier[sign] operator[SEP] identifier[nonce] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[jwt] operator[=] Keyword[this] operator[SEP] identifier[getAuthHandler] operator[SEP] operator[SEP] operator[SEP] identifier[getJWT] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sig] operator[==] Other[null] operator[SEP] {
identifier[sig] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[jwt] operator[==] Other[null] operator[SEP] {
identifier[jwt] operator[=] Keyword[new] Keyword[char] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[nkey] operator[==] Other[null] operator[SEP] {
identifier[nkey] operator[=] Keyword[new] Keyword[char] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[String] identifier[encodedSig] operator[=] identifier[Base64] operator[SEP] identifier[getUrlEncoder] operator[SEP] operator[SEP] operator[SEP] identifier[withoutPadding] operator[SEP] operator[SEP] operator[SEP] identifier[encodeToString] operator[SEP] identifier[sig] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_NKEY] , Keyword[new] identifier[String] operator[SEP] identifier[nkey] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_SIG] , identifier[encodedSig] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_JWT] , Keyword[new] identifier[String] operator[SEP] identifier[jwt] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[includeAuth] operator[SEP] {
identifier[String] identifier[uriUser] operator[=] Other[null] operator[SEP] identifier[String] identifier[uriPass] operator[=] Other[null] operator[SEP] identifier[String] identifier[uriToken] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[URI] identifier[uri] operator[=] Keyword[this] operator[SEP] identifier[createURIForServer] operator[SEP] identifier[serverURI] operator[SEP] operator[SEP] identifier[String] identifier[userInfo] operator[=] identifier[uri] operator[SEP] identifier[getUserInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userInfo] operator[!=] Other[null] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[info] operator[=] identifier[userInfo] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[info] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] {
identifier[uriUser] operator[=] identifier[info] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[uriPass] operator[=] identifier[info] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[uriToken] operator[=] identifier[userInfo] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] {
identifier[uriUser] operator[=] identifier[uriToken] operator[=] identifier[uriPass] operator[=] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[uriUser] operator[!=] Other[null] operator[SEP] {
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_USER] , identifier[uriUser] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[username] operator[!=] Other[null] operator[SEP] {
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_USER] , Keyword[this] operator[SEP] identifier[username] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[uriPass] operator[!=] Other[null] operator[SEP] {
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_PASSWORD] , identifier[uriPass] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[password] operator[!=] Other[null] operator[SEP] {
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_PASSWORD] , Keyword[this] operator[SEP] identifier[password] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[uriToken] operator[!=] Other[null] operator[SEP] {
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_AUTH_TOKEN] , identifier[uriToken] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[token] operator[!=] Other[null] operator[SEP] {
identifier[appendOption] operator[SEP] identifier[connectString] , identifier[Options] operator[SEP] identifier[OPTION_AUTH_TOKEN] , Keyword[this] operator[SEP] identifier[token] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
}
identifier[connectString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[connectString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public MappedBuffer map(int offset, int size) {
return map(offset, size, FileChannel.MapMode.READ_WRITE);
}
|
class class_name[name] begin[{]
method[map, return_type[type[MappedBuffer]], modifier[public], parameter[offset, size]] begin[{]
return[call[.map, parameter[member[.offset], member[.size], member[FileChannel.MapMode.READ_WRITE]]]]
end[}]
END[}]
|
Keyword[public] identifier[MappedBuffer] identifier[map] operator[SEP] Keyword[int] identifier[offset] , Keyword[int] identifier[size] operator[SEP] {
Keyword[return] identifier[map] operator[SEP] identifier[offset] , identifier[size] , identifier[FileChannel] operator[SEP] identifier[MapMode] operator[SEP] identifier[READ_WRITE] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("UnstableApiUsage")
private void computeProjectDependencies(IdeaModule module) {
ARTIFACT_DEPS_OF_PRJ.computeIfAbsent(module.getName(), moduleName -> {
Map<String, Set<ArtifactSpec>> dependencies = new HashMap<>();
module.getDependencies().forEach(dep -> {
if (dep instanceof IdeaModuleDependency) {
// Add the dependency to the list.
String name = ((IdeaModuleDependency) dep).getTargetModuleName();
PRJ_DEPS_OF_PRJ.computeIfAbsent(moduleName, key -> new HashSet<>()).add(name);
} else if (dep instanceof ExternalDependency) {
ExternalDependency extDep = (ExternalDependency) dep;
GradleModuleVersion gav = extDep.getGradleModuleVersion();
ArtifactSpec spec = new ArtifactSpec("compile", gav.getGroup(), gav.getName(), gav.getVersion(),
"jar", null, extDep.getFile());
String depScope = dep.getScope().getScope();
dependencies.computeIfAbsent(depScope, s -> new HashSet<>()).add(spec);
}
});
return dependencies;
});
}
|
class class_name[name] begin[{]
method[computeProjectDependencies, return_type[void], modifier[private], parameter[module]] begin[{]
call[ARTIFACT_DEPS_OF_PRJ.computeIfAbsent, parameter[call[module.getName, parameter[]], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), name=dependencies)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ArtifactSpec, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getDependencies, postfix_operators=[], prefix_operators=[], qualifier=module, selectors=[MethodInvocation(arguments=[LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IdeaModuleDependency, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ExternalDependency, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=dep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ExternalDependency, sub_type=None)), name=extDep)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExternalDependency, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGradleModuleVersion, postfix_operators=[], prefix_operators=[], qualifier=extDep, selectors=[], type_arguments=None), name=gav)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GradleModuleVersion, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="compile"), MethodInvocation(arguments=[], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=gav, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=gav, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getVersion, postfix_operators=[], prefix_operators=[], qualifier=gav, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="jar"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=extDep, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArtifactSpec, sub_type=None)), name=spec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ArtifactSpec, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getScope, postfix_operators=[], prefix_operators=[], qualifier=dep, selectors=[MethodInvocation(arguments=[], member=getScope, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=depScope)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=depScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None)), parameters=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=computeIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=dependencies, selectors=[MethodInvocation(arguments=[MemberReference(member=spec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=dep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IdeaModuleDependency, sub_type=None)), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None)), parameters=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=computeIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=PRJ_DEPS_OF_PRJ, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], parameters=[MemberReference(member=dep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=forEach, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=dependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[computeProjectDependencies] operator[SEP] identifier[IdeaModule] identifier[module] operator[SEP] {
identifier[ARTIFACT_DEPS_OF_PRJ] operator[SEP] identifier[computeIfAbsent] operator[SEP] identifier[module] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[moduleName] operator[->] {
identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[ArtifactSpec] operator[>] operator[>] identifier[dependencies] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[module] operator[SEP] identifier[getDependencies] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[dep] operator[->] {
Keyword[if] operator[SEP] identifier[dep] Keyword[instanceof] identifier[IdeaModuleDependency] operator[SEP] {
identifier[String] identifier[name] operator[=] operator[SEP] operator[SEP] identifier[IdeaModuleDependency] operator[SEP] identifier[dep] operator[SEP] operator[SEP] identifier[getTargetModuleName] operator[SEP] operator[SEP] operator[SEP] identifier[PRJ_DEPS_OF_PRJ] operator[SEP] identifier[computeIfAbsent] operator[SEP] identifier[moduleName] , identifier[key] operator[->] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dep] Keyword[instanceof] identifier[ExternalDependency] operator[SEP] {
identifier[ExternalDependency] identifier[extDep] operator[=] operator[SEP] identifier[ExternalDependency] operator[SEP] identifier[dep] operator[SEP] identifier[GradleModuleVersion] identifier[gav] operator[=] identifier[extDep] operator[SEP] identifier[getGradleModuleVersion] operator[SEP] operator[SEP] operator[SEP] identifier[ArtifactSpec] identifier[spec] operator[=] Keyword[new] identifier[ArtifactSpec] operator[SEP] literal[String] , identifier[gav] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] , identifier[gav] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[gav] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] , literal[String] , Other[null] , identifier[extDep] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[depScope] operator[=] identifier[dep] operator[SEP] identifier[getScope] operator[SEP] operator[SEP] operator[SEP] identifier[getScope] operator[SEP] operator[SEP] operator[SEP] identifier[dependencies] operator[SEP] identifier[computeIfAbsent] operator[SEP] identifier[depScope] , identifier[s] operator[->] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[spec] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[return] identifier[dependencies] operator[SEP]
} operator[SEP] operator[SEP]
}
|
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher setFacet(@NonNull String attribute, boolean isDisjunctive) {
if (isDisjunctive && !disjunctiveFacets.contains(attribute)) {
disjunctiveFacets.add(attribute);
} else {
disjunctiveFacets.remove(attribute);
}
return this;
}
|
class class_name[name] begin[{]
method[setFacet, return_type[type[Searcher]], modifier[public], parameter[attribute, isDisjunctive]] begin[{]
if[binary_operation[member[.isDisjunctive], &&, call[disjunctiveFacets.contains, parameter[member[.attribute]]]]] begin[{]
call[disjunctiveFacets.add, parameter[member[.attribute]]]
else begin[{]
call[disjunctiveFacets.remove, parameter[member[.attribute]]]
end[}]
return[THIS[]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[public] identifier[Searcher] identifier[setFacet] operator[SEP] annotation[@] identifier[NonNull] identifier[String] identifier[attribute] , Keyword[boolean] identifier[isDisjunctive] operator[SEP] {
Keyword[if] operator[SEP] identifier[isDisjunctive] operator[&&] operator[!] identifier[disjunctiveFacets] operator[SEP] identifier[contains] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] {
identifier[disjunctiveFacets] operator[SEP] identifier[add] operator[SEP] identifier[attribute] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[disjunctiveFacets] operator[SEP] identifier[remove] operator[SEP] identifier[attribute] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public void combine(Iterator<Record> records, Collector<Record> out) throws Exception {
// to be implemented, if the reducer should use a combiner. Note that the combining method
// is only used, if the stub class is further annotated with the annotation
// @ReduceOperator.Combinable
reduce(records, out);
}
|
class class_name[name] begin[{]
method[combine, return_type[void], modifier[public], parameter[records, out]] begin[{]
call[.reduce, parameter[member[.records], member[.out]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[combine] operator[SEP] identifier[Iterator] operator[<] identifier[Record] operator[>] identifier[records] , identifier[Collector] operator[<] identifier[Record] operator[>] identifier[out] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[reduce] operator[SEP] identifier[records] , identifier[out] operator[SEP] operator[SEP]
}
|
public Column getColumn(int ordinalPosition) throws NoRowException, SQLException {
try {
return getColumns().get(ordinalPosition-1);
} catch(IndexOutOfBoundsException exc) {
throw new NoRowException(exc);
}
}
|
class class_name[name] begin[{]
method[getColumn, return_type[type[Column]], modifier[public], parameter[ordinalPosition]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=ordinalPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exc, 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=NoRowException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['IndexOutOfBoundsException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] identifier[Column] identifier[getColumn] operator[SEP] Keyword[int] identifier[ordinalPosition] operator[SEP] Keyword[throws] identifier[NoRowException] , identifier[SQLException] {
Keyword[try] {
Keyword[return] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[ordinalPosition] operator[-] Other[1] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IndexOutOfBoundsException] identifier[exc] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NoRowException] operator[SEP] identifier[exc] operator[SEP] operator[SEP]
}
}
|
public static NetcdfFile getNetcdfFile(HttpServletRequest request, HttpServletResponse response, String path) throws IOException {
TdsRequestedDataset trd = new TdsRequestedDataset(request, null);
if (path != null) trd.path = path;
return trd.openAsNetcdfFile(request, response);
}
|
class class_name[name] begin[{]
method[getNetcdfFile, return_type[type[NetcdfFile]], modifier[public static], parameter[request, response, path]] begin[{]
local_variable[type[TdsRequestedDataset], trd]
if[binary_operation[member[.path], !=, literal[null]]] begin[{]
assign[member[trd.path], member[.path]]
else begin[{]
None
end[}]
return[call[trd.openAsNetcdfFile, parameter[member[.request], member[.response]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[NetcdfFile] identifier[getNetcdfFile] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] , identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[TdsRequestedDataset] identifier[trd] operator[=] Keyword[new] identifier[TdsRequestedDataset] operator[SEP] identifier[request] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] identifier[trd] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] Keyword[return] identifier[trd] operator[SEP] identifier[openAsNetcdfFile] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP]
}
|
public ServiceFuture<List<VpnConnectionInner>> listByVpnGatewayNextAsync(final String nextPageLink, final ServiceFuture<List<VpnConnectionInner>> serviceFuture, final ListOperationCallback<VpnConnectionInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByVpnGatewayNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<VpnConnectionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<VpnConnectionInner>>> call(String nextPageLink) {
return listByVpnGatewayNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
|
class class_name[name] begin[{]
method[listByVpnGatewayNextAsync, return_type[type[ServiceFuture]], modifier[public], parameter[nextPageLink, serviceFuture, serviceCallback]] begin[{]
return[call[AzureServiceFuture.fromPageResponse, parameter[call[.listByVpnGatewayNextSinglePageAsync, parameter[member[.nextPageLink]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listByVpnGatewayNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=VpnConnectionInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=VpnConnectionInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None))], dimensions=None, name=Func1, sub_type=None)), member[.serviceCallback]]]]
end[}]
END[}]
|
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[VpnConnectionInner] operator[>] operator[>] identifier[listByVpnGatewayNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] , Keyword[final] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[VpnConnectionInner] operator[>] operator[>] identifier[serviceFuture] , Keyword[final] identifier[ListOperationCallback] operator[<] identifier[VpnConnectionInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[listByVpnGatewayNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VpnConnectionInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VpnConnectionInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] {
Keyword[return] identifier[listByVpnGatewayNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP]
}
} , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public static Image newActionImage (String path, ClickHandler onClick)
{
return newActionImage(path, null, onClick);
}
|
class class_name[name] begin[{]
method[newActionImage, return_type[type[Image]], modifier[public static], parameter[path, onClick]] begin[{]
return[call[.newActionImage, parameter[member[.path], literal[null], member[.onClick]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Image] identifier[newActionImage] operator[SEP] identifier[String] identifier[path] , identifier[ClickHandler] identifier[onClick] operator[SEP] {
Keyword[return] identifier[newActionImage] operator[SEP] identifier[path] , Other[null] , identifier[onClick] operator[SEP] operator[SEP]
}
|
public static boolean isWellFormed(byte[] bytes, int off, int len) {
int end = off + len;
checkPositionIndexes(off, end, bytes.length);
// Look for the first non-ASCII character.
for (int i = off; i < end; i++) {
if (bytes[i] < 0) {
return isWellFormedSlowPath(bytes, i, end);
}
}
return true;
}
|
class class_name[name] begin[{]
method[isWellFormed, return_type[type[boolean]], modifier[public static], parameter[bytes, off, len]] begin[{]
local_variable[type[int], end]
call[.checkPositionIndexes, parameter[member[.off], member[.end], member[bytes.length]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bytes, 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=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWellFormedSlowPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=off, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[isWellFormed] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] {
Keyword[int] identifier[end] operator[=] identifier[off] operator[+] identifier[len] operator[SEP] identifier[checkPositionIndexes] operator[SEP] identifier[off] , identifier[end] , identifier[bytes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[off] operator[SEP] identifier[i] operator[<] identifier[end] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[bytes] operator[SEP] identifier[i] operator[SEP] operator[<] Other[0] operator[SEP] {
Keyword[return] identifier[isWellFormedSlowPath] operator[SEP] identifier[bytes] , identifier[i] , identifier[end] operator[SEP] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static void initialize(final Context context, final String clientId, String clientSecret) {
try {
WonderPush.logDebug("initialize(" + context.getClass().getSimpleName() + ", " + clientId + ", <redacted clientSecret>)");
if (!sIsInitialized || (
clientId != null && clientSecret != null && (!clientId.equals(sClientId) || !clientSecret.equals(sClientSecret))
)) {
sIsInitialized = false;
setNetworkAvailable(false);
sApplicationContext = context.getApplicationContext();
sClientId = clientId;
sClientSecret = clientSecret;
sBaseURL = PRODUCTION_API_URL;
if (sSenderId == null) {
sSenderId = WonderPushFirebaseMessagingService.getDefaultSenderId();
if (WonderPushFirebaseMessagingService.WONDERPUSH_DEFAULT_SENDER_ID.equals(sSenderId)) {
Log.w(TAG, "Using WonderPush own Firebase FCM Sender ID " + sSenderId + ". Your push tokens will not be portable. Please refer to the documentation.");
} else {
logDebug("Using senderId from Firebase: " + sSenderId);
}
}
WonderPush.logDebug("Initializing FirebaseApp…");
try {
sFirebaseApp = FirebaseApp.initializeApp(
sApplicationContext,
new FirebaseOptions.Builder()
.setApplicationId("NONE")
.setApiKey("NONE")
.setGcmSenderId(sSenderId)
.build(),
FIREBASE_APP_NAME
);
WonderPush.logDebug("Initialized FirebaseApp");
} catch (IllegalStateException alreadyInitialized) {
WonderPush.logError("FirebaseApp already initialized", alreadyInitialized);
sFirebaseApp = FirebaseApp.getInstance(FIREBASE_APP_NAME);
}
WonderPushConfiguration.initialize(getApplicationContext());
WonderPushUserPreferences.initialize();
applyOverrideLogging(WonderPushConfiguration.getOverrideSetLogging());
JSONSyncInstallationCustom.initialize();
WonderPushRequestVault.initialize();
initForNewUser(sBeforeInitializationUserIdSet
? sBeforeInitializationUserId
: WonderPushConfiguration.getUserId());
sIsInitialized = true;
hasUserConsentChanged(hasUserConsent()); // make sure to set sIsInitialized=true before
// Permission checks
if (context.getPackageManager().checkPermission(android.Manifest.permission.INTERNET, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
Log.w(TAG, "Missing INTERNET permission. Add <uses-permission android:name=\"android.permission.INTERNET\" /> under <manifest> in your AndroidManifest.xml");
}
if (context.getPackageManager().checkPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION, context.getPackageName()) != PackageManager.PERMISSION_GRANTED
&& context.getPackageManager().checkPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Log.w(TAG, "Permissions ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION have not been declared or granted yet. Make sure you declare <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both), and call ActivityCompat.requestPermissions() to request the permission at runtime");
} else {
Log.w(TAG, "Missing ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permission. Add <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both)");
}
} else if (context.getPackageManager().checkPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "Only ACCESS_COARSE_LOCATION permission is granted. For more precision, you should strongly consider adding <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml");
}
}
initializeForApplication(context);
initializeForActivity(context);
} catch (Exception e) {
Log.e(TAG, "Unexpected error while initializing the SDK", e);
}
}
|
class class_name[name] begin[{]
method[initialize, return_type[void], modifier[public static], parameter[context, clientId, clientSecret]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="initialize("), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), operator=+), operandr=MemberReference(member=clientId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", <redacted clientSecret>)"), operator=+)], member=logDebug, postfix_operators=[], prefix_operators=[], qualifier=WonderPush, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sIsInitialized, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=clientId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=clientSecret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=sClientId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=clientId, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=sClientSecret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=clientSecret, selectors=[], type_arguments=None), operator=||), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sIsInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setNetworkAvailable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sApplicationContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getApplicationContext, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sClientId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=clientId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sClientSecret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=clientSecret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sBaseURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=PRODUCTION_API_URL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sSenderId, 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=sSenderId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDefaultSenderId, postfix_operators=[], prefix_operators=[], qualifier=WonderPushFirebaseMessagingService, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sSenderId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=WonderPushFirebaseMessagingService.WONDERPUSH_DEFAULT_SENDER_ID, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Using senderId from Firebase: "), operandr=MemberReference(member=sSenderId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=logDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Using WonderPush own Firebase FCM Sender ID "), operandr=MemberReference(member=sSenderId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Your push tokens will not be portable. Please refer to the documentation."), operator=+)], member=w, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Initializing FirebaseApp…")], member=logDebug, postfix_operators=[], prefix_operators=[], qualifier=WonderPush, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sFirebaseApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=sApplicationContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NONE")], member=setApplicationId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NONE")], member=setApiKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=sSenderId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setGcmSenderId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FirebaseOptions, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))), MemberReference(member=FIREBASE_APP_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initializeApp, postfix_operators=[], prefix_operators=[], qualifier=FirebaseApp, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Initialized FirebaseApp")], member=logDebug, postfix_operators=[], prefix_operators=[], qualifier=WonderPush, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FirebaseApp already initialized"), MemberReference(member=alreadyInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logError, postfix_operators=[], prefix_operators=[], qualifier=WonderPush, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sFirebaseApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=FIREBASE_APP_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=FirebaseApp, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=alreadyInitialized, types=['IllegalStateException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getApplicationContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=initialize, postfix_operators=[], prefix_operators=[], qualifier=WonderPushConfiguration, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=initialize, postfix_operators=[], prefix_operators=[], qualifier=WonderPushUserPreferences, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOverrideSetLogging, postfix_operators=[], prefix_operators=[], qualifier=WonderPushConfiguration, selectors=[], type_arguments=None)], member=applyOverrideLogging, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=initialize, postfix_operators=[], prefix_operators=[], qualifier=JSONSyncInstallationCustom, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=initialize, postfix_operators=[], prefix_operators=[], qualifier=WonderPushRequestVault, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=MemberReference(member=sBeforeInitializationUserIdSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getUserId, postfix_operators=[], prefix_operators=[], qualifier=WonderPushConfiguration, selectors=[], type_arguments=None), if_true=MemberReference(member=sBeforeInitializationUserId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member=initForNewUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sIsInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=hasUserConsent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=hasUserConsentChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPackageManager, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=INTERNET, postfix_operators=[], prefix_operators=[], qualifier=android.Manifest.permission, selectors=[]), MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=checkPermission, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=PERMISSION_GRANTED, postfix_operators=[], prefix_operators=[], qualifier=PackageManager, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing INTERNET permission. Add <uses-permission android:name=\"android.permission.INTERNET\" /> under <manifest> in your AndroidManifest.xml")], member=w, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPackageManager, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=ACCESS_COARSE_LOCATION, postfix_operators=[], prefix_operators=[], qualifier=android.Manifest.permission, selectors=[]), MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=checkPermission, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=PERMISSION_GRANTED, postfix_operators=[], prefix_operators=[], qualifier=PackageManager, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPackageManager, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=ACCESS_FINE_LOCATION, postfix_operators=[], prefix_operators=[], qualifier=android.Manifest.permission, selectors=[]), MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=checkPermission, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=PERMISSION_GRANTED, postfix_operators=[], prefix_operators=[], qualifier=PackageManager, selectors=[]), operator=!=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPackageManager, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=ACCESS_FINE_LOCATION, postfix_operators=[], prefix_operators=[], qualifier=android.Manifest.permission, selectors=[]), MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=checkPermission, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=PERMISSION_GRANTED, postfix_operators=[], prefix_operators=[], qualifier=PackageManager, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only ACCESS_COARSE_LOCATION permission is granted. For more precision, you should strongly consider adding <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml")], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=M, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permission. Add <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both)")], member=w, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Permissions ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION have not been declared or granted yet. Make sure you declare <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both), and call ActivityCompat.requestPermissions() to request the permission at runtime")], member=w, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)]))]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initializeForApplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initializeForActivity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected error while initializing the SDK"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[initialize] operator[SEP] Keyword[final] identifier[Context] identifier[context] , Keyword[final] identifier[String] identifier[clientId] , identifier[String] identifier[clientSecret] operator[SEP] {
Keyword[try] {
identifier[WonderPush] operator[SEP] identifier[logDebug] operator[SEP] literal[String] operator[+] identifier[context] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[clientId] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[sIsInitialized] operator[||] operator[SEP] identifier[clientId] operator[!=] Other[null] operator[&&] identifier[clientSecret] operator[!=] Other[null] operator[&&] operator[SEP] operator[!] identifier[clientId] operator[SEP] identifier[equals] operator[SEP] identifier[sClientId] operator[SEP] operator[||] operator[!] identifier[clientSecret] operator[SEP] identifier[equals] operator[SEP] identifier[sClientSecret] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[sIsInitialized] operator[=] literal[boolean] operator[SEP] identifier[setNetworkAvailable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[sApplicationContext] operator[=] identifier[context] operator[SEP] identifier[getApplicationContext] operator[SEP] operator[SEP] operator[SEP] identifier[sClientId] operator[=] identifier[clientId] operator[SEP] identifier[sClientSecret] operator[=] identifier[clientSecret] operator[SEP] identifier[sBaseURL] operator[=] identifier[PRODUCTION_API_URL] operator[SEP] Keyword[if] operator[SEP] identifier[sSenderId] operator[==] Other[null] operator[SEP] {
identifier[sSenderId] operator[=] identifier[WonderPushFirebaseMessagingService] operator[SEP] identifier[getDefaultSenderId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[WonderPushFirebaseMessagingService] operator[SEP] identifier[WONDERPUSH_DEFAULT_SENDER_ID] operator[SEP] identifier[equals] operator[SEP] identifier[sSenderId] operator[SEP] operator[SEP] {
identifier[Log] operator[SEP] identifier[w] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[sSenderId] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[logDebug] operator[SEP] literal[String] operator[+] identifier[sSenderId] operator[SEP] operator[SEP]
}
}
identifier[WonderPush] operator[SEP] identifier[logDebug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] {
identifier[sFirebaseApp] operator[=] identifier[FirebaseApp] operator[SEP] identifier[initializeApp] operator[SEP] identifier[sApplicationContext] , Keyword[new] identifier[FirebaseOptions] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[setApplicationId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[setApiKey] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[setGcmSenderId] operator[SEP] identifier[sSenderId] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] , identifier[FIREBASE_APP_NAME] operator[SEP] operator[SEP] identifier[WonderPush] operator[SEP] identifier[logDebug] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[alreadyInitialized] operator[SEP] {
identifier[WonderPush] operator[SEP] identifier[logError] operator[SEP] literal[String] , identifier[alreadyInitialized] operator[SEP] operator[SEP] identifier[sFirebaseApp] operator[=] identifier[FirebaseApp] operator[SEP] identifier[getInstance] operator[SEP] identifier[FIREBASE_APP_NAME] operator[SEP] operator[SEP]
}
identifier[WonderPushConfiguration] operator[SEP] identifier[initialize] operator[SEP] identifier[getApplicationContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[WonderPushUserPreferences] operator[SEP] identifier[initialize] operator[SEP] operator[SEP] operator[SEP] identifier[applyOverrideLogging] operator[SEP] identifier[WonderPushConfiguration] operator[SEP] identifier[getOverrideSetLogging] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JSONSyncInstallationCustom] operator[SEP] identifier[initialize] operator[SEP] operator[SEP] operator[SEP] identifier[WonderPushRequestVault] operator[SEP] identifier[initialize] operator[SEP] operator[SEP] operator[SEP] identifier[initForNewUser] operator[SEP] identifier[sBeforeInitializationUserIdSet] operator[?] identifier[sBeforeInitializationUserId] operator[:] identifier[WonderPushConfiguration] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sIsInitialized] operator[=] literal[boolean] operator[SEP] identifier[hasUserConsentChanged] operator[SEP] identifier[hasUserConsent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getPackageManager] operator[SEP] operator[SEP] operator[SEP] identifier[checkPermission] operator[SEP] identifier[android] operator[SEP] identifier[Manifest] operator[SEP] identifier[permission] operator[SEP] identifier[INTERNET] , identifier[context] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] operator[!=] identifier[PackageManager] operator[SEP] identifier[PERMISSION_GRANTED] operator[SEP] {
identifier[Log] operator[SEP] identifier[w] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getPackageManager] operator[SEP] operator[SEP] operator[SEP] identifier[checkPermission] operator[SEP] identifier[android] operator[SEP] identifier[Manifest] operator[SEP] identifier[permission] operator[SEP] identifier[ACCESS_COARSE_LOCATION] , identifier[context] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] operator[!=] identifier[PackageManager] operator[SEP] identifier[PERMISSION_GRANTED] operator[&&] identifier[context] operator[SEP] identifier[getPackageManager] operator[SEP] operator[SEP] operator[SEP] identifier[checkPermission] operator[SEP] identifier[android] operator[SEP] identifier[Manifest] operator[SEP] identifier[permission] operator[SEP] identifier[ACCESS_FINE_LOCATION] , identifier[context] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] operator[!=] identifier[PackageManager] operator[SEP] identifier[PERMISSION_GRANTED] operator[SEP] {
Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[M] operator[SEP] {
identifier[Log] operator[SEP] identifier[w] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Log] operator[SEP] identifier[w] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getPackageManager] operator[SEP] operator[SEP] operator[SEP] identifier[checkPermission] operator[SEP] identifier[android] operator[SEP] identifier[Manifest] operator[SEP] identifier[permission] operator[SEP] identifier[ACCESS_FINE_LOCATION] , identifier[context] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] operator[!=] identifier[PackageManager] operator[SEP] identifier[PERMISSION_GRANTED] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP]
}
}
identifier[initializeForApplication] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[initializeForActivity] operator[SEP] identifier[context] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public boolean syncExtend() {
if ( !this.netcdfDataset.hasUnlimitedDimension()) {
return false;
}
try {
if ( !this.netcdfDataset.syncExtend()) {
return false;
}
} catch (IOException e) {
return false;
}
// Update number of points in this TrajectoryObsDataset and in the child TrajectoryObsDatatype.
int newNumPoints = this.trajectoryDim.getLength();
if (this.trajectoryNumPoint >= newNumPoints) {
return false;
}
this.trajectoryNumPoint = newNumPoints;
((Trajectory) this.trajectory).setNumPoints(
this.trajectoryNumPoint);
// Update end date in this TrajectoryObsDataset and in the child TrajectoryObsDatatype.
try {
endDate = trajectory.getTime(trajectoryNumPoint - 1);
} catch (IOException e) {
return false;
}
((Trajectory) trajectory).setEndDate(endDate);
return true;
}
|
class class_name[name] begin[{]
method[syncExtend, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[THIS[member[None.netcdfDataset]call[None.hasUnlimitedDimension, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MemberReference(member=netcdfDataset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=syncExtend, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
local_variable[type[int], newNumPoints]
if[binary_operation[THIS[member[None.trajectoryNumPoint]], >=, member[.newNumPoints]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[THIS[member[None.trajectoryNumPoint]], member[.newNumPoints]]
Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=trajectory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=ReferenceType(arguments=None, dimensions=[], name=Trajectory, sub_type=None))
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=endDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=trajectoryNumPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=trajectory, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
Cast(expression=MemberReference(member=trajectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Trajectory, sub_type=None))
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[syncExtend] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[netcdfDataset] operator[SEP] identifier[hasUnlimitedDimension] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[netcdfDataset] operator[SEP] identifier[syncExtend] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[int] identifier[newNumPoints] operator[=] Keyword[this] operator[SEP] identifier[trajectoryDim] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[trajectoryNumPoint] operator[>=] identifier[newNumPoints] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[this] operator[SEP] identifier[trajectoryNumPoint] operator[=] identifier[newNumPoints] operator[SEP] operator[SEP] operator[SEP] identifier[Trajectory] operator[SEP] Keyword[this] operator[SEP] identifier[trajectory] operator[SEP] operator[SEP] identifier[setNumPoints] operator[SEP] Keyword[this] operator[SEP] identifier[trajectoryNumPoint] operator[SEP] operator[SEP] Keyword[try] {
identifier[endDate] operator[=] identifier[trajectory] operator[SEP] identifier[getTime] operator[SEP] identifier[trajectoryNumPoint] operator[-] Other[1] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
} operator[SEP] operator[SEP] identifier[Trajectory] operator[SEP] identifier[trajectory] operator[SEP] operator[SEP] identifier[setEndDate] operator[SEP] identifier[endDate] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public static int numberAwareCompareTo(Comparable self, Comparable other) {
NumberAwareComparator<Comparable> numberAwareComparator = new NumberAwareComparator<Comparable>();
return numberAwareComparator.compare(self, other);
}
|
class class_name[name] begin[{]
method[numberAwareCompareTo, return_type[type[int]], modifier[public static], parameter[self, other]] begin[{]
local_variable[type[NumberAwareComparator], numberAwareComparator]
return[call[numberAwareComparator.compare, parameter[member[.self], member[.other]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[int] identifier[numberAwareCompareTo] operator[SEP] identifier[Comparable] identifier[self] , identifier[Comparable] identifier[other] operator[SEP] {
identifier[NumberAwareComparator] operator[<] identifier[Comparable] operator[>] identifier[numberAwareComparator] operator[=] Keyword[new] identifier[NumberAwareComparator] operator[<] identifier[Comparable] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[numberAwareComparator] operator[SEP] identifier[compare] operator[SEP] identifier[self] , identifier[other] operator[SEP] operator[SEP]
}
|
@Override
public PutObjectResult putObject(PutObjectRequest request) {
request = beforeClientExecution(request);
return executePutObject(request);
}
|
class class_name[name] begin[{]
method[putObject, return_type[type[PutObjectResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executePutObject, parameter[member[.request]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[PutObjectResult] identifier[putObject] operator[SEP] identifier[PutObjectRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executePutObject] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.