code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public JQMButton setLeftButton(String text, String url) {
return setLeftButton(text, url, null);
} | class class_name[name] begin[{]
method[setLeftButton, return_type[type[JQMButton]], modifier[public], parameter[text, url]] begin[{]
return[call[.setLeftButton, parameter[member[.text], member[.url], literal[null]]]]
end[}]
END[}] | Keyword[public] identifier[JQMButton] identifier[setLeftButton] operator[SEP] identifier[String] identifier[text] , identifier[String] identifier[url] operator[SEP] {
Keyword[return] identifier[setLeftButton] operator[SEP] identifier[text] , identifier[url] , Other[null] operator[SEP] operator[SEP]
}
|
public static double getLongitudeDistance(double minLongitude,
double maxLongitude,
double latitude) {
LatLng leftMiddle = new LatLng(latitude, minLongitude);
LatLng middle = new LatLng(latitude, (minLongitude + maxLongitude) / 2.0);
LatLng rightMiddle = new LatLng(latitude, maxLongitude);
List<LatLng> path = new ArrayList<LatLng>();
path.add(leftMiddle);
path.add(middle);
path.add(rightMiddle);
double lonDistance = SphericalUtil.computeLength(path);
return lonDistance;
} | class class_name[name] begin[{]
method[getLongitudeDistance, return_type[type[double]], modifier[public static], parameter[minLongitude, maxLongitude, latitude]] begin[{]
local_variable[type[LatLng], leftMiddle]
local_variable[type[LatLng], middle]
local_variable[type[LatLng], rightMiddle]
local_variable[type[List], path]
call[path.add, parameter[member[.leftMiddle]]]
call[path.add, parameter[member[.middle]]]
call[path.add, parameter[member[.rightMiddle]]]
local_variable[type[double], lonDistance]
return[member[.lonDistance]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[getLongitudeDistance] operator[SEP] Keyword[double] identifier[minLongitude] , Keyword[double] identifier[maxLongitude] , Keyword[double] identifier[latitude] operator[SEP] {
identifier[LatLng] identifier[leftMiddle] operator[=] Keyword[new] identifier[LatLng] operator[SEP] identifier[latitude] , identifier[minLongitude] operator[SEP] operator[SEP] identifier[LatLng] identifier[middle] operator[=] Keyword[new] identifier[LatLng] operator[SEP] identifier[latitude] , operator[SEP] identifier[minLongitude] operator[+] identifier[maxLongitude] operator[SEP] operator[/] literal[Float] operator[SEP] operator[SEP] identifier[LatLng] identifier[rightMiddle] operator[=] Keyword[new] identifier[LatLng] operator[SEP] identifier[latitude] , identifier[maxLongitude] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[LatLng] operator[>] identifier[path] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[LatLng] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[add] operator[SEP] identifier[leftMiddle] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[add] operator[SEP] identifier[middle] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[add] operator[SEP] identifier[rightMiddle] operator[SEP] operator[SEP] Keyword[double] identifier[lonDistance] operator[=] identifier[SphericalUtil] operator[SEP] identifier[computeLength] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[return] identifier[lonDistance] operator[SEP]
}
|
protected <V> V convertUnknownValue(String value, Class<V> type, Object valueSource) throws ValueNotSetException, WrongValueTypeException {
// throw new UnknownValueType();
throw new WrongValueTypeException(value, valueSource, type);
} | class class_name[name] begin[{]
method[convertUnknownValue, return_type[type[V]], modifier[protected], parameter[value, type, valueSource]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueSource, 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=WrongValueTypeException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[protected] operator[<] identifier[V] operator[>] identifier[V] identifier[convertUnknownValue] operator[SEP] identifier[String] identifier[value] , identifier[Class] operator[<] identifier[V] operator[>] identifier[type] , identifier[Object] identifier[valueSource] operator[SEP] Keyword[throws] identifier[ValueNotSetException] , identifier[WrongValueTypeException] {
Keyword[throw] Keyword[new] identifier[WrongValueTypeException] operator[SEP] identifier[value] , identifier[valueSource] , identifier[type] operator[SEP] operator[SEP]
}
|
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
// put values into MDC
MDC.put(HOSTNAME, servletRequest.getServerName());
if (productName != null) {
MDC.put(PRODUCTNAME, productName);
}
MDC.put("locale", servletRequest.getLocale().getDisplayName());
// process plugins
for (IPlugin plugin : plugins.values()) {
plugin.execute(request);
}
// forward to the chain for processing
filterChain.doFilter(servletRequest, servletResponse);
MDC.clear();
} | class class_name[name] begin[{]
method[doFilter, return_type[void], modifier[public], parameter[servletRequest, servletResponse, filterChain]] begin[{]
local_variable[type[HttpServletRequest], request]
call[MDC.put, parameter[member[.HOSTNAME], call[servletRequest.getServerName, parameter[]]]]
if[binary_operation[member[.productName], !=, literal[null]]] begin[{]
call[MDC.put, parameter[member[.PRODUCTNAME], member[.productName]]]
else begin[{]
None
end[}]
call[MDC.put, parameter[literal["locale"], call[servletRequest.getLocale, parameter[]]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=plugin, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=plugins, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=plugin)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPlugin, sub_type=None))), label=None)
call[filterChain.doFilter, parameter[member[.servletRequest], member[.servletResponse]]]
call[MDC.clear, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[doFilter] operator[SEP] identifier[ServletRequest] identifier[servletRequest] , identifier[ServletResponse] identifier[servletResponse] , identifier[FilterChain] identifier[filterChain] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] {
identifier[HttpServletRequest] identifier[request] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[servletRequest] operator[SEP] identifier[MDC] operator[SEP] identifier[put] operator[SEP] identifier[HOSTNAME] , identifier[servletRequest] operator[SEP] identifier[getServerName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[productName] operator[!=] Other[null] operator[SEP] {
identifier[MDC] operator[SEP] identifier[put] operator[SEP] identifier[PRODUCTNAME] , identifier[productName] operator[SEP] operator[SEP]
}
identifier[MDC] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[servletRequest] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IPlugin] identifier[plugin] operator[:] identifier[plugins] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[plugin] operator[SEP] identifier[execute] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
identifier[filterChain] operator[SEP] identifier[doFilter] operator[SEP] identifier[servletRequest] , identifier[servletResponse] operator[SEP] operator[SEP] identifier[MDC] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(DescribeUserRequest describeUserRequest, ProtocolMarshaller protocolMarshaller) {
if (describeUserRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeUserRequest.getOrganizationId(), ORGANIZATIONID_BINDING);
protocolMarshaller.marshall(describeUserRequest.getUserId(), USERID_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[describeUserRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.describeUserRequest], ==, 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=getOrganizationId, postfix_operators=[], prefix_operators=[], qualifier=describeUserRequest, selectors=[], type_arguments=None), MemberReference(member=ORGANIZATIONID_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=getUserId, postfix_operators=[], prefix_operators=[], qualifier=describeUserRequest, selectors=[], type_arguments=None), MemberReference(member=USERID_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[DescribeUserRequest] identifier[describeUserRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[describeUserRequest] 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[describeUserRequest] operator[SEP] identifier[getOrganizationId] operator[SEP] operator[SEP] , identifier[ORGANIZATIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeUserRequest] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] , identifier[USERID_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 String ucumToUdunits(String ucum) {
if (ucum == null) {
return null;
}
StringBuilder udunits = new StringBuilder();
int ucLength = ucum.length();
if (ucLength == 0) {
return "";
}
//is it a time point? e.g., s{since 1970-01-01T00:00:00T}
if (ucum.charAt(ucLength - 1) == '}' && //quick reject
ucum.indexOf('}') == ucLength - 1) { //reasonably quick reject
int sincePo = ucum.indexOf("{since ");
if (sincePo > 0) {
//is first part an atomic ucum unit?
String tUdunits = ucHashMap.get(ucum.substring(0, sincePo));
if (tUdunits != null) {
return tUdunits + " " + ucum.substring(sincePo + 1, ucLength - 1);
}
}
}
//parse ucum and build udunits, till done
int po = 0; //po is next position to be read
while (po < ucLength) {
char ch = ucum.charAt(po);
//letter
if (isUcumLetter(ch)) { //includes [, ], {, }, 'µ' and "'"
//find contiguous letters|_|digit (no '-')
int po2 = po + 1;
while (po2 < ucLength &&
(isUcumLetter(ucum.charAt(po2)) || ucum.charAt(po2) == '_' ||
ErddapString2.isDigit(ucum.charAt(po2)))) {
po2++;
}
String tUcum = ucum.substring(po, po2);
po = po2;
//some ucum have internal digits, but none end in digits
//if it ends in digits, treat as exponent
//find contiguous digits at end
int firstDigit = tUcum.length();
while (firstDigit >= 1 && ErddapString2.isDigit(tUcum.charAt(firstDigit - 1))) {
firstDigit--;
}
String exponent = tUcum.substring(firstDigit);
tUcum = tUcum.substring(0, firstDigit);
String tUdunits = oneUcumToUdunits(tUcum);
//deal with PER -> /
if (tUdunits.equals("/")) {
char lastUdunits = udunits.length() == 0 ? '\u0000' : udunits.charAt(udunits.length() - 1);
if (lastUdunits == '/') {
udunits.setCharAt(udunits.length() - 1, '.'); //2 '/' cancel out
} else if (lastUdunits == '.') {
udunits.setCharAt(udunits.length() - 1, '/'); // '/' replaces '.'
} else {
udunits.append('/');
}
} else {
udunits.append(tUdunits);
}
//add the exponent
udunits.append(exponent);
//catch -exponent as a number below
continue;
}
//number
if (ch == '-' || ErddapString2.isDigit(ch)) {
//find contiguous digits
int po2 = po + 1;
while (po2 < ucLength && ErddapString2.isDigit(ucum.charAt(po2))) {
po2++;
}
// ^- or ^{digit}
if (po2 < ucLength - 1 && Character.toLowerCase(ucum.charAt(po2)) == '^' &&
(ucum.charAt(po2 + 1) == '-' || ErddapString2.isDigit(ucum.charAt(po2 + 1)))) {
po2 += 2;
while (po2 < ucLength && ErddapString2.isDigit(ucum.charAt(po2))) {
po2++;
}
}
String num = ucum.substring(po, po2);
po = po2;
udunits.append(num);
continue;
}
// .
if (ch == '.') {
po++;
udunits.append(' '); // ' ' is more common than '.' in udunits
continue;
}
// *
if (ch == '*') {
po++;
udunits.append('^');
continue;
}
// ' ''
if (ch == '\'') {
po++;
if (po < ucLength && ucum.charAt(po) == '\'') {
udunits.append("arc_second");
po++;
} else {
udunits.append("arc_minute");
}
continue;
}
//otherwise, punctuation. copy it
// / (division), " doesn't occur,
udunits.append(ch);
po++;
}
return udunits.toString();
} | class class_name[name] begin[{]
method[ucumToUdunits, return_type[type[String]], modifier[public static], parameter[ucum]] begin[{]
if[binary_operation[member[.ucum], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], udunits]
local_variable[type[int], ucLength]
if[binary_operation[member[.ucLength], ==, literal[0]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[ucum.charAt, parameter[binary_operation[member[.ucLength], -, literal[1]]]], ==, literal['}']], &&, binary_operation[call[ucum.indexOf, parameter[literal['}']]], ==, binary_operation[member[.ucLength], -, literal[1]]]]] begin[{]
local_variable[type[int], sincePo]
if[binary_operation[member[.sincePo], >, literal[0]]] begin[{]
local_variable[type[String], tUdunits]
if[binary_operation[member[.tUdunits], !=, literal[null]]] begin[{]
return[binary_operation[binary_operation[member[.tUdunits], +, literal[" "]], +, call[ucum.substring, parameter[binary_operation[member[.sincePo], +, literal[1]], binary_operation[member[.ucLength], -, literal[1]]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[int], po]
while[binary_operation[member[.po], <, member[.ucLength]]] begin[{]
local_variable[type[char], ch]
if[call[.isUcumLetter, parameter[member[.ch]]]] begin[{]
local_variable[type[int], po2]
while[binary_operation[binary_operation[member[.po2], <, member[.ucLength]], &&, binary_operation[binary_operation[call[.isUcumLetter, parameter[call[ucum.charAt, parameter[member[.po2]]]]], ||, binary_operation[call[ucum.charAt, parameter[member[.po2]]], ==, literal['_']]], ||, call[ErddapString2.isDigit, parameter[call[ucum.charAt, parameter[member[.po2]]]]]]]] begin[{]
member[.po2]
end[}]
local_variable[type[String], tUcum]
assign[member[.po], member[.po2]]
local_variable[type[int], firstDigit]
while[binary_operation[binary_operation[member[.firstDigit], >=, literal[1]], &&, call[ErddapString2.isDigit, parameter[call[tUcum.charAt, parameter[binary_operation[member[.firstDigit], -, literal[1]]]]]]]] begin[{]
member[.firstDigit]
end[}]
local_variable[type[String], exponent]
assign[member[.tUcum], call[tUcum.substring, parameter[literal[0], member[.firstDigit]]]]
local_variable[type[String], tUdunits]
if[call[tUdunits.equals, parameter[literal["/"]]]] begin[{]
local_variable[type[char], lastUdunits]
if[binary_operation[member[.lastUdunits], ==, literal['/']]] begin[{]
call[udunits.setCharAt, parameter[binary_operation[call[udunits.length, parameter[]], -, literal[1]], literal['.']]]
else begin[{]
if[binary_operation[member[.lastUdunits], ==, literal['.']]] begin[{]
call[udunits.setCharAt, parameter[binary_operation[call[udunits.length, parameter[]], -, literal[1]], literal['/']]]
else begin[{]
call[udunits.append, parameter[literal['/']]]
end[}]
end[}]
else begin[{]
call[udunits.append, parameter[member[.tUdunits]]]
end[}]
call[udunits.append, parameter[member[.exponent]]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.ch], ==, literal['-']], ||, call[ErddapString2.isDigit, parameter[member[.ch]]]]] begin[{]
local_variable[type[int], po2]
while[binary_operation[binary_operation[member[.po2], <, member[.ucLength]], &&, call[ErddapString2.isDigit, parameter[call[ucum.charAt, parameter[member[.po2]]]]]]] begin[{]
member[.po2]
end[}]
if[binary_operation[binary_operation[binary_operation[member[.po2], <, binary_operation[member[.ucLength], -, literal[1]]], &&, binary_operation[call[Character.toLowerCase, parameter[call[ucum.charAt, parameter[member[.po2]]]]], ==, literal['^']]], &&, binary_operation[binary_operation[call[ucum.charAt, parameter[binary_operation[member[.po2], +, literal[1]]]], ==, literal['-']], ||, call[ErddapString2.isDigit, parameter[call[ucum.charAt, parameter[binary_operation[member[.po2], +, literal[1]]]]]]]]] begin[{]
assign[member[.po2], literal[2]]
while[binary_operation[binary_operation[member[.po2], <, member[.ucLength]], &&, call[ErddapString2.isDigit, parameter[call[ucum.charAt, parameter[member[.po2]]]]]]] begin[{]
member[.po2]
end[}]
else begin[{]
None
end[}]
local_variable[type[String], num]
assign[member[.po], member[.po2]]
call[udunits.append, parameter[member[.num]]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.ch], ==, literal['.']]] begin[{]
member[.po]
call[udunits.append, parameter[literal[' ']]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.ch], ==, literal['*']]] begin[{]
member[.po]
call[udunits.append, parameter[literal['^']]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.ch], ==, literal['\'']]] begin[{]
member[.po]
if[binary_operation[binary_operation[member[.po], <, member[.ucLength]], &&, binary_operation[call[ucum.charAt, parameter[member[.po]]], ==, literal['\'']]]] begin[{]
call[udunits.append, parameter[literal["arc_second"]]]
member[.po]
else begin[{]
call[udunits.append, parameter[literal["arc_minute"]]]
end[}]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[udunits.append, parameter[member[.ch]]]
member[.po]
end[}]
return[call[udunits.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[ucumToUdunits] operator[SEP] identifier[String] identifier[ucum] operator[SEP] {
Keyword[if] operator[SEP] identifier[ucum] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[StringBuilder] identifier[udunits] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ucLength] operator[=] identifier[ucum] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ucLength] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[ucLength] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[ucum] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[==] identifier[ucLength] operator[-] Other[1] operator[SEP] {
Keyword[int] identifier[sincePo] operator[=] identifier[ucum] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sincePo] operator[>] Other[0] operator[SEP] {
identifier[String] identifier[tUdunits] operator[=] identifier[ucHashMap] operator[SEP] identifier[get] operator[SEP] identifier[ucum] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[sincePo] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tUdunits] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[tUdunits] operator[+] literal[String] operator[+] identifier[ucum] operator[SEP] identifier[substring] operator[SEP] identifier[sincePo] operator[+] Other[1] , identifier[ucLength] operator[-] Other[1] operator[SEP] operator[SEP]
}
}
}
Keyword[int] identifier[po] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[po] operator[<] identifier[ucLength] operator[SEP] {
Keyword[char] identifier[ch] operator[=] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isUcumLetter] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
Keyword[int] identifier[po2] operator[=] identifier[po] operator[+] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[po2] operator[<] identifier[ucLength] operator[&&] operator[SEP] identifier[isUcumLetter] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[SEP] operator[SEP] operator[||] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[SEP] operator[==] literal[String] operator[||] identifier[ErddapString2] operator[SEP] identifier[isDigit] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[po2] operator[++] operator[SEP]
}
identifier[String] identifier[tUcum] operator[=] identifier[ucum] operator[SEP] identifier[substring] operator[SEP] identifier[po] , identifier[po2] operator[SEP] operator[SEP] identifier[po] operator[=] identifier[po2] operator[SEP] Keyword[int] identifier[firstDigit] operator[=] identifier[tUcum] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[firstDigit] operator[>=] Other[1] operator[&&] identifier[ErddapString2] operator[SEP] identifier[isDigit] operator[SEP] identifier[tUcum] operator[SEP] identifier[charAt] operator[SEP] identifier[firstDigit] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] {
identifier[firstDigit] operator[--] operator[SEP]
}
identifier[String] identifier[exponent] operator[=] identifier[tUcum] operator[SEP] identifier[substring] operator[SEP] identifier[firstDigit] operator[SEP] operator[SEP] identifier[tUcum] operator[=] identifier[tUcum] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[firstDigit] operator[SEP] operator[SEP] identifier[String] identifier[tUdunits] operator[=] identifier[oneUcumToUdunits] operator[SEP] identifier[tUcum] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tUdunits] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[char] identifier[lastUdunits] operator[=] identifier[udunits] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] literal[String] operator[:] identifier[udunits] operator[SEP] identifier[charAt] operator[SEP] identifier[udunits] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastUdunits] operator[==] literal[String] operator[SEP] {
identifier[udunits] operator[SEP] identifier[setCharAt] operator[SEP] identifier[udunits] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[lastUdunits] operator[==] literal[String] operator[SEP] {
identifier[udunits] operator[SEP] identifier[setCharAt] operator[SEP] identifier[udunits] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[udunits] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[udunits] operator[SEP] identifier[append] operator[SEP] identifier[tUdunits] operator[SEP] operator[SEP]
}
identifier[udunits] operator[SEP] identifier[append] operator[SEP] identifier[exponent] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[||] identifier[ErddapString2] operator[SEP] identifier[isDigit] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
Keyword[int] identifier[po2] operator[=] identifier[po] operator[+] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[po2] operator[<] identifier[ucLength] operator[&&] identifier[ErddapString2] operator[SEP] identifier[isDigit] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[SEP] operator[SEP] operator[SEP] {
identifier[po2] operator[++] operator[SEP]
}
Keyword[if] operator[SEP] identifier[po2] operator[<] identifier[ucLength] operator[-] Other[1] operator[&&] identifier[Character] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[SEP] operator[SEP] operator[==] literal[String] operator[&&] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[+] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[ErddapString2] operator[SEP] identifier[isDigit] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[po2] operator[+=] Other[2] operator[SEP] Keyword[while] operator[SEP] identifier[po2] operator[<] identifier[ucLength] operator[&&] identifier[ErddapString2] operator[SEP] identifier[isDigit] operator[SEP] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po2] operator[SEP] operator[SEP] operator[SEP] {
identifier[po2] operator[++] operator[SEP]
}
}
identifier[String] identifier[num] operator[=] identifier[ucum] operator[SEP] identifier[substring] operator[SEP] identifier[po] , identifier[po2] operator[SEP] operator[SEP] identifier[po] operator[=] identifier[po2] operator[SEP] identifier[udunits] operator[SEP] identifier[append] operator[SEP] identifier[num] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] {
identifier[po] operator[++] operator[SEP] identifier[udunits] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] {
identifier[po] operator[++] operator[SEP] identifier[udunits] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] {
identifier[po] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[po] operator[<] identifier[ucLength] operator[&&] identifier[ucum] operator[SEP] identifier[charAt] operator[SEP] identifier[po] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[udunits] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[po] operator[++] operator[SEP]
}
Keyword[else] {
identifier[udunits] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[continue] operator[SEP]
}
identifier[udunits] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP] identifier[po] operator[++] operator[SEP]
}
Keyword[return] identifier[udunits] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void removeNamespace(final MongoNamespace namespace) {
this.instanceLock.writeLock().lock();
try {
if (!this.nsStreamers.containsKey(namespace)) {
return;
}
final NamespaceChangeStreamListener streamer = this.nsStreamers.get(namespace);
streamer.stop();
this.nsStreamers.remove(namespace);
} finally {
this.instanceLock.writeLock().unlock();
}
} | class class_name[name] begin[{]
method[removeNamespace, return_type[void], modifier[public], parameter[namespace]] begin[{]
THIS[member[None.instanceLock]call[None.writeLock, parameter[]]call[None.lock, parameter[]]]
TryStatement(block=[IfStatement(condition=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MemberReference(member=nsStreamers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, 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=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nsStreamers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=streamer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=NamespaceChangeStreamListener, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=streamer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nsStreamers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=None, finally_block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=instanceLock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=writeLock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeNamespace] operator[SEP] Keyword[final] identifier[MongoNamespace] identifier[namespace] operator[SEP] {
Keyword[this] operator[SEP] identifier[instanceLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[nsStreamers] operator[SEP] identifier[containsKey] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[final] identifier[NamespaceChangeStreamListener] identifier[streamer] operator[=] Keyword[this] operator[SEP] identifier[nsStreamers] operator[SEP] identifier[get] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] identifier[streamer] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[nsStreamers] operator[SEP] identifier[remove] operator[SEP] identifier[namespace] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[this] operator[SEP] identifier[instanceLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public S onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener) {
failureListener = EventListener.of(Assert.notNull(listener, "listener"));
return (S) this;
} | class class_name[name] begin[{]
method[onFailure, return_type[type[S]], modifier[public], parameter[listener]] begin[{]
assign[member[.failureListener], call[EventListener.of, parameter[call[Assert.notNull, parameter[member[.listener], literal["listener"]]]]]]
return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[S] identifier[onFailure] operator[SEP] identifier[CheckedConsumer] operator[<] operator[?] Keyword[extends] identifier[ExecutionCompletedEvent] operator[<] identifier[R] operator[>] operator[>] identifier[listener] operator[SEP] {
identifier[failureListener] operator[=] identifier[EventListener] operator[SEP] identifier[of] operator[SEP] identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[listener] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[S] operator[SEP] Keyword[this] operator[SEP]
}
|
public static PDFont mapDefaultFonts(Font font) {
/*
* Map default font names to the matching families.
*/
if (fontNameEqualsAnyOf(font, Font.SANS_SERIF, Font.DIALOG, Font.DIALOG_INPUT, "Arial", "Helvetica"))
return chooseMatchingHelvetica(font);
if (fontNameEqualsAnyOf(font, Font.MONOSPACED, "courier", "courier new"))
return chooseMatchingCourier(font);
if (fontNameEqualsAnyOf(font, Font.SERIF, "Times", "Times New Roman", "Times Roman"))
return chooseMatchingTimes(font);
if (fontNameEqualsAnyOf(font, "Symbol"))
return PDType1Font.SYMBOL;
if (fontNameEqualsAnyOf(font, "ZapfDingbats", "Dingbats"))
return PDType1Font.ZAPF_DINGBATS;
return null;
} | class class_name[name] begin[{]
method[mapDefaultFonts, return_type[type[PDFont]], modifier[public static], parameter[font]] begin[{]
if[call[.fontNameEqualsAnyOf, parameter[member[.font], member[Font.SANS_SERIF], member[Font.DIALOG], member[Font.DIALOG_INPUT], literal["Arial"], literal["Helvetica"]]]] begin[{]
return[call[.chooseMatchingHelvetica, parameter[member[.font]]]]
else begin[{]
None
end[}]
if[call[.fontNameEqualsAnyOf, parameter[member[.font], member[Font.MONOSPACED], literal["courier"], literal["courier new"]]]] begin[{]
return[call[.chooseMatchingCourier, parameter[member[.font]]]]
else begin[{]
None
end[}]
if[call[.fontNameEqualsAnyOf, parameter[member[.font], member[Font.SERIF], literal["Times"], literal["Times New Roman"], literal["Times Roman"]]]] begin[{]
return[call[.chooseMatchingTimes, parameter[member[.font]]]]
else begin[{]
None
end[}]
if[call[.fontNameEqualsAnyOf, parameter[member[.font], literal["Symbol"]]]] begin[{]
return[member[PDType1Font.SYMBOL]]
else begin[{]
None
end[}]
if[call[.fontNameEqualsAnyOf, parameter[member[.font], literal["ZapfDingbats"], literal["Dingbats"]]]] begin[{]
return[member[PDType1Font.ZAPF_DINGBATS]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PDFont] identifier[mapDefaultFonts] operator[SEP] identifier[Font] identifier[font] operator[SEP] {
Keyword[if] operator[SEP] identifier[fontNameEqualsAnyOf] operator[SEP] identifier[font] , identifier[Font] operator[SEP] identifier[SANS_SERIF] , identifier[Font] operator[SEP] identifier[DIALOG] , identifier[Font] operator[SEP] identifier[DIALOG_INPUT] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[chooseMatchingHelvetica] operator[SEP] identifier[font] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fontNameEqualsAnyOf] operator[SEP] identifier[font] , identifier[Font] operator[SEP] identifier[MONOSPACED] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[chooseMatchingCourier] operator[SEP] identifier[font] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fontNameEqualsAnyOf] operator[SEP] identifier[font] , identifier[Font] operator[SEP] identifier[SERIF] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[chooseMatchingTimes] operator[SEP] identifier[font] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fontNameEqualsAnyOf] operator[SEP] identifier[font] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[PDType1Font] operator[SEP] identifier[SYMBOL] operator[SEP] Keyword[if] operator[SEP] identifier[fontNameEqualsAnyOf] operator[SEP] identifier[font] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[PDType1Font] operator[SEP] identifier[ZAPF_DINGBATS] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
private void validateTableOptionRetentionAge(TableDefinition tableDef, String optValue) {
RetentionAge retAge = new RetentionAge(optValue); // throws if invalid format
optValue = retAge.toString();
tableDef.setOption(CommonDefs.OPT_RETENTION_AGE, optValue); // rewrite value
Utils.require(tableDef.getOption(CommonDefs.OPT_AGING_FIELD) != null,
"Option 'retention-age' requires option 'aging-field'");
} | class class_name[name] begin[{]
method[validateTableOptionRetentionAge, return_type[void], modifier[private], parameter[tableDef, optValue]] begin[{]
local_variable[type[RetentionAge], retAge]
assign[member[.optValue], call[retAge.toString, parameter[]]]
call[tableDef.setOption, parameter[member[CommonDefs.OPT_RETENTION_AGE], member[.optValue]]]
call[Utils.require, parameter[binary_operation[call[tableDef.getOption, parameter[member[CommonDefs.OPT_AGING_FIELD]]], !=, literal[null]], literal["Option 'retention-age' requires option 'aging-field'"]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[validateTableOptionRetentionAge] operator[SEP] identifier[TableDefinition] identifier[tableDef] , identifier[String] identifier[optValue] operator[SEP] {
identifier[RetentionAge] identifier[retAge] operator[=] Keyword[new] identifier[RetentionAge] operator[SEP] identifier[optValue] operator[SEP] operator[SEP] identifier[optValue] operator[=] identifier[retAge] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[tableDef] operator[SEP] identifier[setOption] operator[SEP] identifier[CommonDefs] operator[SEP] identifier[OPT_RETENTION_AGE] , identifier[optValue] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[tableDef] operator[SEP] identifier[getOption] operator[SEP] identifier[CommonDefs] operator[SEP] identifier[OPT_AGING_FIELD] operator[SEP] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP]
}
|
public void scanProcesses(Object typeObject, OperationType type)
{
String strTargetVersion = this.getProperty("version");
if (strTargetVersion == null)
strTargetVersion = this.getDefaultVersion();
Record recMessageTransport = ((ReferenceField)this.getRecord(MessageControl.MESSAGE_CONTROL_FILE).getField(MessageControl.WEB_MESSAGE_TRANSPORT_ID)).getReference();
MessageVersion recMessageVersion = ((MessageControl)this.getRecord(MessageControl.MESSAGE_CONTROL_FILE)).getMessageVersion(strTargetVersion);
MessageProcessInfo recMessageProcessInfo = new MessageProcessInfo(this);
recMessageProcessInfo.setKeyArea(MessageProcessInfo.MESSAGE_INFO_ID_KEY);
try {
// Always register this generic processing queue.
recMessageProcessInfo.close();
while (recMessageProcessInfo.hasNext())
{
recMessageProcessInfo.next();
String strQueueName = recMessageProcessInfo.getQueueName(true);
String strQueueType = recMessageProcessInfo.getQueueType(true);
String strProcessClass = recMessageProcessInfo.getField(MessageProcessInfo.PROCESSOR_CLASS).toString();
Map<String,Object> properties = ((PropertiesField)recMessageProcessInfo.getField(MessageProcessInfo.PROPERTIES)).getProperties();
Record recMessageType = ((ReferenceField)recMessageProcessInfo.getField(MessageProcessInfo.MESSAGE_TYPE_ID)).getReference();
if (recMessageType != null)
{ // Start all processes that handle INcoming REQUESTs.
String strMessageType = recMessageType.getField(MessageType.CODE).toString();
Record recMessageInfo = ((ReferenceField)recMessageProcessInfo.getField(MessageProcessInfo.MESSAGE_INFO_ID)).getReference();
if (recMessageInfo != null)
{
Record recMessageInfoType = ((ReferenceField)recMessageInfo.getField(MessageInfo.MESSAGE_INFO_TYPE_ID)).getReference();
if (recMessageInfoType != null)
{
String strMessageInfoType = recMessageInfoType.getField(MessageInfoType.CODE).toString();
if (MessageInfoType.REQUEST.equals(strMessageInfoType))
if (MessageType.MESSAGE_IN.equals(strMessageType))
if ((strQueueName != null) && (strQueueName.length() > 0))
{
Record recMessageTransportInfo = this.getRecord(MessageTransportInfo.MESSAGE_TRANSPORT_INFO_FILE);
recMessageTransportInfo.setKeyArea(MessageTransportInfo.MESSAGE_PROCESS_INFO_ID_KEY);
recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_PROCESS_INFO_ID).moveFieldToThis(recMessageProcessInfo.getField(MessageProcessInfo.ID));
recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_TRANSPORT_ID).moveFieldToThis(recMessageTransport.getField(MessageTransport.ID));
recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_VERSION_ID).moveFieldToThis(recMessageVersion.getField(MessageVersion.ID));
if (recMessageTransportInfo.seek(DBConstants.EQUALS))
{
this.addProcessForWSDL(strTargetVersion, typeObject, recMessageProcessInfo, type);
}
}
}
}
}
}
recMessageProcessInfo.close();
} catch (DBException ex) {
ex.printStackTrace();
} finally {
recMessageProcessInfo.free();
}
} | class class_name[name] begin[{]
method[scanProcesses, return_type[void], modifier[public], parameter[typeObject, type]] begin[{]
local_variable[type[String], strTargetVersion]
if[binary_operation[member[.strTargetVersion], ==, literal[null]]] begin[{]
assign[member[.strTargetVersion], THIS[call[None.getDefaultVersion, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[Record], recMessageTransport]
local_variable[type[MessageVersion], recMessageVersion]
local_variable[type[MessageProcessInfo], recMessageProcessInfo]
call[recMessageProcessInfo.setKeyArea, parameter[member[MessageProcessInfo.MESSAGE_INFO_ID_KEY]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getQueueName, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), name=strQueueName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getQueueType, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), name=strQueueType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=PROCESSOR_CLASS, postfix_operators=[], prefix_operators=[], qualifier=MessageProcessInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=strProcessClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=PROPERTIES, postfix_operators=[], prefix_operators=[], qualifier=MessageProcessInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=PropertiesField, sub_type=None)), name=properties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=MESSAGE_TYPE_ID, postfix_operators=[], prefix_operators=[], qualifier=MessageProcessInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ReferenceField, sub_type=None)), name=recMessageType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=recMessageType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=CODE, postfix_operators=[], prefix_operators=[], qualifier=MessageType, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageType, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=strMessageType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=MESSAGE_INFO_ID, postfix_operators=[], prefix_operators=[], qualifier=MessageProcessInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ReferenceField, sub_type=None)), name=recMessageInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=recMessageInfo, 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=Cast(expression=MethodInvocation(arguments=[MemberReference(member=MESSAGE_INFO_TYPE_ID, postfix_operators=[], prefix_operators=[], qualifier=MessageInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageInfo, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ReferenceField, sub_type=None)), name=recMessageInfoType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=recMessageInfoType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=CODE, postfix_operators=[], prefix_operators=[], qualifier=MessageInfoType, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageInfoType, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=strMessageInfoType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=strMessageInfoType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=MessageInfoType.REQUEST, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=strMessageType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=MessageType.MESSAGE_IN, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=strQueueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=strQueueName, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=MESSAGE_TRANSPORT_INFO_FILE, postfix_operators=[], prefix_operators=[], qualifier=MessageTransportInfo, selectors=[])], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=recMessageTransportInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MESSAGE_PROCESS_INFO_ID_KEY, postfix_operators=[], prefix_operators=[], qualifier=MessageTransportInfo, selectors=[])], member=setKeyArea, postfix_operators=[], prefix_operators=[], qualifier=recMessageTransportInfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MESSAGE_PROCESS_INFO_ID, postfix_operators=[], prefix_operators=[], qualifier=MessageTransportInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageTransportInfo, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=MessageProcessInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None)], member=moveFieldToThis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MESSAGE_TRANSPORT_ID, postfix_operators=[], prefix_operators=[], qualifier=MessageTransportInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageTransportInfo, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=MessageTransport, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageTransport, selectors=[], type_arguments=None)], member=moveFieldToThis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MESSAGE_VERSION_ID, postfix_operators=[], prefix_operators=[], qualifier=MessageTransportInfo, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageTransportInfo, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=MessageVersion, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recMessageVersion, selectors=[], type_arguments=None)], member=moveFieldToThis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=EQUALS, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[])], member=seek, postfix_operators=[], prefix_operators=[], qualifier=recMessageTransportInfo, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=strTargetVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=typeObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=recMessageProcessInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addProcessForWSDL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]))))]))]))]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, 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)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['DBException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=free, postfix_operators=[], prefix_operators=[], qualifier=recMessageProcessInfo, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[scanProcesses] operator[SEP] identifier[Object] identifier[typeObject] , identifier[OperationType] identifier[type] operator[SEP] {
identifier[String] identifier[strTargetVersion] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strTargetVersion] operator[==] Other[null] operator[SEP] identifier[strTargetVersion] operator[=] Keyword[this] operator[SEP] identifier[getDefaultVersion] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[recMessageTransport] operator[=] operator[SEP] operator[SEP] identifier[ReferenceField] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageControl] operator[SEP] identifier[MESSAGE_CONTROL_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageControl] operator[SEP] identifier[WEB_MESSAGE_TRANSPORT_ID] operator[SEP] operator[SEP] operator[SEP] identifier[getReference] operator[SEP] operator[SEP] operator[SEP] identifier[MessageVersion] identifier[recMessageVersion] operator[=] operator[SEP] operator[SEP] identifier[MessageControl] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageControl] operator[SEP] identifier[MESSAGE_CONTROL_FILE] operator[SEP] operator[SEP] operator[SEP] identifier[getMessageVersion] operator[SEP] identifier[strTargetVersion] operator[SEP] operator[SEP] identifier[MessageProcessInfo] identifier[recMessageProcessInfo] operator[=] Keyword[new] identifier[MessageProcessInfo] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[recMessageProcessInfo] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[MessageProcessInfo] operator[SEP] identifier[MESSAGE_INFO_ID_KEY] operator[SEP] operator[SEP] Keyword[try] {
identifier[recMessageProcessInfo] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[recMessageProcessInfo] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[recMessageProcessInfo] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strQueueName] operator[=] identifier[recMessageProcessInfo] operator[SEP] identifier[getQueueName] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[strQueueType] operator[=] identifier[recMessageProcessInfo] operator[SEP] identifier[getQueueType] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[strProcessClass] operator[=] identifier[recMessageProcessInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageProcessInfo] operator[SEP] identifier[PROCESSOR_CLASS] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[=] operator[SEP] operator[SEP] identifier[PropertiesField] operator[SEP] identifier[recMessageProcessInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageProcessInfo] operator[SEP] identifier[PROPERTIES] operator[SEP] operator[SEP] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[recMessageType] operator[=] operator[SEP] operator[SEP] identifier[ReferenceField] operator[SEP] identifier[recMessageProcessInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageProcessInfo] operator[SEP] identifier[MESSAGE_TYPE_ID] operator[SEP] operator[SEP] operator[SEP] identifier[getReference] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recMessageType] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[strMessageType] operator[=] identifier[recMessageType] operator[SEP] identifier[getField] operator[SEP] identifier[MessageType] operator[SEP] identifier[CODE] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[recMessageInfo] operator[=] operator[SEP] operator[SEP] identifier[ReferenceField] operator[SEP] identifier[recMessageProcessInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageProcessInfo] operator[SEP] identifier[MESSAGE_INFO_ID] operator[SEP] operator[SEP] operator[SEP] identifier[getReference] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recMessageInfo] operator[!=] Other[null] operator[SEP] {
identifier[Record] identifier[recMessageInfoType] operator[=] operator[SEP] operator[SEP] identifier[ReferenceField] operator[SEP] identifier[recMessageInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageInfo] operator[SEP] identifier[MESSAGE_INFO_TYPE_ID] operator[SEP] operator[SEP] operator[SEP] identifier[getReference] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recMessageInfoType] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[strMessageInfoType] operator[=] identifier[recMessageInfoType] operator[SEP] identifier[getField] operator[SEP] identifier[MessageInfoType] operator[SEP] identifier[CODE] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[MessageInfoType] operator[SEP] identifier[REQUEST] operator[SEP] identifier[equals] operator[SEP] identifier[strMessageInfoType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[MessageType] operator[SEP] identifier[MESSAGE_IN] operator[SEP] identifier[equals] operator[SEP] identifier[strMessageType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strQueueName] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[strQueueName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] {
identifier[Record] identifier[recMessageTransportInfo] operator[=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageTransportInfo] operator[SEP] identifier[MESSAGE_TRANSPORT_INFO_FILE] operator[SEP] operator[SEP] identifier[recMessageTransportInfo] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[MessageTransportInfo] operator[SEP] identifier[MESSAGE_PROCESS_INFO_ID_KEY] operator[SEP] operator[SEP] identifier[recMessageTransportInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageTransportInfo] operator[SEP] identifier[MESSAGE_PROCESS_INFO_ID] operator[SEP] operator[SEP] identifier[moveFieldToThis] operator[SEP] identifier[recMessageProcessInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageProcessInfo] operator[SEP] identifier[ID] operator[SEP] operator[SEP] operator[SEP] identifier[recMessageTransportInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageTransportInfo] operator[SEP] identifier[MESSAGE_TRANSPORT_ID] operator[SEP] operator[SEP] identifier[moveFieldToThis] operator[SEP] identifier[recMessageTransport] operator[SEP] identifier[getField] operator[SEP] identifier[MessageTransport] operator[SEP] identifier[ID] operator[SEP] operator[SEP] operator[SEP] identifier[recMessageTransportInfo] operator[SEP] identifier[getField] operator[SEP] identifier[MessageTransportInfo] operator[SEP] identifier[MESSAGE_VERSION_ID] operator[SEP] operator[SEP] identifier[moveFieldToThis] operator[SEP] identifier[recMessageVersion] operator[SEP] identifier[getField] operator[SEP] identifier[MessageVersion] operator[SEP] identifier[ID] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recMessageTransportInfo] operator[SEP] identifier[seek] operator[SEP] identifier[DBConstants] operator[SEP] identifier[EQUALS] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[addProcessForWSDL] operator[SEP] identifier[strTargetVersion] , identifier[typeObject] , identifier[recMessageProcessInfo] , identifier[type] operator[SEP] operator[SEP]
}
}
}
}
}
}
identifier[recMessageProcessInfo] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DBException] identifier[ex] operator[SEP] {
identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[recMessageProcessInfo] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void pushState(boolean isStatic) {
stateStack.add(new StateStackElement());
currentScope = new VariableScope(currentScope);
currentScope.setInStaticContext(isStatic);
} | class class_name[name] begin[{]
method[pushState, return_type[void], modifier[private], parameter[isStatic]] begin[{]
call[stateStack.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StateStackElement, sub_type=None))]]
assign[member[.currentScope], ClassCreator(arguments=[MemberReference(member=currentScope, 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=VariableScope, sub_type=None))]
call[currentScope.setInStaticContext, parameter[member[.isStatic]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[pushState] operator[SEP] Keyword[boolean] identifier[isStatic] operator[SEP] {
identifier[stateStack] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[StateStackElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[currentScope] operator[=] Keyword[new] identifier[VariableScope] operator[SEP] identifier[currentScope] operator[SEP] operator[SEP] identifier[currentScope] operator[SEP] identifier[setInStaticContext] operator[SEP] identifier[isStatic] operator[SEP] operator[SEP]
}
|
@Override
public StopBulkDeploymentResult stopBulkDeployment(StopBulkDeploymentRequest request) {
request = beforeClientExecution(request);
return executeStopBulkDeployment(request);
} | class class_name[name] begin[{]
method[stopBulkDeployment, return_type[type[StopBulkDeploymentResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeStopBulkDeployment, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[StopBulkDeploymentResult] identifier[stopBulkDeployment] operator[SEP] identifier[StopBulkDeploymentRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeStopBulkDeployment] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public X509CRLEntry getRevokedCertificate(X509Certificate cert) {
if (revokedMap.isEmpty()) {
return null;
}
X509IssuerSerial issuerSerial = new X509IssuerSerial(cert);
return revokedMap.get(issuerSerial);
} | class class_name[name] begin[{]
method[getRevokedCertificate, return_type[type[X509CRLEntry]], modifier[public], parameter[cert]] begin[{]
if[call[revokedMap.isEmpty, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[X509IssuerSerial], issuerSerial]
return[call[revokedMap.get, parameter[member[.issuerSerial]]]]
end[}]
END[}] | Keyword[public] identifier[X509CRLEntry] identifier[getRevokedCertificate] operator[SEP] identifier[X509Certificate] identifier[cert] operator[SEP] {
Keyword[if] operator[SEP] identifier[revokedMap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[X509IssuerSerial] identifier[issuerSerial] operator[=] Keyword[new] identifier[X509IssuerSerial] operator[SEP] identifier[cert] operator[SEP] operator[SEP] Keyword[return] identifier[revokedMap] operator[SEP] identifier[get] operator[SEP] identifier[issuerSerial] operator[SEP] operator[SEP]
}
|
public static boolean isNonPublicProxyClass(Class<?> cls) {
String name = cls.getName();
int i = name.lastIndexOf('.');
String pkg = (i != -1) ? name.substring(0, i) : "";
// NOTE: Android creates proxies in the "default" package (and not com.sun.proxy), which
// makes this check imprecise. However, this function is only ever called if there's
// a security manager installed (which is the never case on android).
return Proxy.isProxyClass(cls) && !pkg.isEmpty();
} | class class_name[name] begin[{]
method[isNonPublicProxyClass, return_type[type[boolean]], modifier[public static], parameter[cls]] begin[{]
local_variable[type[String], name]
local_variable[type[int], i]
local_variable[type[String], pkg]
return[binary_operation[call[Proxy.isProxyClass, parameter[member[.cls]]], &&, call[pkg.isEmpty, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isNonPublicProxyClass] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] operator[SEP] {
identifier[String] identifier[name] operator[=] identifier[cls] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[name] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[pkg] operator[=] operator[SEP] identifier[i] operator[!=] operator[-] Other[1] operator[SEP] operator[?] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[i] operator[SEP] operator[:] literal[String] operator[SEP] Keyword[return] identifier[Proxy] operator[SEP] identifier[isProxyClass] operator[SEP] identifier[cls] operator[SEP] operator[&&] operator[!] identifier[pkg] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP]
}
|
@Deprecated
public void trans(VoidFunc1<Session> func) {
try {
beginTransaction();
func.call(this);
commit();
} catch (Exception e) {
quietRollback();
throw new DbRuntimeException(e);
}
} | class class_name[name] begin[{]
method[trans, return_type[void], modifier[public], parameter[func]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=beginTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=call, postfix_operators=[], prefix_operators=[], qualifier=func, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=quietRollback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DbRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[void] identifier[trans] operator[SEP] identifier[VoidFunc1] operator[<] identifier[Session] operator[>] identifier[func] operator[SEP] {
Keyword[try] {
identifier[beginTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[func] operator[SEP] identifier[call] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[quietRollback] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DbRuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public void setPadding(@Nullable String paddingString) {
if (!TextUtils.isEmpty(paddingString)) {
// remove leading and ending '[' ']'
try {
paddingString = paddingString.trim().substring(1, paddingString.length() - 1);
String paddingStringArray[] = paddingString.split(",");
int size = paddingStringArray.length > 4 ? 4 : paddingStringArray.length;
for (int i = 0; i < size; i++) {
String paddingStr = paddingStringArray[i];
try {
if (!TextUtils.isEmpty(paddingStr)) {
padding[i] = parseSize(paddingStr.trim().replace("\"", ""), 0);
} else {
padding[i] = 0;
}
} catch (NumberFormatException ignored) {
padding[i] = 0;
}
}
Arrays.fill(padding, size, padding.length, padding[size - 1]);
} catch (Exception e) {
Arrays.fill(padding, 0);
}
}
} | class class_name[name] begin[{]
method[setPadding, return_type[void], modifier[public], parameter[paddingString]] begin[{]
if[call[TextUtils.isEmpty, parameter[member[.paddingString]]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paddingString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=paddingString, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=paddingString, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=split, postfix_operators=[], prefix_operators=[], qualifier=paddingString, selectors=[], type_arguments=None), name=paddingStringArray)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paddingStringArray, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>), if_false=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paddingStringArray, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=paddingStringArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=paddingStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=paddingStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=TextUtils, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=paddingStr, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=parseSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[]), MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))])], member=fill, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=fill, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setPadding] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[paddingString] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[paddingString] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[paddingString] operator[=] identifier[paddingString] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[paddingString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[paddingStringArray] operator[SEP] operator[SEP] operator[=] identifier[paddingString] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[paddingStringArray] operator[SEP] identifier[length] operator[>] Other[4] operator[?] Other[4] operator[:] identifier[paddingStringArray] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[paddingStr] operator[=] identifier[paddingStringArray] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] operator[!] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[paddingStr] operator[SEP] operator[SEP] {
identifier[padding] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[parseSize] operator[SEP] identifier[paddingStr] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] , Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[padding] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[ignored] operator[SEP] {
identifier[padding] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[padding] , identifier[size] , identifier[padding] operator[SEP] identifier[length] , identifier[padding] operator[SEP] identifier[size] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[padding] , Other[0] operator[SEP] operator[SEP]
}
}
}
|
@Override
String doGetValueAsQueryToken(FhirContext theContext) {
if (getSystem() != null) {
if (getValue() != null) {
return ParameterUtil.escape(StringUtils.defaultString(getSystem())) + '|' + ParameterUtil.escape(getValue());
} else {
return ParameterUtil.escape(StringUtils.defaultString(getSystem())) + '|';
}
}
return ParameterUtil.escape(getValue());
} | class class_name[name] begin[{]
method[doGetValueAsQueryToken, return_type[type[String]], modifier[default], parameter[theContext]] begin[{]
if[binary_operation[call[.getSystem, parameter[]], !=, literal[null]]] begin[{]
if[binary_operation[call[.getValue, parameter[]], !=, literal[null]]] begin[{]
return[binary_operation[binary_operation[call[ParameterUtil.escape, parameter[call[StringUtils.defaultString, parameter[call[.getSystem, parameter[]]]]]], +, literal['|']], +, call[ParameterUtil.escape, parameter[call[.getValue, parameter[]]]]]]
else begin[{]
return[binary_operation[call[ParameterUtil.escape, parameter[call[StringUtils.defaultString, parameter[call[.getSystem, parameter[]]]]]], +, literal['|']]]
end[}]
else begin[{]
None
end[}]
return[call[ParameterUtil.escape, parameter[call[.getValue, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[Override] identifier[String] identifier[doGetValueAsQueryToken] operator[SEP] identifier[FhirContext] identifier[theContext] operator[SEP] {
Keyword[if] operator[SEP] identifier[getSystem] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[ParameterUtil] operator[SEP] identifier[escape] operator[SEP] identifier[StringUtils] operator[SEP] identifier[defaultString] operator[SEP] identifier[getSystem] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[ParameterUtil] operator[SEP] identifier[escape] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[ParameterUtil] operator[SEP] identifier[escape] operator[SEP] identifier[StringUtils] operator[SEP] identifier[defaultString] operator[SEP] identifier[getSystem] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP]
}
}
Keyword[return] identifier[ParameterUtil] operator[SEP] identifier[escape] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private boolean checkIfUpgradeHeaders(Map<String, String> headers) {
// looking for two headers.
// connection header with a value of "upgrade"
// upgrade header with a value of "h2c"
boolean connection_upgrade = false;
boolean upgrade_h2c = false;
String headerValue = null;
Set<Entry<String, String>> headerEntrys = headers.entrySet();
for (Entry<String, String> header : headerEntrys) {
String name = header.getKey();
//check if it's an HTTP2 non-secure upgrade connection.
if (name.equalsIgnoreCase(CONSTANT_connection)) {
headerValue = header.getValue();
if (tc.isDebugEnabled()) {
Tr.debug(tc, "connection header found with value: " + headerValue);
}
if (headerValue != null && headerValue.equalsIgnoreCase(CONSTANT_connection_value)) {
if (connection_upgrade == true) {
// should not have two of these, log debug and return false
// TODO: determine if we should throw an exception here, or if this error will be dealt with in subsequent processing
if (tc.isDebugEnabled()) {
Tr.debug(tc, "malformed: second connection header found");
}
return false;
}
connection_upgrade = true;
}
}
if (name.equalsIgnoreCase(CONSTANT_upgrade)) {
headerValue = header.getValue();
if (tc.isDebugEnabled()) {
Tr.debug(tc, "upgrade header found with value: " + headerValue);
}
if (headerValue != null && headerValue.equalsIgnoreCase(CONSTANT_h2c)) {
if (upgrade_h2c == true) {
// should not have two of these, log debug and return false
// TODO: determine if we should throw an exception here, or if this error will be dealt with in subsequent processing
if (tc.isDebugEnabled()) {
Tr.debug(tc, "malformed: second upgrade header found");
}
return false;
}
upgrade_h2c = true;
}
}
}
if (connection_upgrade && upgrade_h2c) {
return true;
}
return false;
} | class class_name[name] begin[{]
method[checkIfUpgradeHeaders, return_type[type[boolean]], modifier[private], parameter[headers]] begin[{]
local_variable[type[boolean], connection_upgrade]
local_variable[type[boolean], upgrade_h2c]
local_variable[type[String], headerValue]
local_variable[type[Set], headerEntrys]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=CONSTANT_connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="connection header found with value: "), operandr=MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=CONSTANT_connection_value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=headerValue, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connection_upgrade, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="malformed: second connection header found")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=connection_upgrade, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=CONSTANT_upgrade, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="upgrade header found with value: "), operandr=MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=CONSTANT_h2c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=headerValue, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=upgrade_h2c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="malformed: second upgrade header found")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=upgrade_h2c, 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=headerEntrys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=header)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
if[binary_operation[member[.connection_upgrade], &&, member[.upgrade_h2c]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[checkIfUpgradeHeaders] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] operator[SEP] {
Keyword[boolean] identifier[connection_upgrade] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[upgrade_h2c] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[headerValue] operator[=] Other[null] operator[SEP] identifier[Set] operator[<] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[headerEntrys] operator[=] identifier[headers] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[header] operator[:] identifier[headerEntrys] operator[SEP] {
identifier[String] identifier[name] operator[=] identifier[header] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[CONSTANT_connection] operator[SEP] operator[SEP] {
identifier[headerValue] operator[=] identifier[header] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[headerValue] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[headerValue] operator[!=] Other[null] operator[&&] identifier[headerValue] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[CONSTANT_connection_value] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[connection_upgrade] operator[==] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
identifier[connection_upgrade] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[CONSTANT_upgrade] operator[SEP] operator[SEP] {
identifier[headerValue] operator[=] identifier[header] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[headerValue] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[headerValue] operator[!=] Other[null] operator[&&] identifier[headerValue] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[CONSTANT_h2c] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[upgrade_h2c] operator[==] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
identifier[upgrade_h2c] operator[=] literal[boolean] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[connection_upgrade] operator[&&] identifier[upgrade_h2c] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public FieldDescriptor[] getFieldDescriptorNonPk(boolean withInherited)
{
if(withInherited && getSuperClassDescriptor() != null)
{
FieldDescriptor[] flds = getNonPkFields();
FieldDescriptor[] superFlds = getSuperClassDescriptor().getFieldDescriptorNonPk(true);
FieldDescriptor[] result = new FieldDescriptor[flds.length + superFlds.length];
System.arraycopy(flds, 0, result, 0, flds.length);
System.arraycopy(superFlds, 0, result, flds.length, superFlds.length);
return result;
}
else
{
return getNonPkFields();
}
} | class class_name[name] begin[{]
method[getFieldDescriptorNonPk, return_type[type[FieldDescriptor]], modifier[public], parameter[withInherited]] begin[{]
if[binary_operation[member[.withInherited], &&, binary_operation[call[.getSuperClassDescriptor, parameter[]], !=, literal[null]]]] begin[{]
local_variable[type[FieldDescriptor], flds]
local_variable[type[FieldDescriptor], superFlds]
local_variable[type[FieldDescriptor], result]
call[System.arraycopy, parameter[member[.flds], literal[0], member[.result], literal[0], member[flds.length]]]
call[System.arraycopy, parameter[member[.superFlds], literal[0], member[.result], member[flds.length], member[superFlds.length]]]
return[member[.result]]
else begin[{]
return[call[.getNonPkFields, parameter[]]]
end[}]
end[}]
END[}] | Keyword[public] identifier[FieldDescriptor] operator[SEP] operator[SEP] identifier[getFieldDescriptorNonPk] operator[SEP] Keyword[boolean] identifier[withInherited] operator[SEP] {
Keyword[if] operator[SEP] identifier[withInherited] operator[&&] identifier[getSuperClassDescriptor] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[FieldDescriptor] operator[SEP] operator[SEP] identifier[flds] operator[=] identifier[getNonPkFields] operator[SEP] operator[SEP] operator[SEP] identifier[FieldDescriptor] operator[SEP] operator[SEP] identifier[superFlds] operator[=] identifier[getSuperClassDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldDescriptorNonPk] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[FieldDescriptor] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[FieldDescriptor] operator[SEP] identifier[flds] operator[SEP] identifier[length] operator[+] identifier[superFlds] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[flds] , Other[0] , identifier[result] , Other[0] , identifier[flds] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[superFlds] , Other[0] , identifier[result] , identifier[flds] operator[SEP] identifier[length] , identifier[superFlds] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[getNonPkFields] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public HBeanRowCollector listEager(String schemaName, FetchType... fetchType)
throws HBeanNotFoundException {
Set<HBeanRow> rows = listLazy(schemaName, fetchType);
HBeanRowCollector collector = new HBeanRowCollector(rows);
getEager(rows, collector, FETCH_DEPTH_MAX, fetchType);
return collector;
} | class class_name[name] begin[{]
method[listEager, return_type[type[HBeanRowCollector]], modifier[public], parameter[schemaName, fetchType]] begin[{]
local_variable[type[Set], rows]
local_variable[type[HBeanRowCollector], collector]
call[.getEager, parameter[member[.rows], member[.collector], member[.FETCH_DEPTH_MAX], member[.fetchType]]]
return[member[.collector]]
end[}]
END[}] | Keyword[public] identifier[HBeanRowCollector] identifier[listEager] operator[SEP] identifier[String] identifier[schemaName] , identifier[FetchType] operator[...] identifier[fetchType] operator[SEP] Keyword[throws] identifier[HBeanNotFoundException] {
identifier[Set] operator[<] identifier[HBeanRow] operator[>] identifier[rows] operator[=] identifier[listLazy] operator[SEP] identifier[schemaName] , identifier[fetchType] operator[SEP] operator[SEP] identifier[HBeanRowCollector] identifier[collector] operator[=] Keyword[new] identifier[HBeanRowCollector] operator[SEP] identifier[rows] operator[SEP] operator[SEP] identifier[getEager] operator[SEP] identifier[rows] , identifier[collector] , identifier[FETCH_DEPTH_MAX] , identifier[fetchType] operator[SEP] operator[SEP] Keyword[return] identifier[collector] operator[SEP]
}
|
public void error(String correlationId, Exception error) {
formatAndWrite(LogLevel.Error, correlationId, error, null, null);
} | class class_name[name] begin[{]
method[error, return_type[void], modifier[public], parameter[correlationId, error]] begin[{]
call[.formatAndWrite, parameter[member[LogLevel.Error], member[.correlationId], member[.error], literal[null], literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[error] operator[SEP] identifier[String] identifier[correlationId] , identifier[Exception] identifier[error] operator[SEP] {
identifier[formatAndWrite] operator[SEP] identifier[LogLevel] operator[SEP] identifier[Error] , identifier[correlationId] , identifier[error] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
public void setStyleClass(String styleClass)
{
if ("".equals(styleClass))
return;
AbstractHtmlState tsh = getState();
tsh.styleClass = styleClass;
} | class class_name[name] begin[{]
method[setStyleClass, return_type[void], modifier[public], parameter[styleClass]] begin[{]
if[literal[""]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[AbstractHtmlState], tsh]
assign[member[tsh.styleClass], member[.styleClass]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setStyleClass] operator[SEP] identifier[String] identifier[styleClass] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[styleClass] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[AbstractHtmlState] identifier[tsh] operator[=] identifier[getState] operator[SEP] operator[SEP] operator[SEP] identifier[tsh] operator[SEP] identifier[styleClass] operator[=] identifier[styleClass] operator[SEP]
}
|
private void interiorPointInteriorPoint_(int cluster, int id_a, int id_b) {
if (m_matrix[MatrixPredicate.InteriorInterior] == 0)
return;
int clusterParentage = m_topo_graph.getClusterParentage(cluster);
if ((clusterParentage & id_a) != 0 && (clusterParentage & id_b) != 0) {
m_matrix[MatrixPredicate.InteriorInterior] = 0;
}
} | class class_name[name] begin[{]
method[interiorPointInteriorPoint_, return_type[void], modifier[private], parameter[cluster, id_a, id_b]] begin[{]
if[binary_operation[member[.m_matrix], ==, literal[0]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[int], clusterParentage]
if[binary_operation[binary_operation[binary_operation[member[.clusterParentage], &, member[.id_a]], !=, literal[0]], &&, binary_operation[binary_operation[member[.clusterParentage], &, member[.id_b]], !=, literal[0]]]] begin[{]
assign[member[.m_matrix], literal[0]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[interiorPointInteriorPoint_] operator[SEP] Keyword[int] identifier[cluster] , Keyword[int] identifier[id_a] , Keyword[int] identifier[id_b] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_matrix] operator[SEP] identifier[MatrixPredicate] operator[SEP] identifier[InteriorInterior] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[clusterParentage] operator[=] identifier[m_topo_graph] operator[SEP] identifier[getClusterParentage] operator[SEP] identifier[cluster] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[clusterParentage] operator[&] identifier[id_a] operator[SEP] operator[!=] Other[0] operator[&&] operator[SEP] identifier[clusterParentage] operator[&] identifier[id_b] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[m_matrix] operator[SEP] identifier[MatrixPredicate] operator[SEP] identifier[InteriorInterior] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
|
public Connection connect(final String url, final Properties props) throws SQLException {
UrlParser urlParser = UrlParser.parse(url, props);
if (urlParser == null || urlParser.getHostAddresses() == null) {
return null;
} else {
return MariaDbConnection.newConnection(urlParser, null);
}
} | class class_name[name] begin[{]
method[connect, return_type[type[Connection]], modifier[public], parameter[url, props]] begin[{]
local_variable[type[UrlParser], urlParser]
if[binary_operation[binary_operation[member[.urlParser], ==, literal[null]], ||, binary_operation[call[urlParser.getHostAddresses, parameter[]], ==, literal[null]]]] begin[{]
return[literal[null]]
else begin[{]
return[call[MariaDbConnection.newConnection, parameter[member[.urlParser], literal[null]]]]
end[}]
end[}]
END[}] | Keyword[public] identifier[Connection] identifier[connect] operator[SEP] Keyword[final] identifier[String] identifier[url] , Keyword[final] identifier[Properties] identifier[props] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[UrlParser] identifier[urlParser] operator[=] identifier[UrlParser] operator[SEP] identifier[parse] operator[SEP] identifier[url] , identifier[props] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[urlParser] operator[==] Other[null] operator[||] identifier[urlParser] operator[SEP] identifier[getHostAddresses] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[MariaDbConnection] operator[SEP] identifier[newConnection] operator[SEP] identifier[urlParser] , Other[null] operator[SEP] operator[SEP]
}
}
|
private void createCodeMappings(MtasTokenIdFactory mtasTokenIdFactory,
Level level, String stringValue, int offsetStart, int offsetEnd,
int realOffsetStart, int realOffsetEnd, List<Integer> codePositions)
throws IOException {
String[] stringValues = MtasPennTreebankReader.createStrings(stringValue,
Pattern.quote(STRING_SPLITTER));
MtasToken token = new MtasTokenString(mtasTokenIdFactory.createTokenId(),
level.node, filterString(stringValues[0].trim()));
token.setOffset(offsetStart, offsetEnd);
token.setRealOffset(realOffsetStart, realOffsetEnd);
token.addPositions(codePositions.stream().mapToInt(i -> i).toArray());
tokenCollection.add(token);
level.tokens.add(token);
} | class class_name[name] begin[{]
method[createCodeMappings, return_type[void], modifier[private], parameter[mtasTokenIdFactory, level, stringValue, offsetStart, offsetEnd, realOffsetStart, realOffsetEnd, codePositions]] begin[{]
local_variable[type[String], stringValues]
local_variable[type[MtasToken], token]
call[token.setOffset, parameter[member[.offsetStart], member[.offsetEnd]]]
call[token.setRealOffset, parameter[member[.realOffsetStart], member[.realOffsetEnd]]]
call[token.addPositions, parameter[call[codePositions.stream, parameter[]]]]
call[tokenCollection.add, parameter[member[.token]]]
call[level.tokens.add, parameter[member[.token]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createCodeMappings] operator[SEP] identifier[MtasTokenIdFactory] identifier[mtasTokenIdFactory] , identifier[Level] identifier[level] , identifier[String] identifier[stringValue] , Keyword[int] identifier[offsetStart] , Keyword[int] identifier[offsetEnd] , Keyword[int] identifier[realOffsetStart] , Keyword[int] identifier[realOffsetEnd] , identifier[List] operator[<] identifier[Integer] operator[>] identifier[codePositions] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] operator[SEP] operator[SEP] identifier[stringValues] operator[=] identifier[MtasPennTreebankReader] operator[SEP] identifier[createStrings] operator[SEP] identifier[stringValue] , identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[STRING_SPLITTER] operator[SEP] operator[SEP] operator[SEP] identifier[MtasToken] identifier[token] operator[=] Keyword[new] identifier[MtasTokenString] operator[SEP] identifier[mtasTokenIdFactory] operator[SEP] identifier[createTokenId] operator[SEP] operator[SEP] , identifier[level] operator[SEP] identifier[node] , identifier[filterString] operator[SEP] identifier[stringValues] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[token] operator[SEP] identifier[setOffset] operator[SEP] identifier[offsetStart] , identifier[offsetEnd] operator[SEP] operator[SEP] identifier[token] operator[SEP] identifier[setRealOffset] operator[SEP] identifier[realOffsetStart] , identifier[realOffsetEnd] operator[SEP] operator[SEP] identifier[token] operator[SEP] identifier[addPositions] operator[SEP] identifier[codePositions] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[mapToInt] operator[SEP] identifier[i] operator[->] identifier[i] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tokenCollection] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[level] operator[SEP] identifier[tokens] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP]
}
|
public static void assertFalse(boolean condition, String format, Object... args) {
if (imp != null && condition) {
imp.assertFailed(StringUtils.format(format, args));
}
} | class class_name[name] begin[{]
method[assertFalse, return_type[void], modifier[public static], parameter[condition, format, args]] begin[{]
if[binary_operation[binary_operation[member[.imp], !=, literal[null]], &&, member[.condition]]] begin[{]
call[imp.assertFailed, parameter[call[StringUtils.format, parameter[member[.format], member[.args]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[assertFalse] operator[SEP] Keyword[boolean] identifier[condition] , identifier[String] identifier[format] , identifier[Object] operator[...] identifier[args] operator[SEP] {
Keyword[if] operator[SEP] identifier[imp] operator[!=] Other[null] operator[&&] identifier[condition] operator[SEP] {
identifier[imp] operator[SEP] identifier[assertFailed] operator[SEP] identifier[StringUtils] operator[SEP] identifier[format] operator[SEP] identifier[format] , identifier[args] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Nonnull
public ValidationResultList executeValidation (@Nonnull final IValidationSource aSource)
{
return executeValidation (aSource, (Locale) null);
} | class class_name[name] begin[{]
method[executeValidation, return_type[type[ValidationResultList]], modifier[public], parameter[aSource]] begin[{]
return[call[.executeValidation, parameter[member[.aSource], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] identifier[ValidationResultList] identifier[executeValidation] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[IValidationSource] identifier[aSource] operator[SEP] {
Keyword[return] identifier[executeValidation] operator[SEP] identifier[aSource] , operator[SEP] identifier[Locale] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
|
public Long untilAtomic(final AtomicLong atomic, final Matcher<? super Long> matcher) {
return until(new CallableHamcrestCondition<Long>(new Callable<Long>() {
public Long call() {
return atomic.get();
}
}, matcher, generateConditionSettings()));
} | class class_name[name] begin[{]
method[untilAtomic, return_type[type[Long]], modifier[public], parameter[atomic, matcher]] begin[{]
return[call[.until, parameter[ClassCreator(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=atomic, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Long, 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=Long, sub_type=None))], dimensions=None, name=Callable, sub_type=None)), MemberReference(member=matcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=generateConditionSettings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=None, name=CallableHamcrestCondition, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Long] identifier[untilAtomic] operator[SEP] Keyword[final] identifier[AtomicLong] identifier[atomic] , Keyword[final] identifier[Matcher] operator[<] operator[?] Keyword[super] identifier[Long] operator[>] identifier[matcher] operator[SEP] {
Keyword[return] identifier[until] operator[SEP] Keyword[new] identifier[CallableHamcrestCondition] operator[<] identifier[Long] operator[>] operator[SEP] Keyword[new] identifier[Callable] operator[<] identifier[Long] operator[>] operator[SEP] operator[SEP] {
Keyword[public] identifier[Long] identifier[call] operator[SEP] operator[SEP] {
Keyword[return] identifier[atomic] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
} , identifier[matcher] , identifier[generateConditionSettings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected static String listToCommaDelimitedString(List<String> stringList) {
if (stringList == null) {
return "";
}
StringBuilder result = new StringBuilder();
for (Iterator<String> it = stringList.iterator(); it.hasNext();) {
Object element = it.next();
if (element != null) {
result.append(element);
if (it.hasNext()) {
result.append(", ");
}
}
}
return result.toString();
} | class class_name[name] begin[{]
method[listToCommaDelimitedString, return_type[type[String]], modifier[static protected], parameter[stringList]] begin[{]
if[binary_operation[member[.stringList], ==, literal[null]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], result]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), 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=result, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=stringList, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[call[result.toString, parameter[]]]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[String] identifier[listToCommaDelimitedString] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[stringList] operator[SEP] {
Keyword[if] operator[SEP] identifier[stringList] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[it] operator[=] identifier[stringList] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Object] identifier[element] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[!=] Other[null] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
private static void expandRules() {
// long start = System.currentTimeMillis();
// iterate over all SAX containers
// ArrayList<SAXMapEntry<Integer, Integer>> recs = new ArrayList<SAXMapEntry<Integer, Integer>>(
// arrRuleRecords.size());
//
// for (GrammarRuleRecord ruleRecord : arrRuleRecords) {
// recs.add(new SAXMapEntry<Integer, Integer>(ruleRecord.getRuleLevel(), ruleRecord
// .getRuleNumber()));
// }
//
// Collections.sort(recs, new Comparator<SAXMapEntry<Integer, Integer>>() {
// @Override
// public int compare(SAXMapEntry<Integer, Integer> o1, SAXMapEntry<Integer, Integer> o2) {
// return o1.getKey().compareTo(o2.getKey());
// }
// });
// for (SAXMapEntry<Integer, Integer> entry : recs) {
for (GrammarRuleRecord ruleRecord : arrRuleRecords) {
if (ruleRecord.getRuleNumber() == 0) {
continue;
}
String curString = ruleRecord.getRuleString();
StringBuilder resultString = new StringBuilder(8192);
String[] split = curString.split(" ");
for (String s : split) {
if (s.startsWith("R")) {
resultString.append(" ").append(expandRule(Integer.valueOf(s.substring(1, s.length()))));
}
else {
resultString.append(" ").append(s);
}
}
// need to trim space at the very end
String rr = resultString.delete(0, 1).append(" ").toString();
ruleRecord.setExpandedRuleString(rr);
ruleRecord.setRuleYield(countSpaces(rr));
}
StringBuilder resultString = new StringBuilder(8192);
GrammarRuleRecord ruleRecord = arrRuleRecords.get(0);
resultString.append(ruleRecord.getRuleString());
int currentSearchStart = resultString.indexOf("R");
while (currentSearchStart >= 0) {
int spaceIdx = resultString.indexOf(" ", currentSearchStart);
String ruleName = resultString.substring(currentSearchStart, spaceIdx + 1);
Integer ruleId = Integer.valueOf(ruleName.substring(1, ruleName.length() - 1));
resultString.replace(spaceIdx - ruleName.length() + 1, spaceIdx + 1,
arrRuleRecords.get(ruleId).getExpandedRuleString());
currentSearchStart = resultString.indexOf("R");
}
ruleRecord.setExpandedRuleString(resultString.toString().trim());
// ruleRecord.setRuleYield(countSpaces(resultString));
// long end = System.currentTimeMillis();
// System.out.println("Rules expanded in " + SAXFactory.timeToString(start, end));
} | class class_name[name] begin[{]
method[expandRules, return_type[void], modifier[private static], parameter[]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRuleNumber, postfix_operators=[], prefix_operators=[], qualifier=ruleRecord, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRuleString, postfix_operators=[], prefix_operators=[], qualifier=ruleRecord, selectors=[], type_arguments=None), name=curString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8192)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=resultString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=split, postfix_operators=[], prefix_operators=[], qualifier=curString, selectors=[], type_arguments=None), name=split)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="R")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), else_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=resultString, selectors=[MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), 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=resultString, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=expandRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=delete, postfix_operators=[], prefix_operators=[], qualifier=resultString, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=rr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setExpandedRuleString, postfix_operators=[], prefix_operators=[], qualifier=ruleRecord, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=rr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=countSpaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setRuleYield, postfix_operators=[], prefix_operators=[], qualifier=ruleRecord, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=arrRuleRecords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ruleRecord)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GrammarRuleRecord, sub_type=None))), label=None)
local_variable[type[StringBuilder], resultString]
local_variable[type[GrammarRuleRecord], ruleRecord]
call[resultString.append, parameter[call[ruleRecord.getRuleString, parameter[]]]]
local_variable[type[int], currentSearchStart]
while[binary_operation[member[.currentSearchStart], >=, literal[0]]] begin[{]
local_variable[type[int], spaceIdx]
local_variable[type[String], ruleName]
local_variable[type[Integer], ruleId]
call[resultString.replace, parameter[binary_operation[binary_operation[member[.spaceIdx], -, call[ruleName.length, parameter[]]], +, literal[1]], binary_operation[member[.spaceIdx], +, literal[1]], call[arrRuleRecords.get, parameter[member[.ruleId]]]]]
assign[member[.currentSearchStart], call[resultString.indexOf, parameter[literal["R"]]]]
end[}]
call[ruleRecord.setExpandedRuleString, parameter[call[resultString.toString, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[expandRules] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[GrammarRuleRecord] identifier[ruleRecord] operator[:] identifier[arrRuleRecords] operator[SEP] {
Keyword[if] operator[SEP] identifier[ruleRecord] operator[SEP] identifier[getRuleNumber] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] identifier[curString] operator[=] identifier[ruleRecord] operator[SEP] identifier[getRuleString] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[resultString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[8192] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[split] operator[=] identifier[curString] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[split] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[resultString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[expandRule] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[resultString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
}
identifier[String] identifier[rr] operator[=] identifier[resultString] operator[SEP] identifier[delete] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[ruleRecord] operator[SEP] identifier[setExpandedRuleString] operator[SEP] identifier[rr] operator[SEP] operator[SEP] identifier[ruleRecord] operator[SEP] identifier[setRuleYield] operator[SEP] identifier[countSpaces] operator[SEP] identifier[rr] operator[SEP] operator[SEP] operator[SEP]
}
identifier[StringBuilder] identifier[resultString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[8192] operator[SEP] operator[SEP] identifier[GrammarRuleRecord] identifier[ruleRecord] operator[=] identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[resultString] operator[SEP] identifier[append] operator[SEP] identifier[ruleRecord] operator[SEP] identifier[getRuleString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[currentSearchStart] operator[=] identifier[resultString] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[currentSearchStart] operator[>=] Other[0] operator[SEP] {
Keyword[int] identifier[spaceIdx] operator[=] identifier[resultString] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[currentSearchStart] operator[SEP] operator[SEP] identifier[String] identifier[ruleName] operator[=] identifier[resultString] operator[SEP] identifier[substring] operator[SEP] identifier[currentSearchStart] , identifier[spaceIdx] operator[+] Other[1] operator[SEP] operator[SEP] identifier[Integer] identifier[ruleId] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[ruleName] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[ruleName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[resultString] operator[SEP] identifier[replace] operator[SEP] identifier[spaceIdx] operator[-] identifier[ruleName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] , identifier[spaceIdx] operator[+] Other[1] , identifier[arrRuleRecords] operator[SEP] identifier[get] operator[SEP] identifier[ruleId] operator[SEP] operator[SEP] identifier[getExpandedRuleString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[currentSearchStart] operator[=] identifier[resultString] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[ruleRecord] operator[SEP] identifier[setExpandedRuleString] operator[SEP] identifier[resultString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public IDEStructureFLAGS createIDEStructureFLAGSFromString(EDataType eDataType, String initialValue) {
IDEStructureFLAGS result = IDEStructureFLAGS.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | class class_name[name] begin[{]
method[createIDEStructureFLAGSFromString, return_type[type[IDEStructureFLAGS]], modifier[public], parameter[eDataType, initialValue]] begin[{]
local_variable[type[IDEStructureFLAGS], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[IDEStructureFLAGS] identifier[createIDEStructureFLAGSFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] {
identifier[IDEStructureFLAGS] identifier[result] operator[=] identifier[IDEStructureFLAGS] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
private void resize(int needSpaceFor) {
char[] old = mBuffer;
int oldLen = old.length;
int addition = oldLen >> 1; // Grow by 50%
needSpaceFor -= (oldLen - mBufferLen);
if (addition < needSpaceFor) {
addition = needSpaceFor;
}
mBuffer = new char[oldLen+addition];
System.arraycopy(old, 0, mBuffer, 0, mBufferLen);
} | class class_name[name] begin[{]
method[resize, return_type[void], modifier[private], parameter[needSpaceFor]] begin[{]
local_variable[type[char], old]
local_variable[type[int], oldLen]
local_variable[type[int], addition]
assign[member[.needSpaceFor], binary_operation[member[.oldLen], -, member[.mBufferLen]]]
if[binary_operation[member[.addition], <, member[.needSpaceFor]]] begin[{]
assign[member[.addition], member[.needSpaceFor]]
else begin[{]
None
end[}]
assign[member[.mBuffer], ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=oldLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=addition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char))]
call[System.arraycopy, parameter[member[.old], literal[0], member[.mBuffer], literal[0], member[.mBufferLen]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[resize] operator[SEP] Keyword[int] identifier[needSpaceFor] operator[SEP] {
Keyword[char] operator[SEP] operator[SEP] identifier[old] operator[=] identifier[mBuffer] operator[SEP] Keyword[int] identifier[oldLen] operator[=] identifier[old] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[addition] operator[=] identifier[oldLen] operator[>] operator[>] Other[1] operator[SEP] identifier[needSpaceFor] operator[-=] operator[SEP] identifier[oldLen] operator[-] identifier[mBufferLen] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[addition] operator[<] identifier[needSpaceFor] operator[SEP] {
identifier[addition] operator[=] identifier[needSpaceFor] operator[SEP]
}
identifier[mBuffer] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[oldLen] operator[+] identifier[addition] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[old] , Other[0] , identifier[mBuffer] , Other[0] , identifier[mBufferLen] operator[SEP] operator[SEP]
}
|
private static Object unwrap(Object object) {
if (object instanceof Reflect) {
return ((Reflect) object).get();
}
return object;
} | class class_name[name] begin[{]
method[unwrap, return_type[type[Object]], modifier[private static], parameter[object]] begin[{]
if[binary_operation[member[.object], instanceof, type[Reflect]]] begin[{]
return[Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Reflect, sub_type=None))]
else begin[{]
None
end[}]
return[member[.object]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Object] identifier[unwrap] operator[SEP] identifier[Object] identifier[object] operator[SEP] {
Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Reflect] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[Reflect] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[object] operator[SEP]
}
|
public static Map<String, String[]> readParameterMapFromMultiPart(
String encoding,
List<FileItem> multiPartFileItems) {
Map<String, String[]> parameterMap = new HashMap<String, String[]>();
Iterator<FileItem> i = multiPartFileItems.iterator();
while (i.hasNext()) {
FileItem item = i.next();
String name = item.getFieldName();
String value = null;
if ((name != null) && (item.getName() == null)) {
// only put to map if current item is no file and not null
try {
value = item.getString(encoding);
} catch (UnsupportedEncodingException e) {
LOG.error(Messages.get().getBundle().key(Messages.LOG_ENC_MULTIPART_REQ_ERROR_0), e);
value = item.getString();
}
if (parameterMap.containsKey(name)) {
// append value to parameter values array
String[] oldValues = parameterMap.get(name);
String[] newValues = new String[oldValues.length + 1];
System.arraycopy(oldValues, 0, newValues, 0, oldValues.length);
newValues[oldValues.length] = value;
parameterMap.put(name, newValues);
} else {
parameterMap.put(name, new String[] {value});
}
}
}
return parameterMap;
} | class class_name[name] begin[{]
method[readParameterMapFromMultiPart, return_type[type[Map]], modifier[public static], parameter[encoding, multiPartFileItems]] begin[{]
local_variable[type[Map], parameterMap]
local_variable[type[Iterator], i]
while[call[i.hasNext, parameter[]]] begin[{]
local_variable[type[FileItem], item]
local_variable[type[String], name]
local_variable[type[String], value]
if[binary_operation[binary_operation[member[.name], !=, literal[null]], &&, binary_operation[call[item.getName, parameter[]], ==, literal[null]]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_ENC_MULTIPART_REQ_ERROR_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getString, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
if[call[parameterMap.containsKey, parameter[member[.name]]]] begin[{]
local_variable[type[String], oldValues]
local_variable[type[String], newValues]
call[System.arraycopy, parameter[member[.oldValues], literal[0], member[.newValues], literal[0], member[oldValues.length]]]
assign[member[.newValues], member[.value]]
call[parameterMap.put, parameter[member[.name], member[.newValues]]]
else begin[{]
call[parameterMap.put, parameter[member[.name], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
end[}]
else begin[{]
None
end[}]
end[}]
return[member[.parameterMap]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] identifier[readParameterMapFromMultiPart] operator[SEP] identifier[String] identifier[encoding] , identifier[List] operator[<] identifier[FileItem] operator[>] identifier[multiPartFileItems] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] identifier[parameterMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[FileItem] operator[>] identifier[i] operator[=] identifier[multiPartFileItems] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[FileItem] identifier[item] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[item] operator[SEP] identifier[getFieldName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[item] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[value] operator[=] identifier[item] operator[SEP] identifier[getString] operator[SEP] identifier[encoding] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_ENC_MULTIPART_REQ_ERROR_0] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[item] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[parameterMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[oldValues] operator[=] identifier[parameterMap] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[newValues] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[oldValues] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[oldValues] , Other[0] , identifier[newValues] , Other[0] , identifier[oldValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[newValues] operator[SEP] identifier[oldValues] operator[SEP] identifier[length] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[parameterMap] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[newValues] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[parameterMap] operator[SEP] identifier[put] operator[SEP] identifier[name] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[value]
} operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[parameterMap] operator[SEP]
}
|
public ValidationData minimalize() {
this.setValidationRules(this.validationRules.stream().filter(vr -> vr.isUse()).collect(Collectors.toList()));
return this;
} | class class_name[name] begin[{]
method[minimalize, return_type[type[ValidationData]], modifier[public], parameter[]] begin[{]
THIS[call[None.setValidationRules, parameter[THIS[member[None.validationRules]call[None.stream, parameter[]]call[None.filter, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=isUse, postfix_operators=[], prefix_operators=[], qualifier=vr, selectors=[], type_arguments=None), parameters=[MemberReference(member=vr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]call[None.collect, parameter[call[Collectors.toList, parameter[]]]]]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ValidationData] identifier[minimalize] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setValidationRules] operator[SEP] Keyword[this] operator[SEP] identifier[validationRules] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[vr] operator[->] identifier[vr] operator[SEP] identifier[isUse] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public void writeComma() {
JsonValueContext valueContext = peekValueContext();
if (valueContext != null) {
valueContext.incrementIndex();
}
super.writeComma();
} | class class_name[name] begin[{]
method[writeComma, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[JsonValueContext], valueContext]
if[binary_operation[member[.valueContext], !=, literal[null]]] begin[{]
call[valueContext.incrementIndex, parameter[]]
else begin[{]
None
end[}]
SuperMethodInvocation(arguments=[], member=writeComma, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeComma] operator[SEP] operator[SEP] {
identifier[JsonValueContext] identifier[valueContext] operator[=] identifier[peekValueContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueContext] operator[!=] Other[null] operator[SEP] {
identifier[valueContext] operator[SEP] identifier[incrementIndex] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[super] operator[SEP] identifier[writeComma] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void saveSearchFavourite(SearchFavourite sf, final DataCallback<SearchFavourite> onFinished) {
SaveSearchFavouriteRequest ssfr = new SaveSearchFavouriteRequest();
ssfr.setSearchFavourite(sf);
GwtCommand command = new GwtCommand(SaveSearchFavouriteRequest.COMMAND);
command.setCommandRequest(ssfr);
GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<SaveSearchFavouriteResponse>() {
public void execute(SaveSearchFavouriteResponse response) {
if (onFinished != null) {
onFinished.execute(response.getSearchFavourite());
}
}
});
} | class class_name[name] begin[{]
method[saveSearchFavourite, return_type[void], modifier[public static], parameter[sf, onFinished]] begin[{]
local_variable[type[SaveSearchFavouriteRequest], ssfr]
call[ssfr.setSearchFavourite, parameter[member[.sf]]]
local_variable[type[GwtCommand], command]
call[command.setCommandRequest, parameter[member[.ssfr]]]
call[GwtCommandDispatcher.getInstance, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[saveSearchFavourite] operator[SEP] identifier[SearchFavourite] identifier[sf] , Keyword[final] identifier[DataCallback] operator[<] identifier[SearchFavourite] operator[>] identifier[onFinished] operator[SEP] {
identifier[SaveSearchFavouriteRequest] identifier[ssfr] operator[=] Keyword[new] identifier[SaveSearchFavouriteRequest] operator[SEP] operator[SEP] operator[SEP] identifier[ssfr] operator[SEP] identifier[setSearchFavourite] operator[SEP] identifier[sf] operator[SEP] operator[SEP] identifier[GwtCommand] identifier[command] operator[=] Keyword[new] identifier[GwtCommand] operator[SEP] identifier[SaveSearchFavouriteRequest] operator[SEP] identifier[COMMAND] operator[SEP] operator[SEP] identifier[command] operator[SEP] identifier[setCommandRequest] operator[SEP] identifier[ssfr] operator[SEP] operator[SEP] identifier[GwtCommandDispatcher] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[command] , Keyword[new] identifier[AbstractCommandCallback] operator[<] identifier[SaveSearchFavouriteResponse] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[SaveSearchFavouriteResponse] identifier[response] operator[SEP] {
Keyword[if] operator[SEP] identifier[onFinished] operator[!=] Other[null] operator[SEP] {
identifier[onFinished] operator[SEP] identifier[execute] operator[SEP] identifier[response] operator[SEP] identifier[getSearchFavourite] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
public void equiToNorm(double x , double y , Point3D_F64 norm ) {
equiToLatLon(x,y, temp);
ConvertCoordinates3D_F64.latlonToUnitVector(temp.lat,temp.lon, norm);
} | class class_name[name] begin[{]
method[equiToNorm, return_type[void], modifier[public], parameter[x, y, norm]] begin[{]
call[.equiToLatLon, parameter[member[.x], member[.y], member[.temp]]]
call[ConvertCoordinates3D_F64.latlonToUnitVector, parameter[member[temp.lat], member[temp.lon], member[.norm]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[equiToNorm] operator[SEP] Keyword[double] identifier[x] , Keyword[double] identifier[y] , identifier[Point3D_F64] identifier[norm] operator[SEP] {
identifier[equiToLatLon] operator[SEP] identifier[x] , identifier[y] , identifier[temp] operator[SEP] operator[SEP] identifier[ConvertCoordinates3D_F64] operator[SEP] identifier[latlonToUnitVector] operator[SEP] identifier[temp] operator[SEP] identifier[lat] , identifier[temp] operator[SEP] identifier[lon] , identifier[norm] operator[SEP] operator[SEP]
}
|
public DBInstance withOptionGroupMemberships(OptionGroupMembership... optionGroupMemberships) {
if (this.optionGroupMemberships == null) {
setOptionGroupMemberships(new com.amazonaws.internal.SdkInternalList<OptionGroupMembership>(optionGroupMemberships.length));
}
for (OptionGroupMembership ele : optionGroupMemberships) {
this.optionGroupMemberships.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withOptionGroupMemberships, return_type[type[DBInstance]], modifier[public], parameter[optionGroupMemberships]] begin[{]
if[binary_operation[THIS[member[None.optionGroupMemberships]], ==, literal[null]]] begin[{]
call[.setOptionGroupMemberships, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=optionGroupMemberships, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=OptionGroupMembership, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=optionGroupMemberships, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=optionGroupMemberships, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OptionGroupMembership, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DBInstance] identifier[withOptionGroupMemberships] operator[SEP] identifier[OptionGroupMembership] operator[...] identifier[optionGroupMemberships] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[optionGroupMemberships] operator[==] Other[null] operator[SEP] {
identifier[setOptionGroupMemberships] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[OptionGroupMembership] operator[>] operator[SEP] identifier[optionGroupMemberships] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[OptionGroupMembership] identifier[ele] operator[:] identifier[optionGroupMemberships] operator[SEP] {
Keyword[this] operator[SEP] identifier[optionGroupMemberships] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@SuppressWarnings("unchecked")
@Override
public REC previous() {
checkDirection(false);
if (currentRecord != null)
try {
// RETURN LAST LOADED RECORD
return (REC) currentRecord;
} finally {
currentRecord = null;
}
ORecord record = getRecord();
// MOVE BACKWARD IN THE CURRENT CLUSTER
while (hasPrevious()) {
if (currentRecord != null)
try {
// RETURN LAST LOADED RECORD
return (REC) currentRecord;
} finally {
currentRecord = null;
}
record = getTransactionEntry();
if (record == null)
record = readCurrentRecord(null, -1);
if (record != null)
// FOUND
if (include(record))
return (REC) record;
}
record = getTransactionEntry();
if (record != null)
return (REC) record;
return null;
} | class class_name[name] begin[{]
method[previous, return_type[type[REC]], modifier[public], parameter[]] begin[{]
call[.checkDirection, parameter[literal[false]]]
if[binary_operation[member[.currentRecord], !=, literal[null]]] begin[{]
TryStatement(block=[ReturnStatement(expression=Cast(expression=MemberReference(member=currentRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=REC, sub_type=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
local_variable[type[ORecord], record]
while[call[.hasPrevious, parameter[]]] begin[{]
if[binary_operation[member[.currentRecord], !=, literal[null]]] begin[{]
TryStatement(block=[ReturnStatement(expression=Cast(expression=MemberReference(member=currentRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=REC, sub_type=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
assign[member[.record], call[.getTransactionEntry, parameter[]]]
if[binary_operation[member[.record], ==, literal[null]]] begin[{]
assign[member[.record], call[.readCurrentRecord, parameter[literal[null], literal[1]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.record], !=, literal[null]]] begin[{]
if[call[.include, parameter[member[.record]]]] begin[{]
return[Cast(expression=MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=REC, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
assign[member[.record], call[.getTransactionEntry, parameter[]]]
if[binary_operation[member[.record], !=, literal[null]]] begin[{]
return[Cast(expression=MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=REC, sub_type=None))]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[REC] identifier[previous] operator[SEP] operator[SEP] {
identifier[checkDirection] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentRecord] operator[!=] Other[null] operator[SEP] Keyword[try] {
Keyword[return] operator[SEP] identifier[REC] operator[SEP] identifier[currentRecord] operator[SEP]
}
Keyword[finally] {
identifier[currentRecord] operator[=] Other[null] operator[SEP]
}
identifier[ORecord] identifier[record] operator[=] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[hasPrevious] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentRecord] operator[!=] Other[null] operator[SEP] Keyword[try] {
Keyword[return] operator[SEP] identifier[REC] operator[SEP] identifier[currentRecord] operator[SEP]
}
Keyword[finally] {
identifier[currentRecord] operator[=] Other[null] operator[SEP]
}
identifier[record] operator[=] identifier[getTransactionEntry] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[==] Other[null] operator[SEP] identifier[record] operator[=] identifier[readCurrentRecord] operator[SEP] Other[null] , operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[include] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[REC] operator[SEP] identifier[record] operator[SEP]
}
identifier[record] operator[=] identifier[getTransactionEntry] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[!=] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[REC] operator[SEP] identifier[record] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey collapserKey, HystrixCollapserProperties.Setter builder) {
return new HystrixPropertiesCollapserDefault(collapserKey, builder);
} | class class_name[name] begin[{]
method[getCollapserProperties, return_type[type[HystrixCollapserProperties]], modifier[public], parameter[collapserKey, builder]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=collapserKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=builder, 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=HystrixPropertiesCollapserDefault, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[HystrixCollapserProperties] identifier[getCollapserProperties] operator[SEP] identifier[HystrixCollapserKey] identifier[collapserKey] , identifier[HystrixCollapserProperties] operator[SEP] identifier[Setter] identifier[builder] operator[SEP] {
Keyword[return] Keyword[new] identifier[HystrixPropertiesCollapserDefault] operator[SEP] identifier[collapserKey] , identifier[builder] operator[SEP] operator[SEP]
}
|
@Override
public List<CPOption> findAll(int start, int end) {
return findAll(start, end, null);
} | class class_name[name] begin[{]
method[findAll, return_type[type[List]], modifier[public], parameter[start, end]] begin[{]
return[call[.findAll, parameter[member[.start], member[.end], literal[null]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CPOption] operator[>] identifier[findAll] operator[SEP] Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] {
Keyword[return] identifier[findAll] operator[SEP] identifier[start] , identifier[end] , Other[null] operator[SEP] operator[SEP]
}
|
public CollectionRequest<CustomField> findByWorkspace(String workspace) {
String path = String.format("/workspaces/%s/custom_fields", workspace);
return new CollectionRequest<CustomField>(this, CustomField.class, path, "GET");
} | class class_name[name] begin[{]
method[findByWorkspace, return_type[type[CollectionRequest]], modifier[public], parameter[workspace]] begin[{]
local_variable[type[String], path]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CustomField, sub_type=None)), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GET")], 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=CustomField, sub_type=None))], dimensions=None, name=CollectionRequest, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[CollectionRequest] operator[<] identifier[CustomField] operator[>] identifier[findByWorkspace] operator[SEP] identifier[String] identifier[workspace] operator[SEP] {
identifier[String] identifier[path] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[workspace] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CollectionRequest] operator[<] identifier[CustomField] operator[>] operator[SEP] Keyword[this] , identifier[CustomField] operator[SEP] Keyword[class] , identifier[path] , literal[String] operator[SEP] operator[SEP]
}
|
public static synchronized void resetOrUpdateFromCache(KryoSerialization instance, KryoInstantiator kryoInst){
if(kryoInst != cachedKryoInst) {
cachedPool = KryoPool.withByteArrayOutputStream(MAX_CACHED_KRYO, kryoInst);
cachedKryoInst = kryoInst;
}
instance.kryoPool = cachedPool;
} | class class_name[name] begin[{]
method[resetOrUpdateFromCache, return_type[void], modifier[synchronized public static], parameter[instance, kryoInst]] begin[{]
if[binary_operation[member[.kryoInst], !=, member[.cachedKryoInst]]] begin[{]
assign[member[.cachedPool], call[KryoPool.withByteArrayOutputStream, parameter[member[.MAX_CACHED_KRYO], member[.kryoInst]]]]
assign[member[.cachedKryoInst], member[.kryoInst]]
else begin[{]
None
end[}]
assign[member[instance.kryoPool], member[.cachedPool]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[synchronized] Keyword[void] identifier[resetOrUpdateFromCache] operator[SEP] identifier[KryoSerialization] identifier[instance] , identifier[KryoInstantiator] identifier[kryoInst] operator[SEP] {
Keyword[if] operator[SEP] identifier[kryoInst] operator[!=] identifier[cachedKryoInst] operator[SEP] {
identifier[cachedPool] operator[=] identifier[KryoPool] operator[SEP] identifier[withByteArrayOutputStream] operator[SEP] identifier[MAX_CACHED_KRYO] , identifier[kryoInst] operator[SEP] operator[SEP] identifier[cachedKryoInst] operator[=] identifier[kryoInst] operator[SEP]
}
identifier[instance] operator[SEP] identifier[kryoPool] operator[=] identifier[cachedPool] operator[SEP]
}
|
public DescribeTimeBasedAutoScalingResult withTimeBasedAutoScalingConfigurations(TimeBasedAutoScalingConfiguration... timeBasedAutoScalingConfigurations) {
if (this.timeBasedAutoScalingConfigurations == null) {
setTimeBasedAutoScalingConfigurations(new com.amazonaws.internal.SdkInternalList<TimeBasedAutoScalingConfiguration>(
timeBasedAutoScalingConfigurations.length));
}
for (TimeBasedAutoScalingConfiguration ele : timeBasedAutoScalingConfigurations) {
this.timeBasedAutoScalingConfigurations.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withTimeBasedAutoScalingConfigurations, return_type[type[DescribeTimeBasedAutoScalingResult]], modifier[public], parameter[timeBasedAutoScalingConfigurations]] begin[{]
if[binary_operation[THIS[member[None.timeBasedAutoScalingConfigurations]], ==, literal[null]]] begin[{]
call[.setTimeBasedAutoScalingConfigurations, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=timeBasedAutoScalingConfigurations, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TimeBasedAutoScalingConfiguration, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=timeBasedAutoScalingConfigurations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=timeBasedAutoScalingConfigurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimeBasedAutoScalingConfiguration, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DescribeTimeBasedAutoScalingResult] identifier[withTimeBasedAutoScalingConfigurations] operator[SEP] identifier[TimeBasedAutoScalingConfiguration] operator[...] identifier[timeBasedAutoScalingConfigurations] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[timeBasedAutoScalingConfigurations] operator[==] Other[null] operator[SEP] {
identifier[setTimeBasedAutoScalingConfigurations] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[TimeBasedAutoScalingConfiguration] operator[>] operator[SEP] identifier[timeBasedAutoScalingConfigurations] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[TimeBasedAutoScalingConfiguration] identifier[ele] operator[:] identifier[timeBasedAutoScalingConfigurations] operator[SEP] {
Keyword[this] operator[SEP] identifier[timeBasedAutoScalingConfigurations] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private void updateFinishedCounters(ThisStatistics localStatistics)
throws InterruptedException {
int snapshotJobsProcessed = countJobsProcessedLower_.get();
/*
* ensure that all contexts for processed jobs are marked as saturated
*/
for (;;) {
int snapshotCountContextsSaturatedLower = countContextsSaturatedLower_
.get();
saturationState_
.setContextsSaturated(snapshotCountContextsSaturatedLower);
if (saturationState_
.getContextSetSaturatedCount() < snapshotCountContextsSaturatedLower) {
/*
* this means that some other worker also sets contexts as
* saturated, then it will mark the finished jobs instead
*/
return;
}
/*
* ensure that the counter for processed jobs is still up to date
*/
int updatedSnapshotJobsProcessed = countJobsProcessedLower_.get();
if (updatedSnapshotJobsProcessed == snapshotJobsProcessed) {
break;
}
/* else refresh counters */
snapshotJobsProcessed = updatedSnapshotJobsProcessed;
}
/*
* ensure that all processed jobs are finished
*/
for (;;) {
int snapshotJobsFinished = countJobsFinishedUpper_.get();
if (snapshotJobsFinished >= snapshotJobsProcessed) {
break;
}
/*
* update the finished context counter at least to the taken
* snapshot value and mark the corresponding number of jobs as
* processed
*/
if (!countJobsFinishedUpper_.compareAndSet(snapshotJobsFinished,
snapshotJobsFinished + 1)) {
/* retry */
continue;
}
// else
J nextJob = jobsInProgress_.poll();
IndexedContextRoot root = nextJob.getInput();
Context rootSaturation = saturationState_.getContext(root);
if (rootSaturation.isInitialized()
&& !rootSaturation.isSaturated()) {
LOGGER_.error("{}: context for a finished job not saturated!",
rootSaturation);
}
nextJob.setOutput(rootSaturation);
LOGGER_.trace("{}: saturation finished", root);
localStatistics.jobsProcessedNo++;
listener_.notifyFinished(nextJob);// can be interrupted
}
} | class class_name[name] begin[{]
method[updateFinishedCounters, return_type[void], modifier[private], parameter[localStatistics]] begin[{]
local_variable[type[int], snapshotJobsProcessed]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=countContextsSaturatedLower_, selectors=[], type_arguments=None), name=snapshotCountContextsSaturatedLower)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=snapshotCountContextsSaturatedLower, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContextsSaturated, postfix_operators=[], prefix_operators=[], qualifier=saturationState_, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getContextSetSaturatedCount, postfix_operators=[], prefix_operators=[], qualifier=saturationState_, selectors=[], type_arguments=None), operandr=MemberReference(member=snapshotCountContextsSaturatedLower, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=countJobsProcessedLower_, selectors=[], type_arguments=None), name=updatedSnapshotJobsProcessed)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=updatedSnapshotJobsProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=snapshotJobsProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=snapshotJobsProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=updatedSnapshotJobsProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=countJobsFinishedUpper_, selectors=[], type_arguments=None), name=snapshotJobsFinished)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=snapshotJobsFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=snapshotJobsProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=snapshotJobsFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=snapshotJobsFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=compareAndSet, postfix_operators=[], prefix_operators=['!'], qualifier=countJobsFinishedUpper_, 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=[], member=poll, postfix_operators=[], prefix_operators=[], qualifier=jobsInProgress_, selectors=[], type_arguments=None), name=nextJob)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=J, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInput, postfix_operators=[], prefix_operators=[], qualifier=nextJob, selectors=[], type_arguments=None), name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IndexedContextRoot, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=saturationState_, selectors=[], type_arguments=None), name=rootSaturation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Context, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isInitialized, postfix_operators=[], prefix_operators=[], qualifier=rootSaturation, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isSaturated, postfix_operators=[], prefix_operators=['!'], qualifier=rootSaturation, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: context for a finished job not saturated!"), MemberReference(member=rootSaturation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER_, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootSaturation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOutput, postfix_operators=[], prefix_operators=[], qualifier=nextJob, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: saturation finished"), MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER_, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=jobsProcessedNo, postfix_operators=['++'], prefix_operators=[], qualifier=localStatistics, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nextJob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=notifyFinished, postfix_operators=[], prefix_operators=[], qualifier=listener_, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateFinishedCounters] operator[SEP] identifier[ThisStatistics] identifier[localStatistics] operator[SEP] Keyword[throws] identifier[InterruptedException] {
Keyword[int] identifier[snapshotJobsProcessed] operator[=] identifier[countJobsProcessedLower_] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[snapshotCountContextsSaturatedLower] operator[=] identifier[countContextsSaturatedLower_] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[saturationState_] operator[SEP] identifier[setContextsSaturated] operator[SEP] identifier[snapshotCountContextsSaturatedLower] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[saturationState_] operator[SEP] identifier[getContextSetSaturatedCount] operator[SEP] operator[SEP] operator[<] identifier[snapshotCountContextsSaturatedLower] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[int] identifier[updatedSnapshotJobsProcessed] operator[=] identifier[countJobsProcessedLower_] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[updatedSnapshotJobsProcessed] operator[==] identifier[snapshotJobsProcessed] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[snapshotJobsProcessed] operator[=] identifier[updatedSnapshotJobsProcessed] operator[SEP]
}
Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[snapshotJobsFinished] operator[=] identifier[countJobsFinishedUpper_] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[snapshotJobsFinished] operator[>=] identifier[snapshotJobsProcessed] operator[SEP] {
Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[countJobsFinishedUpper_] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[snapshotJobsFinished] , identifier[snapshotJobsFinished] operator[+] Other[1] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[J] identifier[nextJob] operator[=] identifier[jobsInProgress_] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[IndexedContextRoot] identifier[root] operator[=] identifier[nextJob] operator[SEP] identifier[getInput] operator[SEP] operator[SEP] operator[SEP] identifier[Context] identifier[rootSaturation] operator[=] identifier[saturationState_] operator[SEP] identifier[getContext] operator[SEP] identifier[root] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rootSaturation] operator[SEP] identifier[isInitialized] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[rootSaturation] operator[SEP] identifier[isSaturated] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER_] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[rootSaturation] operator[SEP] operator[SEP]
}
identifier[nextJob] operator[SEP] identifier[setOutput] operator[SEP] identifier[rootSaturation] operator[SEP] operator[SEP] identifier[LOGGER_] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[root] operator[SEP] operator[SEP] identifier[localStatistics] operator[SEP] identifier[jobsProcessedNo] operator[++] operator[SEP] identifier[listener_] operator[SEP] identifier[notifyFinished] operator[SEP] identifier[nextJob] operator[SEP] operator[SEP]
}
}
|
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <B, U extends Collection<? super T>> Observable<U> buffer(ObservableSource<B> boundary, Callable<U> bufferSupplier) {
ObjectHelper.requireNonNull(boundary, "boundary is null");
ObjectHelper.requireNonNull(bufferSupplier, "bufferSupplier is null");
return RxJavaPlugins.onAssembly(new ObservableBufferExactBoundary<T, U, B>(this, boundary, bufferSupplier));
} | class class_name[name] begin[{]
method[buffer, return_type[type[Observable]], modifier[final public], parameter[boundary, bufferSupplier]] begin[{]
call[ObjectHelper.requireNonNull, parameter[member[.boundary], literal["boundary is null"]]]
call[ObjectHelper.requireNonNull, parameter[member[.bufferSupplier], literal["bufferSupplier is null"]]]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=boundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bufferSupplier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=B, sub_type=None))], dimensions=None, name=ObservableBufferExactBoundary, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[final] operator[<] identifier[B] , identifier[U] Keyword[extends] identifier[Collection] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[Observable] operator[<] identifier[U] operator[>] identifier[buffer] operator[SEP] identifier[ObservableSource] operator[<] identifier[B] operator[>] identifier[boundary] , identifier[Callable] operator[<] identifier[U] operator[>] identifier[bufferSupplier] operator[SEP] {
identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[boundary] , literal[String] operator[SEP] operator[SEP] identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[bufferSupplier] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ObservableBufferExactBoundary] operator[<] identifier[T] , identifier[U] , identifier[B] operator[>] operator[SEP] Keyword[this] , identifier[boundary] , identifier[bufferSupplier] operator[SEP] operator[SEP] operator[SEP]
}
|
@CanIgnoreReturnValue
public static SslContextBuilder configure(SslContextBuilder builder, Provider jdkProvider) {
ApplicationProtocolConfig apc;
if (SUN_PROVIDER_NAME.equals(jdkProvider.getName())) {
// Jetty ALPN/NPN only supports one of NPN or ALPN
if (JettyTlsUtil.isJettyAlpnConfigured()) {
apc = ALPN;
} else if (JettyTlsUtil.isJettyNpnConfigured()) {
apc = NPN;
} else if (JettyTlsUtil.isJava9AlpnAvailable()) {
apc = ALPN;
} else {
throw new IllegalArgumentException(
SUN_PROVIDER_NAME + " selected, but Jetty NPN/ALPN unavailable");
}
} else if (isConscrypt(jdkProvider)) {
apc = ALPN;
} else {
throw new IllegalArgumentException("Unknown provider; can't configure: " + jdkProvider);
}
return builder
.sslProvider(SslProvider.JDK)
.ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE)
.applicationProtocolConfig(apc)
.sslContextProvider(jdkProvider);
} | class class_name[name] begin[{]
method[configure, return_type[type[SslContextBuilder]], modifier[public static], parameter[builder, jdkProvider]] begin[{]
local_variable[type[ApplicationProtocolConfig], apc]
if[call[SUN_PROVIDER_NAME.equals, parameter[call[jdkProvider.getName, parameter[]]]]] begin[{]
if[call[JettyTlsUtil.isJettyAlpnConfigured, parameter[]]] begin[{]
assign[member[.apc], member[.ALPN]]
else begin[{]
if[call[JettyTlsUtil.isJettyNpnConfigured, parameter[]]] begin[{]
assign[member[.apc], member[.NPN]]
else begin[{]
if[call[JettyTlsUtil.isJava9AlpnAvailable, parameter[]]] begin[{]
assign[member[.apc], member[.ALPN]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=SUN_PROVIDER_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" selected, but Jetty NPN/ALPN unavailable"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
else begin[{]
if[call[.isConscrypt, parameter[member[.jdkProvider]]]] begin[{]
assign[member[.apc], member[.ALPN]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown provider; can't configure: "), operandr=MemberReference(member=jdkProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
end[}]
return[call[builder.sslProvider, parameter[member[SslProvider.JDK]]]]
end[}]
END[}] | annotation[@] identifier[CanIgnoreReturnValue] Keyword[public] Keyword[static] identifier[SslContextBuilder] identifier[configure] operator[SEP] identifier[SslContextBuilder] identifier[builder] , identifier[Provider] identifier[jdkProvider] operator[SEP] {
identifier[ApplicationProtocolConfig] identifier[apc] operator[SEP] Keyword[if] operator[SEP] identifier[SUN_PROVIDER_NAME] operator[SEP] identifier[equals] operator[SEP] identifier[jdkProvider] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[JettyTlsUtil] operator[SEP] identifier[isJettyAlpnConfigured] operator[SEP] operator[SEP] operator[SEP] {
identifier[apc] operator[=] identifier[ALPN] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[JettyTlsUtil] operator[SEP] identifier[isJettyNpnConfigured] operator[SEP] operator[SEP] operator[SEP] {
identifier[apc] operator[=] identifier[NPN] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[JettyTlsUtil] operator[SEP] identifier[isJava9AlpnAvailable] operator[SEP] operator[SEP] operator[SEP] {
identifier[apc] operator[=] identifier[ALPN] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[SUN_PROVIDER_NAME] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[isConscrypt] operator[SEP] identifier[jdkProvider] operator[SEP] operator[SEP] {
identifier[apc] operator[=] identifier[ALPN] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jdkProvider] operator[SEP] operator[SEP]
}
Keyword[return] identifier[builder] operator[SEP] identifier[sslProvider] operator[SEP] identifier[SslProvider] operator[SEP] identifier[JDK] operator[SEP] operator[SEP] identifier[ciphers] operator[SEP] identifier[Http2SecurityUtil] operator[SEP] identifier[CIPHERS] , identifier[SupportedCipherSuiteFilter] operator[SEP] identifier[INSTANCE] operator[SEP] operator[SEP] identifier[applicationProtocolConfig] operator[SEP] identifier[apc] operator[SEP] operator[SEP] identifier[sslContextProvider] operator[SEP] identifier[jdkProvider] operator[SEP] operator[SEP]
}
|
public boolean addBalancer(String hostName, int sipPort, int httpPort, int index, int rmiPort) {
return this.addBalancer(fetchHostAddress(hostName, index)
.getHostAddress(), sipPort, httpPort, rmiPort);
} | class class_name[name] begin[{]
method[addBalancer, return_type[type[boolean]], modifier[public], parameter[hostName, sipPort, httpPort, index, rmiPort]] begin[{]
return[THIS[call[None.addBalancer, parameter[call[.fetchHostAddress, parameter[member[.hostName], member[.index]]], member[.sipPort], member[.httpPort], member[.rmiPort]]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[addBalancer] operator[SEP] identifier[String] identifier[hostName] , Keyword[int] identifier[sipPort] , Keyword[int] identifier[httpPort] , Keyword[int] identifier[index] , Keyword[int] identifier[rmiPort] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[addBalancer] operator[SEP] identifier[fetchHostAddress] operator[SEP] identifier[hostName] , identifier[index] operator[SEP] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] , identifier[sipPort] , identifier[httpPort] , identifier[rmiPort] operator[SEP] operator[SEP]
}
|
public Observable<CertificateOperation> getCertificateOperationAsync(String vaultBaseUrl, String certificateName) {
return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificateOperation>, CertificateOperation>() {
@Override
public CertificateOperation call(ServiceResponse<CertificateOperation> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[getCertificateOperationAsync, return_type[type[Observable]], modifier[public], parameter[vaultBaseUrl, certificateName]] begin[{]
return[call[.getCertificateOperationWithServiceResponseAsync, parameter[member[.vaultBaseUrl], member[.certificateName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[CertificateOperation] operator[>] identifier[getCertificateOperationAsync] operator[SEP] identifier[String] identifier[vaultBaseUrl] , identifier[String] identifier[certificateName] operator[SEP] {
Keyword[return] identifier[getCertificateOperationWithServiceResponseAsync] operator[SEP] identifier[vaultBaseUrl] , identifier[certificateName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[CertificateOperation] operator[>] , identifier[CertificateOperation] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[CertificateOperation] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[CertificateOperation] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static boolean deAromatize(IRing ring) {
boolean allaromatic = true;
for (int i = 0; i < ring.getBondCount(); i++) {
if (!ring.getBond(i).getFlag(CDKConstants.ISAROMATIC)) allaromatic = false;
}
if (!allaromatic) return false;
for (int i = 0; i < ring.getBondCount(); i++) {
if (ring.getBond(i).getFlag(CDKConstants.ISAROMATIC)) ring.getBond(i).setOrder(IBond.Order.SINGLE);
}
boolean result = false;
IMolecularFormula formula = MolecularFormulaManipulator.getMolecularFormula(ring);
// Map elementCounts = new MFAnalyser(ring).getFormulaHashtable();
if (ring.getRingSize() == 6) {
if (MolecularFormulaManipulator.getElementCount(formula, new Element("C")) == 6) {
result = DeAromatizationTool.deAromatizeBenzene(ring);
} else if (MolecularFormulaManipulator.getElementCount(formula, new Element("C")) == 5
&& MolecularFormulaManipulator.getElementCount(formula, new Element("N")) == 1) {
result = DeAromatizationTool.deAromatizePyridine(ring);
}
}
if (ring.getRingSize() == 5) {
if (MolecularFormulaManipulator.getElementCount(formula, new Element("C")) == 4
&& MolecularFormulaManipulator.getElementCount(formula, new Element("N")) == 1) {
result = deAromatizePyrolle(ring);
}
}
return result;
} | class class_name[name] begin[{]
method[deAromatize, return_type[type[boolean]], modifier[public static], parameter[ring]] begin[{]
local_variable[type[boolean], allaromatic]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBond, postfix_operators=[], prefix_operators=['!'], qualifier=ring, selectors=[MethodInvocation(arguments=[MemberReference(member=ISAROMATIC, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[])], member=getFlag, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=allaromatic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getBondCount, postfix_operators=[], prefix_operators=[], qualifier=ring, 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)
if[member[.allaromatic]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBond, postfix_operators=[], prefix_operators=[], qualifier=ring, selectors=[MethodInvocation(arguments=[MemberReference(member=ISAROMATIC, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[])], member=getFlag, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBond, postfix_operators=[], prefix_operators=[], qualifier=ring, selectors=[MethodInvocation(arguments=[MemberReference(member=SINGLE, postfix_operators=[], prefix_operators=[], qualifier=IBond.Order, selectors=[])], member=setOrder, 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=getBondCount, postfix_operators=[], prefix_operators=[], qualifier=ring, 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)
local_variable[type[boolean], result]
local_variable[type[IMolecularFormula], formula]
if[binary_operation[call[ring.getRingSize, parameter[]], ==, literal[6]]] begin[{]
if[binary_operation[call[MolecularFormulaManipulator.getElementCount, parameter[member[.formula], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="C")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Element, sub_type=None))]], ==, literal[6]]] begin[{]
assign[member[.result], call[DeAromatizationTool.deAromatizeBenzene, parameter[member[.ring]]]]
else begin[{]
if[binary_operation[binary_operation[call[MolecularFormulaManipulator.getElementCount, parameter[member[.formula], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="C")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Element, sub_type=None))]], ==, literal[5]], &&, binary_operation[call[MolecularFormulaManipulator.getElementCount, parameter[member[.formula], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="N")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Element, sub_type=None))]], ==, literal[1]]]] begin[{]
assign[member[.result], call[DeAromatizationTool.deAromatizePyridine, parameter[member[.ring]]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
if[binary_operation[call[ring.getRingSize, parameter[]], ==, literal[5]]] begin[{]
if[binary_operation[binary_operation[call[MolecularFormulaManipulator.getElementCount, parameter[member[.formula], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="C")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Element, sub_type=None))]], ==, literal[4]], &&, binary_operation[call[MolecularFormulaManipulator.getElementCount, parameter[member[.formula], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="N")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Element, sub_type=None))]], ==, literal[1]]]] begin[{]
assign[member[.result], call[.deAromatizePyrolle, parameter[member[.ring]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[deAromatize] operator[SEP] identifier[IRing] identifier[ring] operator[SEP] {
Keyword[boolean] identifier[allaromatic] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ring] operator[SEP] identifier[getBondCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[ring] operator[SEP] identifier[getBond] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[ISAROMATIC] operator[SEP] operator[SEP] identifier[allaromatic] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[allaromatic] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ring] operator[SEP] identifier[getBondCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[ring] operator[SEP] identifier[getBond] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[ISAROMATIC] operator[SEP] operator[SEP] identifier[ring] operator[SEP] identifier[getBond] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[setOrder] operator[SEP] identifier[IBond] operator[SEP] identifier[Order] operator[SEP] identifier[SINGLE] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] identifier[IMolecularFormula] identifier[formula] operator[=] identifier[MolecularFormulaManipulator] operator[SEP] identifier[getMolecularFormula] operator[SEP] identifier[ring] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ring] operator[SEP] identifier[getRingSize] operator[SEP] operator[SEP] operator[==] Other[6] operator[SEP] {
Keyword[if] operator[SEP] identifier[MolecularFormulaManipulator] operator[SEP] identifier[getElementCount] operator[SEP] identifier[formula] , Keyword[new] identifier[Element] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[6] operator[SEP] {
identifier[result] operator[=] identifier[DeAromatizationTool] operator[SEP] identifier[deAromatizeBenzene] operator[SEP] identifier[ring] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[MolecularFormulaManipulator] operator[SEP] identifier[getElementCount] operator[SEP] identifier[formula] , Keyword[new] identifier[Element] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[5] operator[&&] identifier[MolecularFormulaManipulator] operator[SEP] identifier[getElementCount] operator[SEP] identifier[formula] , Keyword[new] identifier[Element] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[result] operator[=] identifier[DeAromatizationTool] operator[SEP] identifier[deAromatizePyridine] operator[SEP] identifier[ring] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[ring] operator[SEP] identifier[getRingSize] operator[SEP] operator[SEP] operator[==] Other[5] operator[SEP] {
Keyword[if] operator[SEP] identifier[MolecularFormulaManipulator] operator[SEP] identifier[getElementCount] operator[SEP] identifier[formula] , Keyword[new] identifier[Element] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[4] operator[&&] identifier[MolecularFormulaManipulator] operator[SEP] identifier[getElementCount] operator[SEP] identifier[formula] , Keyword[new] identifier[Element] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[result] operator[=] identifier[deAromatizePyrolle] operator[SEP] identifier[ring] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static final String replace(String string, String oldString, String newString) {
if (string == null) {
return null;
}
// If the newString is null or zero length, just return the string since there's nothing
// to replace.
if (newString == null) {
return string;
}
int i = 0;
// Make sure that oldString appears at least once before doing any processing.
if ((i = string.indexOf(oldString, i)) >= 0) {
// Use char []'s, as they are more efficient to deal with.
char[] string2 = string.toCharArray();
char[] newString2 = newString.toCharArray();
int oLength = oldString.length();
StringBuilder buf = new StringBuilder(string2.length);
buf.append(string2, 0, i).append(newString2);
i += oLength;
int j = i;
// Replace all remaining instances of oldString with newString.
while ((i = string.indexOf(oldString, i)) > 0) {
buf.append(string2, j, i - j).append(newString2);
i += oLength;
j = i;
}
buf.append(string2, j, string2.length - j);
return buf.toString();
}
return string;
} | class class_name[name] begin[{]
method[replace, return_type[type[String]], modifier[final public static], parameter[string, oldString, newString]] begin[{]
if[binary_operation[member[.string], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.newString], ==, literal[null]]] begin[{]
return[member[.string]]
else begin[{]
None
end[}]
local_variable[type[int], i]
if[binary_operation[assign[member[.i], call[string.indexOf, parameter[member[.oldString], member[.i]]]], >=, literal[0]]] begin[{]
local_variable[type[char], string2]
local_variable[type[char], newString2]
local_variable[type[int], oLength]
local_variable[type[StringBuilder], buf]
call[buf.append, parameter[member[.string2], literal[0], member[.i]]]
assign[member[.i], member[.oLength]]
local_variable[type[int], j]
while[binary_operation[assign[member[.i], call[string.indexOf, parameter[member[.oldString], member[.i]]]], >, literal[0]]] begin[{]
call[buf.append, parameter[member[.string2], member[.j], binary_operation[member[.i], -, member[.j]]]]
assign[member[.i], member[.oLength]]
assign[member[.j], member[.i]]
end[}]
call[buf.append, parameter[member[.string2], member[.j], binary_operation[member[string2.length], -, member[.j]]]]
return[call[buf.toString, parameter[]]]
else begin[{]
None
end[}]
return[member[.string]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[String] identifier[replace] operator[SEP] identifier[String] identifier[string] , identifier[String] identifier[oldString] , identifier[String] identifier[newString] operator[SEP] {
Keyword[if] operator[SEP] identifier[string] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[newString] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[string] operator[SEP]
}
Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[=] identifier[string] operator[SEP] identifier[indexOf] operator[SEP] identifier[oldString] , identifier[i] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[char] operator[SEP] operator[SEP] identifier[string2] operator[=] identifier[string] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[newString2] operator[=] identifier[newString] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[oLength] operator[=] identifier[oldString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[string2] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[string2] , Other[0] , identifier[i] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[newString2] operator[SEP] operator[SEP] identifier[i] operator[+=] identifier[oLength] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[i] operator[=] identifier[string] operator[SEP] identifier[indexOf] operator[SEP] identifier[oldString] , identifier[i] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[string2] , identifier[j] , identifier[i] operator[-] identifier[j] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[newString2] operator[SEP] operator[SEP] identifier[i] operator[+=] identifier[oLength] operator[SEP] identifier[j] operator[=] identifier[i] operator[SEP]
}
identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[string2] , identifier[j] , identifier[string2] operator[SEP] identifier[length] operator[-] identifier[j] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[string] operator[SEP]
}
|
public static String decode( String url )
{
if ( url == null )
{
return null;
}
StringBuilder decoded = new StringBuilder();
int pos = 0;
while (pos < url.length())
{
char ch = url.charAt(pos);
if (ch == '%')
{
if ( pos + 2 < url.length() )
{
String hexStr = url.substring( pos + 1, pos + 3 );
char hexChar = (char) Integer.parseInt( hexStr, 16 );
decoded.append( hexChar );
pos += 3;
}
else
{
throw new IllegalStateException("'%' escape must be followed by two hex digits");
}
}
else
{
decoded.append( ch );
pos++;
}
}
return decoded.toString();
} | class class_name[name] begin[{]
method[decode, return_type[type[String]], modifier[public static], parameter[url]] begin[{]
if[binary_operation[member[.url], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], decoded]
local_variable[type[int], pos]
while[binary_operation[member[.pos], <, call[url.length, parameter[]]]] begin[{]
local_variable[type[char], ch]
if[binary_operation[member[.ch], ==, literal['%']]] begin[{]
if[binary_operation[binary_operation[member[.pos], +, literal[2]], <, call[url.length, parameter[]]]] begin[{]
local_variable[type[String], hexStr]
local_variable[type[char], hexChar]
call[decoded.append, parameter[member[.hexChar]]]
assign[member[.pos], literal[3]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'%' escape must be followed by two hex digits")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
else begin[{]
call[decoded.append, parameter[member[.ch]]]
member[.pos]
end[}]
end[}]
return[call[decoded.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[decode] operator[SEP] identifier[String] identifier[url] operator[SEP] {
Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[StringBuilder] identifier[decoded] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[pos] operator[<] identifier[url] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
Keyword[char] identifier[ch] operator[=] identifier[url] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[pos] operator[+] Other[2] operator[<] identifier[url] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[hexStr] operator[=] identifier[url] operator[SEP] identifier[substring] operator[SEP] identifier[pos] operator[+] Other[1] , identifier[pos] operator[+] Other[3] operator[SEP] operator[SEP] Keyword[char] identifier[hexChar] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[hexStr] , Other[16] operator[SEP] operator[SEP] identifier[decoded] operator[SEP] identifier[append] operator[SEP] identifier[hexChar] operator[SEP] operator[SEP] identifier[pos] operator[+=] Other[3] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[decoded] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP] identifier[pos] operator[++] operator[SEP]
}
}
Keyword[return] identifier[decoded] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void enableAutoRead(Channel channel) {
if (!channel.config().isAutoRead()) {
channel.config().setAutoRead(true);
channel.read();
}
} | class class_name[name] begin[{]
method[enableAutoRead, return_type[void], modifier[public static], parameter[channel]] begin[{]
if[call[channel.config, parameter[]]] begin[{]
call[channel.config, parameter[]]
call[channel.read, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[enableAutoRead] operator[SEP] identifier[Channel] identifier[channel] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[channel] operator[SEP] identifier[config] operator[SEP] operator[SEP] operator[SEP] identifier[isAutoRead] operator[SEP] operator[SEP] operator[SEP] {
identifier[channel] operator[SEP] identifier[config] operator[SEP] operator[SEP] operator[SEP] identifier[setAutoRead] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = RemoveObjectFromFolder.class)
public JAXBElement<CmisExtensionType> createRemoveObjectFromFolderExtension(
CmisExtensionType value) {
return new JAXBElement<CmisExtensionType>(
_GetPropertiesExtension_QNAME, CmisExtensionType.class,
RemoveObjectFromFolder.class, value);
} | class class_name[name] begin[{]
method[createRemoveObjectFromFolderExtension, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_GetPropertiesExtension_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmisExtensionType, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RemoveObjectFromFolder, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmisExtensionType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[RemoveObjectFromFolder] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[CmisExtensionType] operator[>] identifier[createRemoveObjectFromFolderExtension] operator[SEP] identifier[CmisExtensionType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[CmisExtensionType] operator[>] operator[SEP] identifier[_GetPropertiesExtension_QNAME] , identifier[CmisExtensionType] operator[SEP] Keyword[class] , identifier[RemoveObjectFromFolder] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP]
}
|
static byte[] writePlanBytes(PlanFragment fragment, AbstractPlanNode planGraph) {
// get the plan bytes
PlanNodeList node_list = new PlanNodeList(planGraph, false);
String json = node_list.toJSONString();
// Place serialized version of PlanNodeTree into a PlanFragment
byte[] jsonBytes = json.getBytes(Charsets.UTF_8);
String bin64String = CompressionService.compressAndBase64Encode(jsonBytes);
fragment.setPlannodetree(bin64String);
return jsonBytes;
} | class class_name[name] begin[{]
method[writePlanBytes, return_type[type[byte]], modifier[static], parameter[fragment, planGraph]] begin[{]
local_variable[type[PlanNodeList], node_list]
local_variable[type[String], json]
local_variable[type[byte], jsonBytes]
local_variable[type[String], bin64String]
call[fragment.setPlannodetree, parameter[member[.bin64String]]]
return[member[.jsonBytes]]
end[}]
END[}] | Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[writePlanBytes] operator[SEP] identifier[PlanFragment] identifier[fragment] , identifier[AbstractPlanNode] identifier[planGraph] operator[SEP] {
identifier[PlanNodeList] identifier[node_list] operator[=] Keyword[new] identifier[PlanNodeList] operator[SEP] identifier[planGraph] , literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[json] operator[=] identifier[node_list] operator[SEP] identifier[toJSONString] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[jsonBytes] operator[=] identifier[json] operator[SEP] identifier[getBytes] operator[SEP] identifier[Charsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[String] identifier[bin64String] operator[=] identifier[CompressionService] operator[SEP] identifier[compressAndBase64Encode] operator[SEP] identifier[jsonBytes] operator[SEP] operator[SEP] identifier[fragment] operator[SEP] identifier[setPlannodetree] operator[SEP] identifier[bin64String] operator[SEP] operator[SEP] Keyword[return] identifier[jsonBytes] operator[SEP]
}
|
final long newMoonOnOrAfter(long utcDays) {
Moment m = MoonPhase.NEW_MOON.atOrAfter(this.midnight(utcDays));
return m.toZonalTimestamp(this.getOffset(utcDays)).toDate().getDaysSinceEpochUTC();
} | class class_name[name] begin[{]
method[newMoonOnOrAfter, return_type[type[long]], modifier[final], parameter[utcDays]] begin[{]
local_variable[type[Moment], m]
return[call[m.toZonalTimestamp, parameter[THIS[call[None.getOffset, parameter[member[.utcDays]]]]]]]
end[}]
END[}] | Keyword[final] Keyword[long] identifier[newMoonOnOrAfter] operator[SEP] Keyword[long] identifier[utcDays] operator[SEP] {
identifier[Moment] identifier[m] operator[=] identifier[MoonPhase] operator[SEP] identifier[NEW_MOON] operator[SEP] identifier[atOrAfter] operator[SEP] Keyword[this] operator[SEP] identifier[midnight] operator[SEP] identifier[utcDays] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[m] operator[SEP] identifier[toZonalTimestamp] operator[SEP] Keyword[this] operator[SEP] identifier[getOffset] operator[SEP] identifier[utcDays] operator[SEP] operator[SEP] operator[SEP] identifier[toDate] operator[SEP] operator[SEP] operator[SEP] identifier[getDaysSinceEpochUTC] operator[SEP] operator[SEP] operator[SEP]
}
|
static boolean hasHits(@Nullable JSONObject jsonObject) {
if (jsonObject == null) {
return false;
}
JSONArray resultHits = jsonObject.optJSONArray("hits");
if (resultHits == null) {
return false;
}
for (int i = 0; i < resultHits.length(); ++i) {
JSONObject hit = resultHits.optJSONObject(i);
if (hit != null) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[hasHits, return_type[type[boolean]], modifier[static], parameter[jsonObject]] begin[{]
if[binary_operation[member[.jsonObject], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[JSONArray], resultHits]
if[binary_operation[member[.resultHits], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=optJSONObject, postfix_operators=[], prefix_operators=[], qualifier=resultHits, selectors=[], type_arguments=None), name=hit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=hit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=resultHits, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[static] Keyword[boolean] identifier[hasHits] operator[SEP] annotation[@] identifier[Nullable] identifier[JSONObject] identifier[jsonObject] operator[SEP] {
Keyword[if] operator[SEP] identifier[jsonObject] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[JSONArray] identifier[resultHits] operator[=] identifier[jsonObject] operator[SEP] identifier[optJSONArray] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resultHits] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[resultHits] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[JSONObject] identifier[hit] operator[=] identifier[resultHits] operator[SEP] identifier[optJSONObject] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hit] operator[!=] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public BindingFactory getBindingFactory() {
if (bindingFactory == null) {
bindingFactory = getApplicationConfig().bindingFactoryProvider().getBindingFactory(formModel);
}
return bindingFactory;
} | class class_name[name] begin[{]
method[getBindingFactory, return_type[type[BindingFactory]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.bindingFactory], ==, literal[null]]] begin[{]
assign[member[.bindingFactory], call[.getApplicationConfig, parameter[]]]
else begin[{]
None
end[}]
return[member[.bindingFactory]]
end[}]
END[}] | Keyword[public] identifier[BindingFactory] identifier[getBindingFactory] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[bindingFactory] operator[==] Other[null] operator[SEP] {
identifier[bindingFactory] operator[=] identifier[getApplicationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[bindingFactoryProvider] operator[SEP] operator[SEP] operator[SEP] identifier[getBindingFactory] operator[SEP] identifier[formModel] operator[SEP] operator[SEP]
}
Keyword[return] identifier[bindingFactory] operator[SEP]
}
|
public static BundleAdjustment<SceneStructureMetric> bundleDenseMetric(boolean robust,
@Nullable ConfigBundleAdjustment config ) {
if( config == null )
config = new ConfigBundleAdjustment();
UnconstrainedLeastSquaresSchur<DMatrixRMaj> minimizer;
if( config.configOptimizer instanceof ConfigTrustRegion )
minimizer = FactoryOptimization.doglegSchur(robust,(ConfigTrustRegion)config.configOptimizer);
else
minimizer = FactoryOptimization.levenbergMarquardtSchur(robust,(ConfigLevenbergMarquardt)config.configOptimizer);
return new BundleAdjustmentSchur_DDRM<>(minimizer,
new BundleAdjustmentMetricResidualFunction(),
new BundleAdjustmentMetricSchurJacobian_DDRM(),
new CodecSceneStructureMetric());
} | class class_name[name] begin[{]
method[bundleDenseMetric, return_type[type[BundleAdjustment]], modifier[public static], parameter[robust, config]] begin[{]
if[binary_operation[member[.config], ==, literal[null]]] begin[{]
assign[member[.config], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigBundleAdjustment, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[UnconstrainedLeastSquaresSchur], minimizer]
if[binary_operation[member[config.configOptimizer], instanceof, type[ConfigTrustRegion]]] begin[{]
assign[member[.minimizer], call[FactoryOptimization.doglegSchur, parameter[member[.robust], Cast(expression=MemberReference(member=configOptimizer, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ConfigTrustRegion, sub_type=None))]]]
else begin[{]
assign[member[.minimizer], call[FactoryOptimization.levenbergMarquardtSchur, parameter[member[.robust], Cast(expression=MemberReference(member=configOptimizer, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ConfigLevenbergMarquardt, sub_type=None))]]]
end[}]
return[ClassCreator(arguments=[MemberReference(member=minimizer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BundleAdjustmentMetricResidualFunction, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BundleAdjustmentMetricSchurJacobian_DDRM, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CodecSceneStructureMetric, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=BundleAdjustmentSchur_DDRM, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BundleAdjustment] operator[<] identifier[SceneStructureMetric] operator[>] identifier[bundleDenseMetric] operator[SEP] Keyword[boolean] identifier[robust] , annotation[@] identifier[Nullable] identifier[ConfigBundleAdjustment] identifier[config] operator[SEP] {
Keyword[if] operator[SEP] identifier[config] operator[==] Other[null] operator[SEP] identifier[config] operator[=] Keyword[new] identifier[ConfigBundleAdjustment] operator[SEP] operator[SEP] operator[SEP] identifier[UnconstrainedLeastSquaresSchur] operator[<] identifier[DMatrixRMaj] operator[>] identifier[minimizer] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[configOptimizer] Keyword[instanceof] identifier[ConfigTrustRegion] operator[SEP] identifier[minimizer] operator[=] identifier[FactoryOptimization] operator[SEP] identifier[doglegSchur] operator[SEP] identifier[robust] , operator[SEP] identifier[ConfigTrustRegion] operator[SEP] identifier[config] operator[SEP] identifier[configOptimizer] operator[SEP] operator[SEP] Keyword[else] identifier[minimizer] operator[=] identifier[FactoryOptimization] operator[SEP] identifier[levenbergMarquardtSchur] operator[SEP] identifier[robust] , operator[SEP] identifier[ConfigLevenbergMarquardt] operator[SEP] identifier[config] operator[SEP] identifier[configOptimizer] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BundleAdjustmentSchur_DDRM] operator[<] operator[>] operator[SEP] identifier[minimizer] , Keyword[new] identifier[BundleAdjustmentMetricResidualFunction] operator[SEP] operator[SEP] , Keyword[new] identifier[BundleAdjustmentMetricSchurJacobian_DDRM] operator[SEP] operator[SEP] , Keyword[new] identifier[CodecSceneStructureMetric] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
final Token currentToken() throws IllegalStateException, NoSuchElementException {
if (currentToken == null) {
if (completed) {
throw new NoSuchElementException(CommonI18n.noMoreContent.text());
}
throw new IllegalStateException(CommonI18n.startMethodMustBeCalledBeforeConsumingOrMatching.text());
}
assert currentToken != null;
return currentToken;
} | class class_name[name] begin[{]
method[currentToken, return_type[type[Token]], modifier[final], parameter[]] begin[{]
if[binary_operation[member[.currentToken], ==, literal[null]]] begin[{]
if[member[.completed]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=text, postfix_operators=[], prefix_operators=[], qualifier=CommonI18n.noMoreContent, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchElementException, sub_type=None)), label=None)
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=text, postfix_operators=[], prefix_operators=[], qualifier=CommonI18n.startMethodMustBeCalledBeforeConsumingOrMatching, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=currentToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
return[member[.currentToken]]
end[}]
END[}] | Keyword[final] identifier[Token] identifier[currentToken] operator[SEP] operator[SEP] Keyword[throws] identifier[IllegalStateException] , identifier[NoSuchElementException] {
Keyword[if] operator[SEP] identifier[currentToken] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[completed] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NoSuchElementException] operator[SEP] identifier[CommonI18n] operator[SEP] identifier[noMoreContent] operator[SEP] identifier[text] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[CommonI18n] operator[SEP] identifier[startMethodMustBeCalledBeforeConsumingOrMatching] operator[SEP] identifier[text] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[assert] identifier[currentToken] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[currentToken] operator[SEP]
}
|
private Method replaceDeleteExampleMethod(IntrospectedTable introspectedTable, Method method, Interface interfaze, String methodName) {
Method withVersionMethod = new Method(method);
// 替换方法名
withVersionMethod.setName(methodName);
FormatTools.replaceGeneralMethodComment(commentGenerator, withVersionMethod, introspectedTable);
Parameter versionParam = new Parameter(this.versionColumn.getFullyQualifiedJavaType(), "version", "@Param(\"version\")");
Parameter exampleParam = new Parameter(new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example", "@Param(\"example\")");
withVersionMethod.getParameters().clear();
withVersionMethod.addParameter(versionParam);
withVersionMethod.addParameter(exampleParam);
return withVersionMethod;
} | class class_name[name] begin[{]
method[replaceDeleteExampleMethod, return_type[type[Method]], modifier[private], parameter[introspectedTable, method, interfaze, methodName]] begin[{]
local_variable[type[Method], withVersionMethod]
call[withVersionMethod.setName, parameter[member[.methodName]]]
call[FormatTools.replaceGeneralMethodComment, parameter[member[.commentGenerator], member[.withVersionMethod], member[.introspectedTable]]]
local_variable[type[Parameter], versionParam]
local_variable[type[Parameter], exampleParam]
call[withVersionMethod.getParameters, parameter[]]
call[withVersionMethod.addParameter, parameter[member[.versionParam]]]
call[withVersionMethod.addParameter, parameter[member[.exampleParam]]]
return[member[.withVersionMethod]]
end[}]
END[}] | Keyword[private] identifier[Method] identifier[replaceDeleteExampleMethod] operator[SEP] identifier[IntrospectedTable] identifier[introspectedTable] , identifier[Method] identifier[method] , identifier[Interface] identifier[interfaze] , identifier[String] identifier[methodName] operator[SEP] {
identifier[Method] identifier[withVersionMethod] operator[=] Keyword[new] identifier[Method] operator[SEP] identifier[method] operator[SEP] operator[SEP] identifier[withVersionMethod] operator[SEP] identifier[setName] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] identifier[FormatTools] operator[SEP] identifier[replaceGeneralMethodComment] operator[SEP] identifier[commentGenerator] , identifier[withVersionMethod] , identifier[introspectedTable] operator[SEP] operator[SEP] identifier[Parameter] identifier[versionParam] operator[=] Keyword[new] identifier[Parameter] operator[SEP] Keyword[this] operator[SEP] identifier[versionColumn] operator[SEP] identifier[getFullyQualifiedJavaType] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Parameter] identifier[exampleParam] operator[=] Keyword[new] identifier[Parameter] operator[SEP] Keyword[new] identifier[FullyQualifiedJavaType] operator[SEP] identifier[introspectedTable] operator[SEP] identifier[getExampleType] operator[SEP] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[withVersionMethod] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[withVersionMethod] operator[SEP] identifier[addParameter] operator[SEP] identifier[versionParam] operator[SEP] operator[SEP] identifier[withVersionMethod] operator[SEP] identifier[addParameter] operator[SEP] identifier[exampleParam] operator[SEP] operator[SEP] Keyword[return] identifier[withVersionMethod] operator[SEP]
}
|
public void onChange(final StreamState state, final Object... changed) {
Notifier notifier = null;
IStreamAwareScopeHandler handler = getStreamAwareHandler();
switch (state) {
case SEEK:
//notifies subscribers on seek
if (handler != null) {
notifier = new Notifier(this, handler) {
public void execute(ISchedulingService service) {
//make sure those notified have the correct connection
Red5.setConnectionLocal(conn);
//get item being played
IPlayItem item = (IPlayItem) changed[0];
//seek position
int position = (Integer) changed[1];
try {
handler.streamPlayItemSeek(stream, item, position);
} catch (Throwable t) {
log.error("error notify streamPlayItemSeek", t);
}
// clear thread local reference
Red5.setConnectionLocal(null);
}
};
}
break;
case PAUSED:
//set the paused state
this.setState(StreamState.PAUSED);
//notifies subscribers on pause
if (handler != null) {
notifier = new Notifier(this, handler) {
public void execute(ISchedulingService service) {
//make sure those notified have the correct connection
Red5.setConnectionLocal(conn);
//get item being played
IPlayItem item = (IPlayItem) changed[0];
//playback position
int position = (Integer) changed[1];
try {
handler.streamPlayItemPause(stream, item, position);
} catch (Throwable t) {
log.error("error notify streamPlayItemPause", t);
}
// clear thread local reference
Red5.setConnectionLocal(null);
}
};
}
break;
case RESUMED:
//resume playing
this.setState(StreamState.PLAYING);
//notifies subscribers on resume
if (handler != null) {
notifier = new Notifier(this, handler) {
public void execute(ISchedulingService service) {
//make sure those notified have the correct connection
Red5.setConnectionLocal(conn);
//get item being played
IPlayItem item = (IPlayItem) changed[0];
//playback position
int position = (Integer) changed[1];
try {
handler.streamPlayItemResume(stream, item, position);
} catch (Throwable t) {
log.error("error notify streamPlayItemResume", t);
}
// clear thread local reference
Red5.setConnectionLocal(null);
}
};
}
break;
case PLAYING:
//notifies subscribers on play
if (handler != null) {
notifier = new Notifier(this, handler) {
public void execute(ISchedulingService service) {
//make sure those notified have the correct connection
Red5.setConnectionLocal(conn);
//get item being played
IPlayItem item = (IPlayItem) changed[0];
//is it a live broadcast
boolean isLive = (Boolean) changed[1];
try {
handler.streamPlayItemPlay(stream, item, isLive);
} catch (Throwable t) {
log.error("error notify streamPlayItemPlay", t);
}
// clear thread local reference
Red5.setConnectionLocal(null);
}
};
}
break;
case CLOSED:
//notifies subscribers on close
if (handler != null) {
notifier = new Notifier(this, handler) {
public void execute(ISchedulingService service) {
//make sure those notified have the correct connection
Red5.setConnectionLocal(conn);
try {
handler.streamSubscriberClose(stream);
} catch (Throwable t) {
log.error("error notify streamSubscriberClose", t);
}
// clear thread local reference
Red5.setConnectionLocal(null);
}
};
}
break;
case STARTED:
//notifies subscribers on start
if (handler != null) {
notifier = new Notifier(this, handler) {
public void execute(ISchedulingService service) {
//make sure those notified have the correct connection
Red5.setConnectionLocal(conn);
try {
handler.streamSubscriberStart(stream);
} catch (Throwable t) {
log.error("error notify streamSubscriberStart", t);
}
// clear thread local reference
Red5.setConnectionLocal(null);
}
};
}
break;
case STOPPED:
//set the stopped state
this.setState(StreamState.STOPPED);
//notifies subscribers on stop
if (handler != null) {
notifier = new Notifier(this, handler) {
public void execute(ISchedulingService service) {
//make sure those notified have the correct connection
Red5.setConnectionLocal(conn);
//get the item that was stopped
IPlayItem item = (IPlayItem) changed[0];
try {
handler.streamPlayItemStop(stream, item);
} catch (Throwable t) {
log.error("error notify streamPlaylistItemStop", t);
}
// clear thread local reference
Red5.setConnectionLocal(null);
}
};
}
break;
case END:
//notified by the play engine when the current item reaches the end
break;
default:
//there is no "default" handling
}
if (notifier != null) {
notifier.setConnection(Red5.getConnectionLocal());
scheduleOnceJob(notifier);
}
} | class class_name[name] begin[{]
method[onChange, return_type[void], modifier[public], parameter[state, changed]] begin[{]
local_variable[type[Notifier], notifier]
local_variable[type[IStreamAwareScopeHandler], handler]
SwitchStatement(cases=[SwitchStatementCase(case=['SEEK'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, 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=notifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=position)], modifiers=set(), type=BasicType(dimensions=[], name=int)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamPlayItemSeek, 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="error notify streamPlayItemSeek"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=ISchedulingService, 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=Notifier, sub_type=None))), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PAUSED'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=PAUSED, postfix_operators=[], prefix_operators=[], qualifier=StreamState, selectors=[])], member=setState, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, 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=notifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=position)], modifiers=set(), type=BasicType(dimensions=[], name=int)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamPlayItemPause, 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="error notify streamPlayItemPause"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=ISchedulingService, 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=Notifier, sub_type=None))), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['RESUMED'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=PLAYING, postfix_operators=[], prefix_operators=[], qualifier=StreamState, selectors=[])], member=setState, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, 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=notifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=position)], modifiers=set(), type=BasicType(dimensions=[], name=int)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamPlayItemResume, 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="error notify streamPlayItemResume"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=ISchedulingService, 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=Notifier, sub_type=None))), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PLAYING'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, 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=notifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)), name=isLive)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isLive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamPlayItemPlay, 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="error notify streamPlayItemPlay"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=ISchedulingService, 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=Notifier, sub_type=None))), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CLOSED'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, 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=notifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamSubscriberClose, 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="error notify streamSubscriberClose"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=ISchedulingService, 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=Notifier, sub_type=None))), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STARTED'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, 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=notifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamSubscriberStart, 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="error notify streamSubscriberStart"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=ISchedulingService, 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=Notifier, sub_type=None))), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STOPPED'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=STOPPED, postfix_operators=[], prefix_operators=[], qualifier=StreamState, selectors=[])], member=setState, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=handler, 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=notifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPlayItem, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamPlayItemStop, 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="error notify streamPlaylistItemStop"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setConnectionLocal, postfix_operators=[], prefix_operators=[], qualifier=Red5, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=ISchedulingService, 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=Notifier, sub_type=None))), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['END'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[])], expression=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
if[binary_operation[member[.notifier], !=, literal[null]]] begin[{]
call[notifier.setConnection, parameter[call[Red5.getConnectionLocal, parameter[]]]]
call[.scheduleOnceJob, parameter[member[.notifier]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[onChange] operator[SEP] Keyword[final] identifier[StreamState] identifier[state] , Keyword[final] identifier[Object] operator[...] identifier[changed] operator[SEP] {
identifier[Notifier] identifier[notifier] operator[=] Other[null] operator[SEP] identifier[IStreamAwareScopeHandler] identifier[handler] operator[=] identifier[getStreamAwareHandler] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[state] operator[SEP] {
Keyword[case] identifier[SEEK] operator[:] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[=] Keyword[new] identifier[Notifier] operator[SEP] Keyword[this] , identifier[handler] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[ISchedulingService] identifier[service] operator[SEP] {
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[IPlayItem] identifier[item] operator[=] operator[SEP] identifier[IPlayItem] operator[SEP] identifier[changed] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[position] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[changed] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[try] {
identifier[handler] operator[SEP] identifier[streamPlayItemSeek] operator[SEP] identifier[stream] , identifier[item] , identifier[position] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP]
}
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[PAUSED] operator[:] Keyword[this] operator[SEP] identifier[setState] operator[SEP] identifier[StreamState] operator[SEP] identifier[PAUSED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[=] Keyword[new] identifier[Notifier] operator[SEP] Keyword[this] , identifier[handler] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[ISchedulingService] identifier[service] operator[SEP] {
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[IPlayItem] identifier[item] operator[=] operator[SEP] identifier[IPlayItem] operator[SEP] identifier[changed] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[position] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[changed] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[try] {
identifier[handler] operator[SEP] identifier[streamPlayItemPause] operator[SEP] identifier[stream] , identifier[item] , identifier[position] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP]
}
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[RESUMED] operator[:] Keyword[this] operator[SEP] identifier[setState] operator[SEP] identifier[StreamState] operator[SEP] identifier[PLAYING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[=] Keyword[new] identifier[Notifier] operator[SEP] Keyword[this] , identifier[handler] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[ISchedulingService] identifier[service] operator[SEP] {
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[IPlayItem] identifier[item] operator[=] operator[SEP] identifier[IPlayItem] operator[SEP] identifier[changed] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[position] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[changed] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[try] {
identifier[handler] operator[SEP] identifier[streamPlayItemResume] operator[SEP] identifier[stream] , identifier[item] , identifier[position] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP]
}
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[PLAYING] operator[:] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[=] Keyword[new] identifier[Notifier] operator[SEP] Keyword[this] , identifier[handler] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[ISchedulingService] identifier[service] operator[SEP] {
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[IPlayItem] identifier[item] operator[=] operator[SEP] identifier[IPlayItem] operator[SEP] identifier[changed] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[boolean] identifier[isLive] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[changed] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[try] {
identifier[handler] operator[SEP] identifier[streamPlayItemPlay] operator[SEP] identifier[stream] , identifier[item] , identifier[isLive] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP]
}
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[CLOSED] operator[:] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[=] Keyword[new] identifier[Notifier] operator[SEP] Keyword[this] , identifier[handler] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[ISchedulingService] identifier[service] operator[SEP] {
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] identifier[conn] operator[SEP] operator[SEP] Keyword[try] {
identifier[handler] operator[SEP] identifier[streamSubscriberClose] operator[SEP] identifier[stream] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP]
}
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[STARTED] operator[:] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[=] Keyword[new] identifier[Notifier] operator[SEP] Keyword[this] , identifier[handler] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[ISchedulingService] identifier[service] operator[SEP] {
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] identifier[conn] operator[SEP] operator[SEP] Keyword[try] {
identifier[handler] operator[SEP] identifier[streamSubscriberStart] operator[SEP] identifier[stream] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP]
}
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[STOPPED] operator[:] Keyword[this] operator[SEP] identifier[setState] operator[SEP] identifier[StreamState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[=] Keyword[new] identifier[Notifier] operator[SEP] Keyword[this] , identifier[handler] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[ISchedulingService] identifier[service] operator[SEP] {
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[IPlayItem] identifier[item] operator[=] operator[SEP] identifier[IPlayItem] operator[SEP] identifier[changed] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[try] {
identifier[handler] operator[SEP] identifier[streamPlayItemStop] operator[SEP] identifier[stream] , identifier[item] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP]
}
identifier[Red5] operator[SEP] identifier[setConnectionLocal] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[END] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:]
}
Keyword[if] operator[SEP] identifier[notifier] operator[!=] Other[null] operator[SEP] {
identifier[notifier] operator[SEP] identifier[setConnection] operator[SEP] identifier[Red5] operator[SEP] identifier[getConnectionLocal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[scheduleOnceJob] operator[SEP] identifier[notifier] operator[SEP] operator[SEP]
}
}
|
public static OptionDialog showOptionDialog (Stage stage, String title, String text, OptionDialogType type, OptionDialogListener listener) {
OptionDialog dialog = new OptionDialog(title, text, type, listener);
stage.addActor(dialog.fadeIn());
return dialog;
} | class class_name[name] begin[{]
method[showOptionDialog, return_type[type[OptionDialog]], modifier[public static], parameter[stage, title, text, type, listener]] begin[{]
local_variable[type[OptionDialog], dialog]
call[stage.addActor, parameter[call[dialog.fadeIn, parameter[]]]]
return[member[.dialog]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[OptionDialog] identifier[showOptionDialog] operator[SEP] identifier[Stage] identifier[stage] , identifier[String] identifier[title] , identifier[String] identifier[text] , identifier[OptionDialogType] identifier[type] , identifier[OptionDialogListener] identifier[listener] operator[SEP] {
identifier[OptionDialog] identifier[dialog] operator[=] Keyword[new] identifier[OptionDialog] operator[SEP] identifier[title] , identifier[text] , identifier[type] , identifier[listener] operator[SEP] operator[SEP] identifier[stage] operator[SEP] identifier[addActor] operator[SEP] identifier[dialog] operator[SEP] identifier[fadeIn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dialog] operator[SEP]
}
|
public static <ElementType> Ordering<Multiset.Entry<ElementType>> byElementOrdering(
Comparator<? super ElementType> comparator) {
return Ordering.from(comparator).onResultOf(MultisetUtils.<ElementType>elementOnly());
} | class class_name[name] begin[{]
method[byElementOrdering, return_type[type[Ordering]], modifier[public static], parameter[comparator]] begin[{]
return[call[Ordering.from, parameter[member[.comparator]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[ElementType] operator[>] identifier[Ordering] operator[<] identifier[Multiset] operator[SEP] identifier[Entry] operator[<] identifier[ElementType] operator[>] operator[>] identifier[byElementOrdering] operator[SEP] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[ElementType] operator[>] identifier[comparator] operator[SEP] {
Keyword[return] identifier[Ordering] operator[SEP] identifier[from] operator[SEP] identifier[comparator] operator[SEP] operator[SEP] identifier[onResultOf] operator[SEP] identifier[MultisetUtils] operator[SEP] operator[<] identifier[ElementType] operator[>] identifier[elementOnly] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void fireSendAllowedStateChangeEvent(boolean newState)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "fireSendAllowedStateChangeEvent", Boolean.valueOf(newState));
MessageProcessor messageProcessor = getMessageProcessor();
if (messageProcessor.getMessagingEngine().isEventNotificationEnabled())
{
// Build the message for the Notification
String message =
nls.getFormattedMessage("NOTIFY_SEND_ALLOWED_STATE_CHANGE_CWSIP0551",
new Object[] { getName(),
getUuid().toString(),
Boolean.valueOf(newState) },
null);
// Build the properties for the Notification
Properties props = new Properties();
props.put(SibNotificationConstants.KEY_DESTINATION_NAME, getName());
props.put(SibNotificationConstants.KEY_DESTINATION_UUID, getUuid().toString());
if (newState)
props.put(SibNotificationConstants.KEY_SEND_ALLOWED_STATE,
SibNotificationConstants.SEND_ALLOWED_TRUE);
else
props.put(SibNotificationConstants.KEY_SEND_ALLOWED_STATE,
SibNotificationConstants.SEND_ALLOWED_FALSE);
// Now create the Event object to pass to the control adapter
MPRuntimeEvent MPevent =
new MPRuntimeEvent(SibNotificationConstants.TYPE_SIB_MESSAGEPOINT_SEND_ALLOWED_STATE,
message,
props);
// Fire the event
runtimeEventOccurred(MPevent);
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "fireSendAllowedStateChangeEvent", "Event Notification is disabled, cannot fire event");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "fireSendAllowedStateChangeEvent");
} | class class_name[name] begin[{]
method[fireSendAllowedStateChangeEvent, return_type[void], modifier[private], parameter[newState]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["fireSendAllowedStateChangeEvent"], call[Boolean.valueOf, parameter[member[.newState]]]]]
else begin[{]
None
end[}]
local_variable[type[MessageProcessor], messageProcessor]
if[call[messageProcessor.getMessagingEngine, parameter[]]] begin[{]
local_variable[type[String], message]
local_variable[type[Properties], props]
call[props.put, parameter[member[SibNotificationConstants.KEY_DESTINATION_NAME], call[.getName, parameter[]]]]
call[props.put, parameter[member[SibNotificationConstants.KEY_DESTINATION_UUID], call[.getUuid, parameter[]]]]
if[member[.newState]] begin[{]
call[props.put, parameter[member[SibNotificationConstants.KEY_SEND_ALLOWED_STATE], member[SibNotificationConstants.SEND_ALLOWED_TRUE]]]
else begin[{]
call[props.put, parameter[member[SibNotificationConstants.KEY_SEND_ALLOWED_STATE], member[SibNotificationConstants.SEND_ALLOWED_FALSE]]]
end[}]
local_variable[type[MPRuntimeEvent], MPevent]
call[.runtimeEventOccurred, parameter[member[.MPevent]]]
else begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[member[.tc], literal["fireSendAllowedStateChangeEvent"], literal["Event Notification is disabled, cannot fire event"]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["fireSendAllowedStateChangeEvent"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[fireSendAllowedStateChangeEvent] operator[SEP] Keyword[boolean] identifier[newState] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[newState] operator[SEP] operator[SEP] operator[SEP] identifier[MessageProcessor] identifier[messageProcessor] operator[=] identifier[getMessageProcessor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[messageProcessor] operator[SEP] identifier[getMessagingEngine] operator[SEP] operator[SEP] operator[SEP] identifier[isEventNotificationEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[message] operator[=] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[getName] operator[SEP] operator[SEP] , identifier[getUuid] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[newState] operator[SEP]
} , Other[null] operator[SEP] operator[SEP] identifier[Properties] identifier[props] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] identifier[SibNotificationConstants] operator[SEP] identifier[KEY_DESTINATION_NAME] , identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] identifier[SibNotificationConstants] operator[SEP] identifier[KEY_DESTINATION_UUID] , identifier[getUuid] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newState] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] identifier[SibNotificationConstants] operator[SEP] identifier[KEY_SEND_ALLOWED_STATE] , identifier[SibNotificationConstants] operator[SEP] identifier[SEND_ALLOWED_TRUE] operator[SEP] operator[SEP] Keyword[else] identifier[props] operator[SEP] identifier[put] operator[SEP] identifier[SibNotificationConstants] operator[SEP] identifier[KEY_SEND_ALLOWED_STATE] , identifier[SibNotificationConstants] operator[SEP] identifier[SEND_ALLOWED_FALSE] operator[SEP] operator[SEP] identifier[MPRuntimeEvent] identifier[MPevent] operator[=] Keyword[new] identifier[MPRuntimeEvent] operator[SEP] identifier[SibNotificationConstants] operator[SEP] identifier[TYPE_SIB_MESSAGEPOINT_SEND_ALLOWED_STATE] , identifier[message] , identifier[props] operator[SEP] operator[SEP] identifier[runtimeEventOccurred] operator[SEP] identifier[MPevent] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] 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] operator[SEP] operator[SEP]
}
|
public com.groupon.odo.proxylib.models.Method getMethodForOverrideId(int overrideId) {
com.groupon.odo.proxylib.models.Method method = null;
// special case for IDs < 0
if (overrideId < 0) {
method = new com.groupon.odo.proxylib.models.Method();
method.setId(overrideId);
if (method.getId() == Constants.PLUGIN_RESPONSE_OVERRIDE_CUSTOM ||
method.getId() == Constants.PLUGIN_RESPONSE_HEADER_OVERRIDE_ADD ||
method.getId() == Constants.PLUGIN_RESPONSE_HEADER_OVERRIDE_REMOVE) {
method.setMethodType(Constants.PLUGIN_TYPE_RESPONSE_OVERRIDE);
} else {
method.setMethodType(Constants.PLUGIN_TYPE_REQUEST_OVERRIDE);
}
} else {
// get method information from the database
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants.DB_TABLE_OVERRIDE +
" WHERE " + Constants.GENERIC_ID + " = ?"
);
queryStatement.setInt(1, overrideId);
results = queryStatement.executeQuery();
if (results.next()) {
method = new com.groupon.odo.proxylib.models.Method();
method.setClassName(results.getString(Constants.OVERRIDE_CLASS_NAME));
method.setMethodName(results.getString(Constants.OVERRIDE_METHOD_NAME));
}
} catch (SQLException e) {
e.printStackTrace();
return null;
} finally {
try {
if (results != null) {
results.close();
}
} catch (Exception e) {
}
try {
if (queryStatement != null) {
queryStatement.close();
}
} catch (Exception e) {
}
}
// if method is still null then just return
if (method == null) {
return method;
}
// now get the rest of the data from the plugin manager
// this gets all of the actual method data
try {
method = PluginManager.getInstance().getMethod(method.getClassName(), method.getMethodName());
method.setId(overrideId);
} catch (Exception e) {
// there was some problem.. return null
return null;
}
}
return method;
} | class class_name[name] begin[{]
method[getMethodForOverrideId, return_type[type[com]], modifier[public], parameter[overrideId]] begin[{]
local_variable[type[com], method]
if[binary_operation[member[.overrideId], <, literal[0]]] begin[{]
assign[member[.method], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=groupon, sub_type=ReferenceType(arguments=None, dimensions=None, name=odo, sub_type=ReferenceType(arguments=None, dimensions=None, name=proxylib, sub_type=ReferenceType(arguments=None, dimensions=None, name=models, sub_type=ReferenceType(arguments=None, dimensions=None, name=Method, sub_type=None)))))))]
call[method.setId, parameter[member[.overrideId]]]
if[binary_operation[binary_operation[binary_operation[call[method.getId, parameter[]], ==, member[Constants.PLUGIN_RESPONSE_OVERRIDE_CUSTOM]], ||, binary_operation[call[method.getId, parameter[]], ==, member[Constants.PLUGIN_RESPONSE_HEADER_OVERRIDE_ADD]]], ||, binary_operation[call[method.getId, parameter[]], ==, member[Constants.PLUGIN_RESPONSE_HEADER_OVERRIDE_REMOVE]]]] begin[{]
call[method.setMethodType, parameter[member[Constants.PLUGIN_TYPE_RESPONSE_OVERRIDE]]]
else begin[{]
call[method.setMethodType, parameter[member[Constants.PLUGIN_TYPE_REQUEST_OVERRIDE]]]
end[}]
else begin[{]
local_variable[type[PreparedStatement], queryStatement]
local_variable[type[ResultSet], results]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=queryStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SELECT * FROM "), operandr=MemberReference(member=DB_TABLE_OVERRIDE, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" WHERE "), operator=+), operandr=MemberReference(member=GENERIC_ID, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = ?"), operator=+)], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=sqlConnection, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=overrideId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=queryStatement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=queryStatement, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=groupon, sub_type=ReferenceType(arguments=None, dimensions=None, name=odo, sub_type=ReferenceType(arguments=None, dimensions=None, name=proxylib, sub_type=ReferenceType(arguments=None, dimensions=None, name=models, sub_type=ReferenceType(arguments=None, dimensions=None, name=Method, sub_type=None)))))))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=OVERRIDE_CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None)], member=setClassName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=OVERRIDE_METHOD_NAME, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None)], member=setMethodName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=queryStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=queryStatement, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)], label=None, resources=[TryResource(annotations=[], modifiers=set(), name=sqlConnection, type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None), value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=sqlService, selectors=[], type_arguments=None))])
if[binary_operation[member[.method], ==, literal[null]]] begin[{]
return[member[.method]]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=PluginManager, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMethodName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None)], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=overrideId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setId, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
return[member[.method]]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[groupon] operator[SEP] identifier[odo] operator[SEP] identifier[proxylib] operator[SEP] identifier[models] operator[SEP] identifier[Method] identifier[getMethodForOverrideId] operator[SEP] Keyword[int] identifier[overrideId] operator[SEP] {
identifier[com] operator[SEP] identifier[groupon] operator[SEP] identifier[odo] operator[SEP] identifier[proxylib] operator[SEP] identifier[models] operator[SEP] identifier[Method] identifier[method] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[overrideId] operator[<] Other[0] operator[SEP] {
identifier[method] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[groupon] operator[SEP] identifier[odo] operator[SEP] identifier[proxylib] operator[SEP] identifier[models] operator[SEP] identifier[Method] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[setId] operator[SEP] identifier[overrideId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] identifier[Constants] operator[SEP] identifier[PLUGIN_RESPONSE_OVERRIDE_CUSTOM] operator[||] identifier[method] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] identifier[Constants] operator[SEP] identifier[PLUGIN_RESPONSE_HEADER_OVERRIDE_ADD] operator[||] identifier[method] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] identifier[Constants] operator[SEP] identifier[PLUGIN_RESPONSE_HEADER_OVERRIDE_REMOVE] operator[SEP] {
identifier[method] operator[SEP] identifier[setMethodType] operator[SEP] identifier[Constants] operator[SEP] identifier[PLUGIN_TYPE_RESPONSE_OVERRIDE] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[method] operator[SEP] identifier[setMethodType] operator[SEP] identifier[Constants] operator[SEP] identifier[PLUGIN_TYPE_REQUEST_OVERRIDE] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[PreparedStatement] identifier[queryStatement] operator[=] Other[null] operator[SEP] identifier[ResultSet] identifier[results] operator[=] Other[null] operator[SEP] Keyword[try] operator[SEP] identifier[Connection] identifier[sqlConnection] operator[=] identifier[sqlService] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] {
identifier[queryStatement] operator[=] identifier[sqlConnection] operator[SEP] identifier[prepareStatement] operator[SEP] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[DB_TABLE_OVERRIDE] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[GENERIC_ID] operator[+] literal[String] operator[SEP] operator[SEP] identifier[queryStatement] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[overrideId] operator[SEP] operator[SEP] identifier[results] operator[=] identifier[queryStatement] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[results] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
identifier[method] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[groupon] operator[SEP] identifier[odo] operator[SEP] identifier[proxylib] operator[SEP] identifier[models] operator[SEP] identifier[Method] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[setClassName] operator[SEP] identifier[results] operator[SEP] identifier[getString] operator[SEP] identifier[Constants] operator[SEP] identifier[OVERRIDE_CLASS_NAME] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[setMethodName] operator[SEP] identifier[results] operator[SEP] identifier[getString] operator[SEP] identifier[Constants] operator[SEP] identifier[OVERRIDE_METHOD_NAME] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[results] operator[!=] Other[null] operator[SEP] {
identifier[results] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[queryStatement] operator[!=] Other[null] operator[SEP] {
identifier[queryStatement] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
}
}
Keyword[if] operator[SEP] identifier[method] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[method] operator[SEP]
}
Keyword[try] {
identifier[method] operator[=] identifier[PluginManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] identifier[method] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[setId] operator[SEP] identifier[overrideId] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
Keyword[return] identifier[method] operator[SEP]
}
|
public void init(Record record, Object bookmark, Object source)
{
if (source == null)
source = record;
Map<String,Object> properties = new HashMap<String,Object>();
BaseDatabase database = null;
if (record != null)
{
database = record.getTable().getDatabase();
properties.put(DB_NAME, database.getDatabaseName(true));
properties.put(TABLE_NAME, record.getTableNames(false));
if (bookmark != null)
properties.put(BOOKMARK, bookmark);
m_iDatabaseType = record.getTable().getDatabase().getDatabaseType();
}
super.init(MessageConstants.RECORD_QUEUE_NAME, MessageConstants.INTRANET_QUEUE, source, properties);
if (database != null)
{
if ((DBConstants.REMOTE != (record.getDatabaseType() & DBConstants.TABLE_TYPE_MASK)) // Track for remote files only
&& (DBConstants.REMOTE_MEMORY != (record.getDatabaseType() & DBConstants.TABLE_TYPE_MASK)))
this.setCreateRemoteFilter(false);
if (DBConstants.FALSE.equals(database.getProperty(DBParams.CREATE_REMOTE_FILTER)))
this.setCreateRemoteFilter(false);
if (DBConstants.FALSE.equals(database.getProperty(DBParams.UPDATE_REMOTE_FILTER)))
this.setUpdateRemoteFilter(false);
}
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[record, bookmark, source]] begin[{]
if[binary_operation[member[.source], ==, literal[null]]] begin[{]
assign[member[.source], member[.record]]
else begin[{]
None
end[}]
local_variable[type[Map], properties]
local_variable[type[BaseDatabase], database]
if[binary_operation[member[.record], !=, literal[null]]] begin[{]
assign[member[.database], call[record.getTable, parameter[]]]
call[properties.put, parameter[member[.DB_NAME], call[database.getDatabaseName, parameter[literal[true]]]]]
call[properties.put, parameter[member[.TABLE_NAME], call[record.getTableNames, parameter[literal[false]]]]]
if[binary_operation[member[.bookmark], !=, literal[null]]] begin[{]
call[properties.put, parameter[member[.BOOKMARK], member[.bookmark]]]
else begin[{]
None
end[}]
assign[member[.m_iDatabaseType], call[record.getTable, parameter[]]]
else begin[{]
None
end[}]
SuperMethodInvocation(arguments=[MemberReference(member=RECORD_QUEUE_NAME, postfix_operators=[], prefix_operators=[], qualifier=MessageConstants, selectors=[]), MemberReference(member=INTRANET_QUEUE, postfix_operators=[], prefix_operators=[], qualifier=MessageConstants, selectors=[]), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[binary_operation[member[.database], !=, literal[null]]] begin[{]
if[binary_operation[binary_operation[member[DBConstants.REMOTE], !=, binary_operation[call[record.getDatabaseType, parameter[]], &, member[DBConstants.TABLE_TYPE_MASK]]], &&, binary_operation[member[DBConstants.REMOTE_MEMORY], !=, binary_operation[call[record.getDatabaseType, parameter[]], &, member[DBConstants.TABLE_TYPE_MASK]]]]] begin[{]
THIS[call[None.setCreateRemoteFilter, parameter[literal[false]]]]
else begin[{]
None
end[}]
if[call[DBConstants.FALSE.equals, parameter[call[database.getProperty, parameter[member[DBParams.CREATE_REMOTE_FILTER]]]]]] begin[{]
THIS[call[None.setCreateRemoteFilter, parameter[literal[false]]]]
else begin[{]
None
end[}]
if[call[DBConstants.FALSE.equals, parameter[call[database.getProperty, parameter[member[DBParams.UPDATE_REMOTE_FILTER]]]]]] begin[{]
THIS[call[None.setUpdateRemoteFilter, parameter[literal[false]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[Record] identifier[record] , identifier[Object] identifier[bookmark] , identifier[Object] identifier[source] operator[SEP] {
Keyword[if] operator[SEP] identifier[source] operator[==] Other[null] operator[SEP] identifier[source] operator[=] identifier[record] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[BaseDatabase] identifier[database] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[!=] Other[null] operator[SEP] {
identifier[database] operator[=] identifier[record] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[DB_NAME] , identifier[database] operator[SEP] identifier[getDatabaseName] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[TABLE_NAME] , identifier[record] operator[SEP] identifier[getTableNames] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bookmark] operator[!=] Other[null] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[BOOKMARK] , identifier[bookmark] operator[SEP] operator[SEP] identifier[m_iDatabaseType] operator[=] identifier[record] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getDatabaseType] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[MessageConstants] operator[SEP] identifier[RECORD_QUEUE_NAME] , identifier[MessageConstants] operator[SEP] identifier[INTRANET_QUEUE] , identifier[source] , identifier[properties] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[database] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[DBConstants] operator[SEP] identifier[REMOTE] operator[!=] operator[SEP] identifier[record] operator[SEP] identifier[getDatabaseType] operator[SEP] operator[SEP] operator[&] identifier[DBConstants] operator[SEP] identifier[TABLE_TYPE_MASK] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[DBConstants] operator[SEP] identifier[REMOTE_MEMORY] operator[!=] operator[SEP] identifier[record] operator[SEP] identifier[getDatabaseType] operator[SEP] operator[SEP] operator[&] identifier[DBConstants] operator[SEP] identifier[TABLE_TYPE_MASK] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setCreateRemoteFilter] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DBConstants] operator[SEP] identifier[FALSE] operator[SEP] identifier[equals] operator[SEP] identifier[database] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBParams] operator[SEP] identifier[CREATE_REMOTE_FILTER] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setCreateRemoteFilter] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DBConstants] operator[SEP] identifier[FALSE] operator[SEP] identifier[equals] operator[SEP] identifier[database] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBParams] operator[SEP] identifier[UPDATE_REMOTE_FILTER] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setUpdateRemoteFilter] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
|
public final int pageX() {
if (getTouches() != null && getTouches().length() > 0) {
return getTouches().get(0).getPageX();
} else {
return getClientX() + GQuery.document.getScrollLeft();
}
} | class class_name[name] begin[{]
method[pageX, return_type[type[int]], modifier[final public], parameter[]] begin[{]
if[binary_operation[binary_operation[call[.getTouches, parameter[]], !=, literal[null]], &&, binary_operation[call[.getTouches, parameter[]], >, literal[0]]]] begin[{]
return[call[.getTouches, parameter[]]]
else begin[{]
return[binary_operation[call[.getClientX, parameter[]], +, call[GQuery.document.getScrollLeft, parameter[]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[int] identifier[pageX] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[getTouches] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[getTouches] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[return] identifier[getTouches] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getPageX] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[getClientX] operator[SEP] operator[SEP] operator[+] identifier[GQuery] operator[SEP] identifier[document] operator[SEP] identifier[getScrollLeft] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static String buildErrorMessage(Exception e, String annotationSimpleName) {
StackTraceElement[] stackTrace = e.getStackTrace();
StringBuilder builder = new StringBuilder()
.append("Processing of annotation ")
.append(annotationSimpleName)
.append(" : ")
.append(e);
if (stackTrace.length > 0) {
builder.append(" at ").append(stackTrace[0]);
}
return builder.toString();
} | class class_name[name] begin[{]
method[buildErrorMessage, return_type[type[String]], modifier[private static], parameter[e, annotationSimpleName]] begin[{]
local_variable[type[StackTraceElement], stackTrace]
local_variable[type[StringBuilder], builder]
if[binary_operation[member[stackTrace.length], >, literal[0]]] begin[{]
call[builder.append, parameter[literal[" at "]]]
else begin[{]
None
end[}]
return[call[builder.toString, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[buildErrorMessage] operator[SEP] identifier[Exception] identifier[e] , identifier[String] identifier[annotationSimpleName] operator[SEP] {
identifier[StackTraceElement] operator[SEP] operator[SEP] identifier[stackTrace] operator[=] identifier[e] operator[SEP] identifier[getStackTrace] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[annotationSimpleName] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stackTrace] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[stackTrace] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void put(String ID,
String resourceName,
int dir,
boolean visible) {
registerEntry(ID, new ResourceEntry(resourceName, dir), visible);
} | class class_name[name] begin[{]
method[put, return_type[void], modifier[public], parameter[ID, resourceName, dir, visible]] begin[{]
call[.registerEntry, parameter[member[.ID], ClassCreator(arguments=[MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dir, 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=ResourceEntry, sub_type=None)), member[.visible]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[put] operator[SEP] identifier[String] identifier[ID] , identifier[String] identifier[resourceName] , Keyword[int] identifier[dir] , Keyword[boolean] identifier[visible] operator[SEP] {
identifier[registerEntry] operator[SEP] identifier[ID] , Keyword[new] identifier[ResourceEntry] operator[SEP] identifier[resourceName] , identifier[dir] operator[SEP] , identifier[visible] operator[SEP] operator[SEP]
}
|
protected void updateSelection()
{
byte[] data = m_model.getData();
int offset = m_model.getOffset();
Point selectedCell = m_model.getSelectedCell();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
DateFormat timeFormat = new SimpleDateFormat("HH:mm");
DateFormat timestampFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
int selectionIndex = (selectedCell.y * m_model.getColumns()) + selectedCell.x;
String selectionLabel = selectedCell.y + "," + selectedCell.x;
String differenceLabel = Integer.toString(Math.abs(m_model.getCurrentSelectionIndex() - selectionIndex));
String shortValueLabel = "";
String longSixValueLabel = "";
String longValueLabel = "";
String doubleValueLabel = "";
String durationValueLabel = "";
String timeUnitsValueLabel = "";
String guidValueLabel = "";
String percentageValueLabel = "";
String dateValueLabel = "";
String timeValueLabel = "";
String timestampValueLabel = "";
String workUnitsValueLabel = "";
if (selectionIndex + offset + 2 <= data.length)
{
shortValueLabel = Integer.toString(MPPUtility.getShort(data, selectionIndex + offset));
timeUnitsValueLabel = MPPUtility.getDurationTimeUnits(MPPUtility.getShort(data, selectionIndex + offset)).toString();
Double value = MPPUtility.getPercentage(data, selectionIndex + offset);
if (value != null)
{
percentageValueLabel = value.toString();
}
Date date = MPPUtility.getDate(data, selectionIndex + offset);
if (date != null)
{
dateValueLabel = dateFormat.format(date);
}
timeValueLabel = timeFormat.format(MPPUtility.getTime(data, selectionIndex + offset));
}
//
// 1 byte
//
workUnitsValueLabel = MPPUtility.getWorkTimeUnits(MPPUtility.getByte(data, selectionIndex + offset)).toString();
//
// 4 bytes
//
if (selectionIndex + offset + 4 <= data.length)
{
Date timestamp = MPPUtility.getTimestamp(data, selectionIndex + offset);
if (timestamp != null)
{
timestampValueLabel = timestampFormat.format(timestamp);
}
}
//
// 6 bytes
//
if (selectionIndex + offset + 6 <= data.length)
{
longSixValueLabel = Long.toString(MPPUtility.getLong6(data, selectionIndex + offset));
}
//
// 8 bytes
//
if (selectionIndex + offset + 8 <= data.length)
{
longValueLabel = Long.toString(MPPUtility.getLong(data, selectionIndex + offset));
doubleValueLabel = Double.toString(MPPUtility.getDouble(data, selectionIndex + offset));
durationValueLabel = Duration.getInstance(MPPUtility.getDouble(data, selectionIndex + offset) / 60000, TimeUnit.HOURS).toString();
}
//
// 16 bytes
//
if (selectionIndex + offset + 16 <= data.length)
{
guidValueLabel = MPPUtility.getGUID(data, selectionIndex + offset).toString().toUpperCase();
}
m_model.setPreviousSelectionIndex(m_model.getCurrentSelectionIndex());
m_model.setCurrentSelectionIndex(selectionIndex);
m_model.setPreviousSelectionValueLabel(m_model.getCurrentSelectionValueLabel());
m_model.setCurrentSelectionValueLabel(selectionLabel);
m_model.setSelectionDifferenceValueLabel(differenceLabel);
m_model.setShortValueLabel(shortValueLabel);
m_model.setLongSixValueLabel(longSixValueLabel);
m_model.setLongValueLabel(longValueLabel);
m_model.setDoubleValueLabel(doubleValueLabel);
m_model.setDurationValueLabel(durationValueLabel);
m_model.setTimeUnitsValueLabel(timeUnitsValueLabel);
m_model.setGuidValueLabel(guidValueLabel);
m_model.setPercentageValueLabel(percentageValueLabel);
m_model.setDateValueLabel(dateValueLabel);
m_model.setTimeValueLabel(timeValueLabel);
m_model.setTimestampValueLabel(timestampValueLabel);
m_model.setWorkUnitsValueLabel(workUnitsValueLabel);
} | class class_name[name] begin[{]
method[updateSelection, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[byte], data]
local_variable[type[int], offset]
local_variable[type[Point], selectedCell]
local_variable[type[DateFormat], dateFormat]
local_variable[type[DateFormat], timeFormat]
local_variable[type[DateFormat], timestampFormat]
local_variable[type[int], selectionIndex]
local_variable[type[String], selectionLabel]
local_variable[type[String], differenceLabel]
local_variable[type[String], shortValueLabel]
local_variable[type[String], longSixValueLabel]
local_variable[type[String], longValueLabel]
local_variable[type[String], doubleValueLabel]
local_variable[type[String], durationValueLabel]
local_variable[type[String], timeUnitsValueLabel]
local_variable[type[String], guidValueLabel]
local_variable[type[String], percentageValueLabel]
local_variable[type[String], dateValueLabel]
local_variable[type[String], timeValueLabel]
local_variable[type[String], timestampValueLabel]
local_variable[type[String], workUnitsValueLabel]
if[binary_operation[binary_operation[binary_operation[member[.selectionIndex], +, member[.offset]], +, literal[2]], <=, member[data.length]]] begin[{]
assign[member[.shortValueLabel], call[Integer.toString, parameter[call[MPPUtility.getShort, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]]]
assign[member[.timeUnitsValueLabel], call[MPPUtility.getDurationTimeUnits, parameter[call[MPPUtility.getShort, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]]]
local_variable[type[Double], value]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
assign[member[.percentageValueLabel], call[value.toString, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[Date], date]
if[binary_operation[member[.date], !=, literal[null]]] begin[{]
assign[member[.dateValueLabel], call[dateFormat.format, parameter[member[.date]]]]
else begin[{]
None
end[}]
assign[member[.timeValueLabel], call[timeFormat.format, parameter[call[MPPUtility.getTime, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]]]
else begin[{]
None
end[}]
assign[member[.workUnitsValueLabel], call[MPPUtility.getWorkTimeUnits, parameter[call[MPPUtility.getByte, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]]]
if[binary_operation[binary_operation[binary_operation[member[.selectionIndex], +, member[.offset]], +, literal[4]], <=, member[data.length]]] begin[{]
local_variable[type[Date], timestamp]
if[binary_operation[member[.timestamp], !=, literal[null]]] begin[{]
assign[member[.timestampValueLabel], call[timestampFormat.format, parameter[member[.timestamp]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.selectionIndex], +, member[.offset]], +, literal[6]], <=, member[data.length]]] begin[{]
assign[member[.longSixValueLabel], call[Long.toString, parameter[call[MPPUtility.getLong6, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.selectionIndex], +, member[.offset]], +, literal[8]], <=, member[data.length]]] begin[{]
assign[member[.longValueLabel], call[Long.toString, parameter[call[MPPUtility.getLong, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]]]
assign[member[.doubleValueLabel], call[Double.toString, parameter[call[MPPUtility.getDouble, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]]]
assign[member[.durationValueLabel], call[Duration.getInstance, parameter[binary_operation[call[MPPUtility.getDouble, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]], /, literal[60000]], member[TimeUnit.HOURS]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.selectionIndex], +, member[.offset]], +, literal[16]], <=, member[data.length]]] begin[{]
assign[member[.guidValueLabel], call[MPPUtility.getGUID, parameter[member[.data], binary_operation[member[.selectionIndex], +, member[.offset]]]]]
else begin[{]
None
end[}]
call[m_model.setPreviousSelectionIndex, parameter[call[m_model.getCurrentSelectionIndex, parameter[]]]]
call[m_model.setCurrentSelectionIndex, parameter[member[.selectionIndex]]]
call[m_model.setPreviousSelectionValueLabel, parameter[call[m_model.getCurrentSelectionValueLabel, parameter[]]]]
call[m_model.setCurrentSelectionValueLabel, parameter[member[.selectionLabel]]]
call[m_model.setSelectionDifferenceValueLabel, parameter[member[.differenceLabel]]]
call[m_model.setShortValueLabel, parameter[member[.shortValueLabel]]]
call[m_model.setLongSixValueLabel, parameter[member[.longSixValueLabel]]]
call[m_model.setLongValueLabel, parameter[member[.longValueLabel]]]
call[m_model.setDoubleValueLabel, parameter[member[.doubleValueLabel]]]
call[m_model.setDurationValueLabel, parameter[member[.durationValueLabel]]]
call[m_model.setTimeUnitsValueLabel, parameter[member[.timeUnitsValueLabel]]]
call[m_model.setGuidValueLabel, parameter[member[.guidValueLabel]]]
call[m_model.setPercentageValueLabel, parameter[member[.percentageValueLabel]]]
call[m_model.setDateValueLabel, parameter[member[.dateValueLabel]]]
call[m_model.setTimeValueLabel, parameter[member[.timeValueLabel]]]
call[m_model.setTimestampValueLabel, parameter[member[.timestampValueLabel]]]
call[m_model.setWorkUnitsValueLabel, parameter[member[.workUnitsValueLabel]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[updateSelection] operator[SEP] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[m_model] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[offset] operator[=] identifier[m_model] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[SEP] identifier[Point] identifier[selectedCell] operator[=] identifier[m_model] operator[SEP] identifier[getSelectedCell] operator[SEP] operator[SEP] operator[SEP] identifier[DateFormat] identifier[dateFormat] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[DateFormat] identifier[timeFormat] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[DateFormat] identifier[timestampFormat] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[selectionIndex] operator[=] operator[SEP] identifier[selectedCell] operator[SEP] identifier[y] operator[*] identifier[m_model] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[selectedCell] operator[SEP] identifier[x] operator[SEP] identifier[String] identifier[selectionLabel] operator[=] identifier[selectedCell] operator[SEP] identifier[y] operator[+] literal[String] operator[+] identifier[selectedCell] operator[SEP] identifier[x] operator[SEP] identifier[String] identifier[differenceLabel] operator[=] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[m_model] operator[SEP] identifier[getCurrentSelectionIndex] operator[SEP] operator[SEP] operator[-] identifier[selectionIndex] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[shortValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[longSixValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[longValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[doubleValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[durationValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[timeUnitsValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[guidValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[percentageValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[dateValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[timeValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[timestampValueLabel] operator[=] literal[String] operator[SEP] identifier[String] identifier[workUnitsValueLabel] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[selectionIndex] operator[+] identifier[offset] operator[+] Other[2] operator[<=] identifier[data] operator[SEP] identifier[length] operator[SEP] {
identifier[shortValueLabel] operator[=] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getShort] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] operator[SEP] identifier[timeUnitsValueLabel] operator[=] identifier[MPPUtility] operator[SEP] identifier[getDurationTimeUnits] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getShort] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Double] identifier[value] operator[=] identifier[MPPUtility] operator[SEP] identifier[getPercentage] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[percentageValueLabel] operator[=] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Date] identifier[date] operator[=] identifier[MPPUtility] operator[SEP] identifier[getDate] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[date] operator[!=] Other[null] operator[SEP] {
identifier[dateValueLabel] operator[=] identifier[dateFormat] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] operator[SEP]
}
identifier[timeValueLabel] operator[=] identifier[timeFormat] operator[SEP] identifier[format] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getTime] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] operator[SEP]
}
identifier[workUnitsValueLabel] operator[=] identifier[MPPUtility] operator[SEP] identifier[getWorkTimeUnits] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getByte] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selectionIndex] operator[+] identifier[offset] operator[+] Other[4] operator[<=] identifier[data] operator[SEP] identifier[length] operator[SEP] {
identifier[Date] identifier[timestamp] operator[=] identifier[MPPUtility] operator[SEP] identifier[getTimestamp] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timestamp] operator[!=] Other[null] operator[SEP] {
identifier[timestampValueLabel] operator[=] identifier[timestampFormat] operator[SEP] identifier[format] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[selectionIndex] operator[+] identifier[offset] operator[+] Other[6] operator[<=] identifier[data] operator[SEP] identifier[length] operator[SEP] {
identifier[longSixValueLabel] operator[=] identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getLong6] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[selectionIndex] operator[+] identifier[offset] operator[+] Other[8] operator[<=] identifier[data] operator[SEP] identifier[length] operator[SEP] {
identifier[longValueLabel] operator[=] identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getLong] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] operator[SEP] identifier[doubleValueLabel] operator[=] identifier[Double] operator[SEP] identifier[toString] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getDouble] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] operator[SEP] identifier[durationValueLabel] operator[=] identifier[Duration] operator[SEP] identifier[getInstance] operator[SEP] identifier[MPPUtility] operator[SEP] identifier[getDouble] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[/] Other[60000] , identifier[TimeUnit] operator[SEP] identifier[HOURS] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[selectionIndex] operator[+] identifier[offset] operator[+] Other[16] operator[<=] identifier[data] operator[SEP] identifier[length] operator[SEP] {
identifier[guidValueLabel] operator[=] identifier[MPPUtility] operator[SEP] identifier[getGUID] operator[SEP] identifier[data] , identifier[selectionIndex] operator[+] identifier[offset] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP]
}
identifier[m_model] operator[SEP] identifier[setPreviousSelectionIndex] operator[SEP] identifier[m_model] operator[SEP] identifier[getCurrentSelectionIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setCurrentSelectionIndex] operator[SEP] identifier[selectionIndex] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setPreviousSelectionValueLabel] operator[SEP] identifier[m_model] operator[SEP] identifier[getCurrentSelectionValueLabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setCurrentSelectionValueLabel] operator[SEP] identifier[selectionLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setSelectionDifferenceValueLabel] operator[SEP] identifier[differenceLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setShortValueLabel] operator[SEP] identifier[shortValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setLongSixValueLabel] operator[SEP] identifier[longSixValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setLongValueLabel] operator[SEP] identifier[longValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setDoubleValueLabel] operator[SEP] identifier[doubleValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setDurationValueLabel] operator[SEP] identifier[durationValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setTimeUnitsValueLabel] operator[SEP] identifier[timeUnitsValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setGuidValueLabel] operator[SEP] identifier[guidValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setPercentageValueLabel] operator[SEP] identifier[percentageValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setDateValueLabel] operator[SEP] identifier[dateValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setTimeValueLabel] operator[SEP] identifier[timeValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setTimestampValueLabel] operator[SEP] identifier[timestampValueLabel] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setWorkUnitsValueLabel] operator[SEP] identifier[workUnitsValueLabel] operator[SEP] operator[SEP]
}
|
@Override
public StoreKey getStoreKey()
{
final StoreType type = getStoreType();
if ( type == null )
{
return null;
}
final String name = matcher.group( NAME_GRP );
if ( isEmpty( name ) )
{
return null;
}
return new StoreKey( type, name );
} | class class_name[name] begin[{]
method[getStoreKey, return_type[type[StoreKey]], modifier[public], parameter[]] begin[{]
local_variable[type[StoreType], type]
if[binary_operation[member[.type], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], name]
if[call[.isEmpty, parameter[member[.name]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StoreKey, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[StoreKey] identifier[getStoreKey] operator[SEP] operator[SEP] {
Keyword[final] identifier[StoreType] identifier[type] operator[=] identifier[getStoreType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[final] identifier[String] identifier[name] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] identifier[NAME_GRP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] Keyword[new] identifier[StoreKey] operator[SEP] identifier[type] , identifier[name] operator[SEP] operator[SEP]
}
|
public int writeGraphToFile(byte[] img, String file)
{
File to = new File(file);
return writeGraphToFile(img, to);
} | class class_name[name] begin[{]
method[writeGraphToFile, return_type[type[int]], modifier[public], parameter[img, file]] begin[{]
local_variable[type[File], to]
return[call[.writeGraphToFile, parameter[member[.img], member[.to]]]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[writeGraphToFile] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[img] , identifier[String] identifier[file] operator[SEP] {
identifier[File] identifier[to] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[return] identifier[writeGraphToFile] operator[SEP] identifier[img] , identifier[to] operator[SEP] operator[SEP]
}
|
public ServiceFuture<SiteSealInner> retrieveSiteSealAsync(String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest, final ServiceCallback<SiteSealInner> serviceCallback) {
return ServiceFuture.fromResponse(retrieveSiteSealWithServiceResponseAsync(resourceGroupName, certificateOrderName, siteSealRequest), serviceCallback);
} | class class_name[name] begin[{]
method[retrieveSiteSealAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, certificateOrderName, siteSealRequest, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.retrieveSiteSealWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.certificateOrderName], member[.siteSealRequest]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[SiteSealInner] operator[>] identifier[retrieveSiteSealAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[certificateOrderName] , identifier[SiteSealRequest] identifier[siteSealRequest] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[SiteSealInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[retrieveSiteSealWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[certificateOrderName] , identifier[siteSealRequest] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
void add(TimerTask task) {
// Grow backing store if necessary
if (size + 1 == queue.length)
queue = Arrays.copyOf(queue, 2*queue.length);
queue[++size] = task;
fixUp(size);
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[default], parameter[task]] begin[{]
if[binary_operation[binary_operation[member[.size], +, literal[1]], ==, member[queue.length]]] begin[{]
assign[member[.queue], call[Arrays.copyOf, parameter[member[.queue], binary_operation[literal[2], *, member[queue.length]]]]]
else begin[{]
None
end[}]
assign[member[.queue], member[.task]]
call[.fixUp, parameter[member[.size]]]
end[}]
END[}] | Keyword[void] identifier[add] operator[SEP] identifier[TimerTask] identifier[task] operator[SEP] {
Keyword[if] operator[SEP] identifier[size] operator[+] Other[1] operator[==] identifier[queue] operator[SEP] identifier[length] operator[SEP] identifier[queue] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[queue] , Other[2] operator[*] identifier[queue] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[queue] operator[SEP] operator[++] identifier[size] operator[SEP] operator[=] identifier[task] operator[SEP] identifier[fixUp] operator[SEP] identifier[size] operator[SEP] operator[SEP]
}
|
private void debug(String format, Object... message) {
Boolean DEBUG = Boolean.valueOf(System.getProperty("arquillian.debug"));
if (DEBUG) {
log.log(Level.WARNING, format, message);
}
} | class class_name[name] begin[{]
method[debug, return_type[void], modifier[private], parameter[format, message]] begin[{]
local_variable[type[Boolean], DEBUG]
if[member[.DEBUG]] begin[{]
call[log.log, parameter[member[Level.WARNING], member[.format], member[.message]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[debug] operator[SEP] identifier[String] identifier[format] , identifier[Object] operator[...] identifier[message] operator[SEP] {
identifier[Boolean] identifier[DEBUG] operator[=] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] {
identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , identifier[format] , identifier[message] operator[SEP] operator[SEP]
}
}
|
public void d(final String msg) {
logMgr.log(tag, LogLevelConst.DEBUG, msg, null);
} | class class_name[name] begin[{]
method[d, return_type[void], modifier[public], parameter[msg]] begin[{]
call[logMgr.log, parameter[member[.tag], member[LogLevelConst.DEBUG], member[.msg], literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[d] operator[SEP] Keyword[final] identifier[String] identifier[msg] operator[SEP] {
identifier[logMgr] operator[SEP] identifier[log] operator[SEP] identifier[tag] , identifier[LogLevelConst] operator[SEP] identifier[DEBUG] , identifier[msg] , Other[null] operator[SEP] operator[SEP]
}
|
protected void isAttributeWellFormed(Node node) {
boolean isNameWF = false;
if ((fFeatures & NAMESPACES) != 0) {
isNameWF =
isValidQName(
node.getPrefix(),
node.getLocalName(),
fIsXMLVersion11);
} else {
isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11);
}
if (!isNameWF) {
String msg =
Utils.messages.createMessage(
MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
new Object[] { "Attr", node.getNodeName()});
if (fErrorHandler != null) {
fErrorHandler.handleError(
new DOMErrorImpl(
DOMError.SEVERITY_FATAL_ERROR,
msg,
MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
null,
null,
null));
}
}
// Check the Attr's node value
// WFC: No < in Attribute Values
String value = node.getNodeValue();
if (value.indexOf('<') >= 0) {
String msg =
Utils.messages.createMessage(
MsgKey.ER_WF_LT_IN_ATTVAL,
new Object[] {
((Attr) node).getOwnerElement().getNodeName(),
node.getNodeName()});
if (fErrorHandler != null) {
fErrorHandler.handleError(
new DOMErrorImpl(
DOMError.SEVERITY_FATAL_ERROR,
msg,
MsgKey.ER_WF_LT_IN_ATTVAL,
null,
null,
null));
}
}
// we need to loop through the children of attr nodes and check their values for
// well-formedness
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
// An attribute node with no text or entity ref child for example
// doc.createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns");
// followes by
// element.setAttributeNodeNS(attribute);
// can potentially lead to this situation. If the attribute
// was a prefix Namespace attribute declaration then then DOM Core
// should have some exception defined for this.
if (child == null) {
// we should probably report an error
continue;
}
switch (child.getNodeType()) {
case Node.TEXT_NODE :
isTextWellFormed((Text) child);
break;
case Node.ENTITY_REFERENCE_NODE :
isEntityReferneceWellFormed((EntityReference) child);
break;
default :
}
}
// TODO:
// WFC: Check if the attribute prefix is bound to
// http://www.w3.org/2000/xmlns/
// WFC: Unique Att Spec
// Perhaps pass a seen boolean value to this method. serializeAttList will determine
// if the attr was seen before.
} | class class_name[name] begin[{]
method[isAttributeWellFormed, return_type[void], modifier[protected], parameter[node]] begin[{]
local_variable[type[boolean], isNameWF]
if[binary_operation[binary_operation[member[.fFeatures], &, member[.NAMESPACES]], !=, literal[0]]] begin[{]
assign[member[.isNameWF], call[.isValidQName, parameter[call[node.getPrefix, parameter[]], call[node.getLocalName, parameter[]], member[.fIsXMLVersion11]]]]
else begin[{]
assign[member[.isNameWF], call[.isXMLName, parameter[call[node.getNodeName, parameter[]], member[.fIsXMLVersion11]]]]
end[}]
if[member[.isNameWF]] begin[{]
local_variable[type[String], msg]
if[binary_operation[member[.fErrorHandler], !=, literal[null]]] begin[{]
call[fErrorHandler.handleError, parameter[ClassCreator(arguments=[MemberReference(member=SEVERITY_FATAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=DOMError, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ER_WF_INVALID_CHARACTER_IN_NODE_NAME, postfix_operators=[], prefix_operators=[], qualifier=MsgKey, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMErrorImpl, sub_type=None))]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[String], value]
if[binary_operation[call[value.indexOf, parameter[literal['<']]], >=, literal[0]]] begin[{]
local_variable[type[String], msg]
if[binary_operation[member[.fErrorHandler], !=, literal[null]]] begin[{]
call[fErrorHandler.handleError, parameter[ClassCreator(arguments=[MemberReference(member=SEVERITY_FATAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=DOMError, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ER_WF_LT_IN_ATTVAL, postfix_operators=[], prefix_operators=[], qualifier=MsgKey, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMErrorImpl, sub_type=None))]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[NodeList], children]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=TEXT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Text, sub_type=None))], member=isTextWellFormed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=ENTITY_REFERENCE_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EntityReference, sub_type=None))], member=isEntityReferneceWellFormed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[])], expression=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=child, 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=children, 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[protected] Keyword[void] identifier[isAttributeWellFormed] operator[SEP] identifier[Node] identifier[node] operator[SEP] {
Keyword[boolean] identifier[isNameWF] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[fFeatures] operator[&] identifier[NAMESPACES] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[isNameWF] operator[=] identifier[isValidQName] operator[SEP] identifier[node] operator[SEP] identifier[getPrefix] operator[SEP] operator[SEP] , identifier[node] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] , identifier[fIsXMLVersion11] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[isNameWF] operator[=] identifier[isXMLName] operator[SEP] identifier[node] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] , identifier[fIsXMLVersion11] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[isNameWF] operator[SEP] {
identifier[String] identifier[msg] operator[=] identifier[Utils] operator[SEP] identifier[messages] operator[SEP] identifier[createMessage] operator[SEP] identifier[MsgKey] operator[SEP] identifier[ER_WF_INVALID_CHARACTER_IN_NODE_NAME] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[node] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fErrorHandler] operator[!=] Other[null] operator[SEP] {
identifier[fErrorHandler] operator[SEP] identifier[handleError] operator[SEP] Keyword[new] identifier[DOMErrorImpl] operator[SEP] identifier[DOMError] operator[SEP] identifier[SEVERITY_FATAL_ERROR] , identifier[msg] , identifier[MsgKey] operator[SEP] identifier[ER_WF_INVALID_CHARACTER_IN_NODE_NAME] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[String] identifier[value] operator[=] identifier[node] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[SEP] {
identifier[String] identifier[msg] operator[=] identifier[Utils] operator[SEP] identifier[messages] operator[SEP] identifier[createMessage] operator[SEP] identifier[MsgKey] operator[SEP] identifier[ER_WF_LT_IN_ATTVAL] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
operator[SEP] operator[SEP] identifier[Attr] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[getOwnerElement] operator[SEP] operator[SEP] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] , identifier[node] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fErrorHandler] operator[!=] Other[null] operator[SEP] {
identifier[fErrorHandler] operator[SEP] identifier[handleError] operator[SEP] Keyword[new] identifier[DOMErrorImpl] operator[SEP] identifier[DOMError] operator[SEP] identifier[SEVERITY_FATAL_ERROR] , identifier[msg] , identifier[MsgKey] operator[SEP] identifier[ER_WF_LT_IN_ATTVAL] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[NodeList] identifier[children] 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[children] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Node] identifier[child] operator[=] identifier[children] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[child] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[child] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[Node] operator[SEP] identifier[TEXT_NODE] operator[:] identifier[isTextWellFormed] operator[SEP] operator[SEP] identifier[Text] operator[SEP] identifier[child] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Node] operator[SEP] identifier[ENTITY_REFERENCE_NODE] operator[:] identifier[isEntityReferneceWellFormed] operator[SEP] operator[SEP] identifier[EntityReference] operator[SEP] identifier[child] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:]
}
}
}
|
@Override
public void resolve(final ValueStack values) throws Exception
{
super.resolve(values);
values.push(new Boolean(!values.popBoolean()));
return;
} | class class_name[name] begin[{]
method[resolve, return_type[void], modifier[public], parameter[values]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
call[values.push, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=popBoolean, postfix_operators=[], prefix_operators=['!'], qualifier=values, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]]
return[None]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[resolve] operator[SEP] Keyword[final] identifier[ValueStack] identifier[values] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[super] operator[SEP] identifier[resolve] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[push] operator[SEP] Keyword[new] identifier[Boolean] operator[SEP] operator[!] identifier[values] operator[SEP] identifier[popBoolean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
|
public static long materialize(final IteratingRLW32 i, final BitmapStorage32 c, int max) {
final int origMax = max;
while (true) {
if (i.getRunningLength() > 0) {
int l = i.getRunningLength();
if (l > max)
l = max;
c.addStreamOfEmptyWords(i.getRunningBit(), l);
max -= l;
}
long L = i.getNumberOfLiteralWords();
for (int k = 0; k < L; ++k)
c.addWord(i.getLiteralWordAt(k));
if (max > 0) {
if (!i.next())
break;
} else
break;
}
return origMax - max;
} | class class_name[name] begin[{]
method[materialize, return_type[type[long]], modifier[public static], parameter[i, c, max]] begin[{]
local_variable[type[int], origMax]
while[literal[true]] begin[{]
if[binary_operation[call[i.getRunningLength, parameter[]], >, literal[0]]] begin[{]
local_variable[type[int], l]
if[binary_operation[member[.l], >, member[.max]]] begin[{]
assign[member[.l], member[.max]]
else begin[{]
None
end[}]
call[c.addStreamOfEmptyWords, parameter[call[i.getRunningBit, parameter[]], member[.l]]]
assign[member[.max], member[.l]]
else begin[{]
None
end[}]
local_variable[type[long], L]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLiteralWordAt, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None)], member=addWord, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=L, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.max], >, literal[0]]] begin[{]
if[call[i.next, parameter[]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
BreakStatement(goto=None, label=None)
end[}]
end[}]
return[binary_operation[member[.origMax], -, member[.max]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[long] identifier[materialize] operator[SEP] Keyword[final] identifier[IteratingRLW32] identifier[i] , Keyword[final] identifier[BitmapStorage32] identifier[c] , Keyword[int] identifier[max] operator[SEP] {
Keyword[final] Keyword[int] identifier[origMax] operator[=] identifier[max] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[SEP] identifier[getRunningLength] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[int] identifier[l] operator[=] identifier[i] operator[SEP] identifier[getRunningLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[>] identifier[max] operator[SEP] identifier[l] operator[=] identifier[max] operator[SEP] identifier[c] operator[SEP] identifier[addStreamOfEmptyWords] operator[SEP] identifier[i] operator[SEP] identifier[getRunningBit] operator[SEP] operator[SEP] , identifier[l] operator[SEP] operator[SEP] identifier[max] operator[-=] identifier[l] operator[SEP]
}
Keyword[long] identifier[L] operator[=] identifier[i] operator[SEP] identifier[getNumberOfLiteralWords] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[L] operator[SEP] operator[++] identifier[k] operator[SEP] identifier[c] operator[SEP] identifier[addWord] operator[SEP] identifier[i] operator[SEP] identifier[getLiteralWordAt] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[max] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[else] Keyword[break] operator[SEP]
}
Keyword[return] identifier[origMax] operator[-] identifier[max] operator[SEP]
}
|
public static <R> AsyncCallback<R> build(final AsyncCallbackOnSuccess<R> pcallbackOnSuccess,
final AsyncCallbackOnFailure pcallbackOnFailure) {
return new AsyncCallback<R>() {
@Override
public void onFailure(final Throwable pcaught) {
pcallbackOnFailure.onFailure(pcaught);
}
@Override
public void onSuccess(final R presult) {
pcallbackOnSuccess.onSuccess(presult);
}
};
} | class class_name[name] begin[{]
method[build, return_type[type[AsyncCallback]], modifier[public static], parameter[pcallbackOnSuccess, pcallbackOnFailure]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pcaught, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onFailure, postfix_operators=[], prefix_operators=[], qualifier=pcallbackOnFailure, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=pcaught, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=presult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onSuccess, postfix_operators=[], prefix_operators=[], qualifier=pcallbackOnSuccess, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=presult, type=ReferenceType(arguments=None, dimensions=[], name=R, 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=R, sub_type=None))], dimensions=None, name=AsyncCallback, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[R] operator[>] identifier[AsyncCallback] operator[<] identifier[R] operator[>] identifier[build] operator[SEP] Keyword[final] identifier[AsyncCallbackOnSuccess] operator[<] identifier[R] operator[>] identifier[pcallbackOnSuccess] , Keyword[final] identifier[AsyncCallbackOnFailure] identifier[pcallbackOnFailure] operator[SEP] {
Keyword[return] Keyword[new] identifier[AsyncCallback] operator[<] identifier[R] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] Keyword[final] identifier[Throwable] identifier[pcaught] operator[SEP] {
identifier[pcallbackOnFailure] operator[SEP] identifier[onFailure] operator[SEP] identifier[pcaught] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] Keyword[final] identifier[R] identifier[presult] operator[SEP] {
identifier[pcallbackOnSuccess] operator[SEP] identifier[onSuccess] operator[SEP] identifier[presult] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public static Menu get(final UUID _uuid)
throws CacheReloadException
{
return AbstractUserInterfaceObject.<Menu>get(_uuid, Menu.class, CIAdminUserInterface.Menu.getType());
} | class class_name[name] begin[{]
method[get, return_type[type[Menu]], modifier[public static], parameter[_uuid]] begin[{]
return[call[.AbstractUserInterfaceObject, parameter[member[._uuid], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Menu, sub_type=None)), call[CIAdminUserInterface.Menu.getType, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Menu] identifier[get] operator[SEP] Keyword[final] identifier[UUID] identifier[_uuid] operator[SEP] Keyword[throws] identifier[CacheReloadException] {
Keyword[return] identifier[AbstractUserInterfaceObject] operator[SEP] operator[<] identifier[Menu] operator[>] identifier[get] operator[SEP] identifier[_uuid] , identifier[Menu] operator[SEP] Keyword[class] , identifier[CIAdminUserInterface] operator[SEP] identifier[Menu] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public SqlInfo buildSqlInfo(BuildSource source) {
String valueText = XmlNodeHelper.getNodeAttrText(source.getNode(), ZealotConst.ATTR_VALUE);
String matchText = XmlNodeHelper.getNodeAttrText(source.getNode(), ZealotConst.ATTR_MATCH);
if (StringHelper.isBlank(matchText)) {
return this.doBuildSqlInfo(source, valueText);
} else {
/* 如果match匹配成功,则生成数据库sql条件和参数 */
Boolean isTrue = (Boolean) ParseHelper.parseExpressWithException(matchText, source.getParamObj());
if (isTrue) {
return this.doBuildSqlInfo(source, valueText);
}
}
return source.getSqlInfo();
} | class class_name[name] begin[{]
method[buildSqlInfo, return_type[type[SqlInfo]], modifier[public], parameter[source]] begin[{]
local_variable[type[String], valueText]
local_variable[type[String], matchText]
if[call[StringHelper.isBlank, parameter[member[.matchText]]]] begin[{]
return[THIS[call[None.doBuildSqlInfo, parameter[member[.source], member[.valueText]]]]]
else begin[{]
local_variable[type[Boolean], isTrue]
if[member[.isTrue]] begin[{]
return[THIS[call[None.doBuildSqlInfo, parameter[member[.source], member[.valueText]]]]]
else begin[{]
None
end[}]
end[}]
return[call[source.getSqlInfo, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SqlInfo] identifier[buildSqlInfo] operator[SEP] identifier[BuildSource] identifier[source] operator[SEP] {
identifier[String] identifier[valueText] operator[=] identifier[XmlNodeHelper] operator[SEP] identifier[getNodeAttrText] operator[SEP] identifier[source] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] , identifier[ZealotConst] operator[SEP] identifier[ATTR_VALUE] operator[SEP] operator[SEP] identifier[String] identifier[matchText] operator[=] identifier[XmlNodeHelper] operator[SEP] identifier[getNodeAttrText] operator[SEP] identifier[source] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] , identifier[ZealotConst] operator[SEP] identifier[ATTR_MATCH] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringHelper] operator[SEP] identifier[isBlank] operator[SEP] identifier[matchText] operator[SEP] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[doBuildSqlInfo] operator[SEP] identifier[source] , identifier[valueText] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Boolean] identifier[isTrue] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[ParseHelper] operator[SEP] identifier[parseExpressWithException] operator[SEP] identifier[matchText] , identifier[source] operator[SEP] identifier[getParamObj] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTrue] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[doBuildSqlInfo] operator[SEP] identifier[source] , identifier[valueText] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[source] operator[SEP] identifier[getSqlInfo] operator[SEP] operator[SEP] operator[SEP]
}
|
@RequestMapping("/refund")
public String refund(HttpServletRequest request){
Map<String, String> receives = new HashMap<>();
// TODO 这里还是建议直接从request中获取map参数,兼容支付宝修改或增减参数
for (AlipayField f : AlipayFields.REFUND_NOTIFY){
receives.put(f.field(), request.getParameter(f.field()));
}
logger.info("refund notify params: {}", receives);
if (!alipayService.notifyVerifyMd5(receives)){
System.out.println("refund sign verify failed");
return "FAIL";
}
// TODO business logic
logger.info("refund notify success");
return "SUCCESS";
} | class class_name[name] begin[{]
method[refund, return_type[type[String]], modifier[public], parameter[request]] begin[{]
local_variable[type[Map], receives]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=field, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=field, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=getParameter, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=receives, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=REFUND_NOTIFY, postfix_operators=[], prefix_operators=[], qualifier=AlipayFields, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AlipayField, sub_type=None))), label=None)
call[logger.info, parameter[literal["refund notify params: {}"], member[.receives]]]
if[call[alipayService.notifyVerifyMd5, parameter[member[.receives]]]] begin[{]
call[System.out.println, parameter[literal["refund sign verify failed"]]]
return[literal["FAIL"]]
else begin[{]
None
end[}]
call[logger.info, parameter[literal["refund notify success"]]]
return[literal["SUCCESS"]]
end[}]
END[}] | annotation[@] identifier[RequestMapping] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[String] identifier[refund] operator[SEP] identifier[HttpServletRequest] identifier[request] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[receives] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AlipayField] identifier[f] operator[:] identifier[AlipayFields] operator[SEP] identifier[REFUND_NOTIFY] operator[SEP] {
identifier[receives] operator[SEP] identifier[put] operator[SEP] identifier[f] operator[SEP] identifier[field] operator[SEP] operator[SEP] , identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[f] operator[SEP] identifier[field] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[receives] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[alipayService] operator[SEP] identifier[notifyVerifyMd5] operator[SEP] identifier[receives] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP]
}
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP]
}
|
public static Optional<String> trimStart(final String input) {
return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(Strman::leftTrim);
} | class class_name[name] begin[{]
method[trimStart, return_type[type[Optional]], modifier[public static], parameter[input]] begin[{]
return[call[Optional.ofNullable, parameter[member[.input]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[String] operator[>] identifier[trimStart] operator[SEP] Keyword[final] identifier[String] identifier[input] operator[SEP] {
Keyword[return] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[v] operator[->] operator[!] identifier[v] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Strman] operator[::] identifier[leftTrim] operator[SEP] operator[SEP]
}
|
public CorporationDivisionsResponse getCorporationsCorporationIdDivisions(Integer corporationId, String datasource,
String ifNoneMatch, String token) throws ApiException {
ApiResponse<CorporationDivisionsResponse> resp = getCorporationsCorporationIdDivisionsWithHttpInfo(
corporationId, datasource, ifNoneMatch, token);
return resp.getData();
} | class class_name[name] begin[{]
method[getCorporationsCorporationIdDivisions, return_type[type[CorporationDivisionsResponse]], modifier[public], parameter[corporationId, datasource, ifNoneMatch, token]] begin[{]
local_variable[type[ApiResponse], resp]
return[call[resp.getData, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[CorporationDivisionsResponse] identifier[getCorporationsCorporationIdDivisions] operator[SEP] identifier[Integer] identifier[corporationId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[ApiResponse] operator[<] identifier[CorporationDivisionsResponse] operator[>] identifier[resp] operator[=] identifier[getCorporationsCorporationIdDivisionsWithHttpInfo] operator[SEP] identifier[corporationId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[token] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected Future<Void> sendBinaryMessage(BinaryMessage message) {
return getNativeSession().getAsyncRemote().sendBinary(message.getPayload());
} | class class_name[name] begin[{]
method[sendBinaryMessage, return_type[type[Future]], modifier[protected], parameter[message]] begin[{]
return[call[.getNativeSession, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[Future] operator[<] identifier[Void] operator[>] identifier[sendBinaryMessage] operator[SEP] identifier[BinaryMessage] identifier[message] operator[SEP] {
Keyword[return] identifier[getNativeSession] operator[SEP] operator[SEP] operator[SEP] identifier[getAsyncRemote] operator[SEP] operator[SEP] operator[SEP] identifier[sendBinary] operator[SEP] identifier[message] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException {
/* See http://prometheus.io/docs/instrumenting/exposition_formats/
* for the output format specification. */
while(mfs.hasMoreElements()) {
Collector.MetricFamilySamples metricFamilySamples = mfs.nextElement();
writer.write("# HELP ");
writer.write(metricFamilySamples.name);
writer.write(' ');
writeEscapedHelp(writer, metricFamilySamples.help);
writer.write('\n');
writer.write("# TYPE ");
writer.write(metricFamilySamples.name);
writer.write(' ');
writer.write(typeString(metricFamilySamples.type));
writer.write('\n');
for (Collector.MetricFamilySamples.Sample sample: metricFamilySamples.samples) {
writer.write(sample.name);
if (sample.labelNames.size() > 0) {
writer.write('{');
for (int i = 0; i < sample.labelNames.size(); ++i) {
writer.write(sample.labelNames.get(i));
writer.write("=\"");
writeEscapedLabelValue(writer, sample.labelValues.get(i));
writer.write("\",");
}
writer.write('}');
}
writer.write(' ');
writer.write(Collector.doubleToGoString(sample.value));
if (sample.timestampMs != null){
writer.write(' ');
writer.write(sample.timestampMs.toString());
}
writer.write('\n');
}
}
} | class class_name[name] begin[{]
method[write004, return_type[void], modifier[public static], parameter[writer, mfs]] begin[{]
while[call[mfs.hasMoreElements, parameter[]]] begin[{]
local_variable[type[Collector], metricFamilySamples]
call[writer.write, parameter[literal["# HELP "]]]
call[writer.write, parameter[member[metricFamilySamples.name]]]
call[writer.write, parameter[literal[' ']]]
call[.writeEscapedHelp, parameter[member[.writer], member[metricFamilySamples.help]]]
call[writer.write, parameter[literal['\n']]]
call[writer.write, parameter[literal["# TYPE "]]]
call[writer.write, parameter[member[metricFamilySamples.name]]]
call[writer.write, parameter[literal[' ']]]
call[writer.write, parameter[call[.typeString, parameter[member[metricFamilySamples.type]]]]]
call[writer.write, parameter[literal['\n']]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=sample, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sample.labelNames, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=sample.labelNames, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=\"")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=sample.labelValues, selectors=[], type_arguments=None)], member=writeEscapedLabelValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\",")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sample.labelNames, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='}')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=sample, selectors=[])], member=doubleToGoString, postfix_operators=[], prefix_operators=[], qualifier=Collector, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=timestampMs, postfix_operators=[], prefix_operators=[], qualifier=sample, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sample.timestampMs, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=samples, postfix_operators=[], prefix_operators=[], qualifier=metricFamilySamples, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sample)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Collector, sub_type=ReferenceType(arguments=None, dimensions=None, name=MetricFamilySamples, sub_type=ReferenceType(arguments=None, dimensions=None, name=Sample, sub_type=None))))), label=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[write004] operator[SEP] identifier[Writer] identifier[writer] , identifier[Enumeration] operator[<] identifier[Collector] operator[SEP] identifier[MetricFamilySamples] operator[>] identifier[mfs] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[while] operator[SEP] identifier[mfs] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[Collector] operator[SEP] identifier[MetricFamilySamples] identifier[metricFamilySamples] operator[=] identifier[mfs] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[metricFamilySamples] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writeEscapedHelp] operator[SEP] identifier[writer] , identifier[metricFamilySamples] operator[SEP] identifier[help] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[metricFamilySamples] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[typeString] operator[SEP] identifier[metricFamilySamples] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Collector] operator[SEP] identifier[MetricFamilySamples] operator[SEP] identifier[Sample] identifier[sample] operator[:] identifier[metricFamilySamples] operator[SEP] identifier[samples] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[sample] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sample] operator[SEP] identifier[labelNames] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[sample] operator[SEP] identifier[labelNames] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[sample] operator[SEP] identifier[labelNames] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writeEscapedLabelValue] operator[SEP] identifier[writer] , identifier[sample] operator[SEP] identifier[labelValues] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[Collector] operator[SEP] identifier[doubleToGoString] operator[SEP] identifier[sample] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sample] operator[SEP] identifier[timestampMs] operator[!=] Other[null] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[sample] operator[SEP] identifier[timestampMs] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
|
@Override
public void onClickConfirmButton() {
/*
* Workaround to fix the crash:
* android.view.WindowManager$BadTokenException: Unable to add window
* android.view.ViewRootImpl$W@3d67307 -- permission denied for this window type
* that appears only on Android 6.0 Marshmallow or greater.
* See onActivityResult in this class!!!
*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + getPackageName()));
Log.d(TAG, "canDrawOverlay not enabled. Requesting... ");
startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
}
} | class class_name[name] begin[{]
method[onClickConfirmButton, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[member[Build.VERSION.SDK_INT], >=, member[Build.VERSION_CODES.M]], &&, call[Settings.canDrawOverlays, parameter[THIS[]]]]] begin[{]
local_variable[type[Intent], intent]
call[Log.d, parameter[member[.TAG], literal["canDrawOverlay not enabled. Requesting... "]]]
call[.startActivityForResult, parameter[member[.intent], member[.OVERLAY_PERMISSION_REQ_CODE]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onClickConfirmButton] operator[SEP] 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[&&] operator[!] identifier[Settings] operator[SEP] identifier[canDrawOverlays] operator[SEP] Keyword[this] operator[SEP] operator[SEP] {
identifier[Intent] identifier[intent] operator[=] Keyword[new] identifier[Intent] operator[SEP] identifier[Settings] operator[SEP] identifier[ACTION_MANAGE_OVERLAY_PERMISSION] , identifier[Uri] operator[SEP] identifier[parse] operator[SEP] literal[String] operator[+] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] identifier[startActivityForResult] operator[SEP] identifier[intent] , identifier[OVERLAY_PERMISSION_REQ_CODE] operator[SEP] operator[SEP]
}
}
|
public static boolean includeNamed(final ServletContext context, final ServletRequest request, final ServletResponse response, final String page) throws IOException, ServletException {
RequestDispatcher dispatcher = context.getNamedDispatcher(page);
if (dispatcher != null) {
dispatcher.include(request, response);
return true;
}
return false;
} | class class_name[name] begin[{]
method[includeNamed, return_type[type[boolean]], modifier[public static], parameter[context, request, response, page]] begin[{]
local_variable[type[RequestDispatcher], dispatcher]
if[binary_operation[member[.dispatcher], !=, literal[null]]] begin[{]
call[dispatcher.include, parameter[member[.request], member[.response]]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[includeNamed] operator[SEP] Keyword[final] identifier[ServletContext] identifier[context] , Keyword[final] identifier[ServletRequest] identifier[request] , Keyword[final] identifier[ServletResponse] identifier[response] , Keyword[final] identifier[String] identifier[page] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] {
identifier[RequestDispatcher] identifier[dispatcher] operator[=] identifier[context] operator[SEP] identifier[getNamedDispatcher] operator[SEP] identifier[page] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dispatcher] operator[!=] Other[null] operator[SEP] {
identifier[dispatcher] operator[SEP] identifier[include] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public long setMaximumSize(long numBytes) {
long pageSize = getPageSize();
long numPages = numBytes / pageSize;
// If numBytes isn't a multiple of pageSize, bump up a page
if ((numBytes % pageSize) != 0) {
numPages++;
}
long newPageCount = DatabaseUtils.longForQuery(this, "PRAGMA max_page_count = " + numPages,
null);
return newPageCount * pageSize;
} | class class_name[name] begin[{]
method[setMaximumSize, return_type[type[long]], modifier[public], parameter[numBytes]] begin[{]
local_variable[type[long], pageSize]
local_variable[type[long], numPages]
if[binary_operation[binary_operation[member[.numBytes], %, member[.pageSize]], !=, literal[0]]] begin[{]
member[.numPages]
else begin[{]
None
end[}]
local_variable[type[long], newPageCount]
return[binary_operation[member[.newPageCount], *, member[.pageSize]]]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[setMaximumSize] operator[SEP] Keyword[long] identifier[numBytes] operator[SEP] {
Keyword[long] identifier[pageSize] operator[=] identifier[getPageSize] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[numPages] operator[=] identifier[numBytes] operator[/] identifier[pageSize] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[numBytes] operator[%] identifier[pageSize] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[numPages] operator[++] operator[SEP]
}
Keyword[long] identifier[newPageCount] operator[=] identifier[DatabaseUtils] operator[SEP] identifier[longForQuery] operator[SEP] Keyword[this] , literal[String] operator[+] identifier[numPages] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[newPageCount] operator[*] identifier[pageSize] operator[SEP]
}
|
@Override
public UpdateProfileResult updateProfile(UpdateProfileRequest request) {
request = beforeClientExecution(request);
return executeUpdateProfile(request);
} | class class_name[name] begin[{]
method[updateProfile, return_type[type[UpdateProfileResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeUpdateProfile, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[UpdateProfileResult] identifier[updateProfile] operator[SEP] identifier[UpdateProfileRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateProfile] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static void copyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException {
if (srcFile == null) {
throw new IllegalArgumentException("Source must not be null");
}
if (destFile == null) {
throw new IllegalArgumentException("Destination must not be null");
}
if (srcFile.exists() == false) {
throw new FileNotFoundException("Source '" + srcFile + "' does not exist");
}
if (srcFile.isDirectory()) {
throw new IOException("Source '" + srcFile + "' exists but is a directory");
}
if (srcFile.getCanonicalPath().equals(destFile.getCanonicalPath())) {
throw new IOException("Source '" + srcFile + "' and destination '" + destFile + "' are the same");
}
if (destFile.getParentFile() != null && destFile.getParentFile().exists() == false) {
if (destFile.getParentFile().mkdirs() == false) {
throw new IOException("Destination '" + destFile + "' directory cannot be created");
}
}
if (destFile.exists() && destFile.canWrite() == false) {
throw new IOException("Destination '" + destFile + "' exists but is read-only");
}
doCopyFile(srcFile, destFile, preserveFileDate);
} | class class_name[name] begin[{]
method[copyFile, return_type[void], modifier[public static], parameter[srcFile, destFile, preserveFileDate]] begin[{]
if[binary_operation[member[.srcFile], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source must not be null")], 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[}]
if[binary_operation[member[.destFile], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination must not be null")], 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[}]
if[binary_operation[call[srcFile.exists, parameter[]], ==, literal[false]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source '"), operandr=MemberReference(member=srcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' does not exist"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileNotFoundException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[srcFile.isDirectory, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source '"), operandr=MemberReference(member=srcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' exists but is a directory"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[srcFile.getCanonicalPath, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source '"), operandr=MemberReference(member=srcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' and destination '"), operator=+), operandr=MemberReference(member=destFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' are the same"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[destFile.getParentFile, parameter[]], !=, literal[null]], &&, binary_operation[call[destFile.getParentFile, parameter[]], ==, literal[false]]]] begin[{]
if[binary_operation[call[destFile.getParentFile, parameter[]], ==, literal[false]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination '"), operandr=MemberReference(member=destFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' directory cannot be created"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[call[destFile.exists, parameter[]], &&, binary_operation[call[destFile.canWrite, parameter[]], ==, literal[false]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination '"), operandr=MemberReference(member=destFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' exists but is read-only"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.doCopyFile, parameter[member[.srcFile], member[.destFile], member[.preserveFileDate]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[copyFile] operator[SEP] identifier[File] identifier[srcFile] , identifier[File] identifier[destFile] , Keyword[boolean] identifier[preserveFileDate] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[srcFile] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[destFile] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[srcFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[throw] Keyword[new] identifier[FileNotFoundException] operator[SEP] literal[String] operator[+] identifier[srcFile] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[srcFile] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[srcFile] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[srcFile] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[destFile] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[srcFile] operator[+] literal[String] operator[+] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[destFile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[destFile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] identifier[destFile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[destFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[destFile] operator[SEP] identifier[canWrite] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[doCopyFile] operator[SEP] identifier[srcFile] , identifier[destFile] , identifier[preserveFileDate] operator[SEP] operator[SEP]
}
|
public static void enableHost(String hostName) throws Exception {
Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);
impl.enableHost(hostName);
} | class class_name[name] begin[{]
method[enableHost, return_type[void], modifier[public static], parameter[hostName]] begin[{]
local_variable[type[Registry], myRegistry]
local_variable[type[com], impl]
call[impl.enableHost, parameter[member[.hostName]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[enableHost] operator[SEP] identifier[String] identifier[hostName] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[Registry] identifier[myRegistry] operator[=] identifier[LocateRegistry] operator[SEP] identifier[getRegistry] operator[SEP] literal[String] , identifier[port] operator[SEP] operator[SEP] identifier[com] operator[SEP] identifier[groupon] operator[SEP] identifier[odo] operator[SEP] identifier[proxylib] operator[SEP] identifier[hostsedit] operator[SEP] identifier[rmi] operator[SEP] identifier[Message] identifier[impl] operator[=] operator[SEP] identifier[com] operator[SEP] identifier[groupon] operator[SEP] identifier[odo] operator[SEP] identifier[proxylib] operator[SEP] identifier[hostsedit] operator[SEP] identifier[rmi] operator[SEP] identifier[Message] operator[SEP] identifier[myRegistry] operator[SEP] identifier[lookup] operator[SEP] identifier[SERVICE_NAME] operator[SEP] operator[SEP] identifier[impl] operator[SEP] identifier[enableHost] operator[SEP] identifier[hostName] operator[SEP] operator[SEP]
}
|
public void doTable(FitTable table) {
copyParamsToFixture();
try {
setUp();
try {
doRows(table.rows());
} catch (Exception e) {
table.exception(e);
}
tearDown();
} catch (final Exception e) {
table.exception(e);
}
table.finishExecution();
} | class class_name[name] begin[{]
method[doTable, return_type[void], modifier[public], parameter[table]] begin[{]
call[.copyParamsToFixture, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=setUp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rows, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=doRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=table, 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), StatementExpression(expression=MethodInvocation(arguments=[], member=tearDown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=table, 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)
call[table.finishExecution, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[doTable] operator[SEP] identifier[FitTable] identifier[table] operator[SEP] {
identifier[copyParamsToFixture] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[setUp] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[doRows] operator[SEP] identifier[table] operator[SEP] identifier[rows] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[table] operator[SEP] identifier[exception] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
identifier[tearDown] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] {
identifier[table] operator[SEP] identifier[exception] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
identifier[table] operator[SEP] identifier[finishExecution] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <E> E parse(String jsonString, ParameterizedType<E> jsonObjectType) throws IOException {
return mapperFor(jsonObjectType).parse(jsonString);
} | class class_name[name] begin[{]
method[parse, return_type[type[E]], modifier[public static], parameter[jsonString, jsonObjectType]] begin[{]
return[call[.mapperFor, parameter[member[.jsonObjectType]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[E] identifier[parse] operator[SEP] identifier[String] identifier[jsonString] , identifier[ParameterizedType] operator[<] identifier[E] operator[>] identifier[jsonObjectType] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[mapperFor] operator[SEP] identifier[jsonObjectType] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[jsonString] operator[SEP] operator[SEP]
}
|
@Override
public String getNameHtml() {
String nameHtml = personRenderer.getNameHtml();
if (nameHtml == null || nameHtml.equals("")) {
nameHtml = " ";
}
return "<table class=\"bbox\"><tr><td class=\"tree bbox\">"
+ nameHtml + "</td></tr></table>";
} | class class_name[name] begin[{]
method[getNameHtml, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[String], nameHtml]
if[binary_operation[binary_operation[member[.nameHtml], ==, literal[null]], ||, call[nameHtml.equals, parameter[literal[""]]]]] begin[{]
assign[member[.nameHtml], literal[" "]]
else begin[{]
None
end[}]
return[binary_operation[binary_operation[literal["<table class=\"bbox\"><tr><td class=\"tree bbox\">"], +, member[.nameHtml]], +, literal["</td></tr></table>"]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getNameHtml] operator[SEP] operator[SEP] {
identifier[String] identifier[nameHtml] operator[=] identifier[personRenderer] operator[SEP] identifier[getNameHtml] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nameHtml] operator[==] Other[null] operator[||] identifier[nameHtml] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[nameHtml] operator[=] literal[String] operator[SEP]
}
Keyword[return] literal[String] operator[+] identifier[nameHtml] operator[+] literal[String] operator[SEP]
}
|
public static ConditionEvaluationReport get(
ConfigurableListableBeanFactory beanFactory) {
synchronized (beanFactory) {
ConditionEvaluationReport report;
if (beanFactory.containsSingleton(BEAN_NAME)) {
report = beanFactory.getBean(BEAN_NAME, ConditionEvaluationReport.class);
}
else {
report = new ConditionEvaluationReport();
beanFactory.registerSingleton(BEAN_NAME, report);
}
locateParent(beanFactory.getParentBeanFactory(), report);
return report;
}
} | class class_name[name] begin[{]
method[get, return_type[type[ConditionEvaluationReport]], modifier[public static], parameter[beanFactory]] begin[{]
SYNCHRONIZED[member[.beanFactory]] BEGIN[{]
local_variable[type[ConditionEvaluationReport], report]
if[call[beanFactory.containsSingleton, parameter[member[.BEAN_NAME]]]] begin[{]
assign[member[.report], call[beanFactory.getBean, parameter[member[.BEAN_NAME], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConditionEvaluationReport, sub_type=None))]]]
else begin[{]
assign[member[.report], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConditionEvaluationReport, sub_type=None))]
call[beanFactory.registerSingleton, parameter[member[.BEAN_NAME], member[.report]]]
end[}]
call[.locateParent, parameter[call[beanFactory.getParentBeanFactory, parameter[]], member[.report]]]
return[member[.report]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ConditionEvaluationReport] identifier[get] operator[SEP] identifier[ConfigurableListableBeanFactory] identifier[beanFactory] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[beanFactory] operator[SEP] {
identifier[ConditionEvaluationReport] identifier[report] operator[SEP] Keyword[if] operator[SEP] identifier[beanFactory] operator[SEP] identifier[containsSingleton] operator[SEP] identifier[BEAN_NAME] operator[SEP] operator[SEP] {
identifier[report] operator[=] identifier[beanFactory] operator[SEP] identifier[getBean] operator[SEP] identifier[BEAN_NAME] , identifier[ConditionEvaluationReport] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[report] operator[=] Keyword[new] identifier[ConditionEvaluationReport] operator[SEP] operator[SEP] operator[SEP] identifier[beanFactory] operator[SEP] identifier[registerSingleton] operator[SEP] identifier[BEAN_NAME] , identifier[report] operator[SEP] operator[SEP]
}
identifier[locateParent] operator[SEP] identifier[beanFactory] operator[SEP] identifier[getParentBeanFactory] operator[SEP] operator[SEP] , identifier[report] operator[SEP] operator[SEP] Keyword[return] identifier[report] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.