code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public PhotoList<Photo> search(SearchParameters params, int perPage, int page) throws FlickrException {
PhotoList<Photo> photos = new PhotoList<Photo>();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_SEARCH);
parameters.putAll(params.getAsParameters());
if (perPage > 0) {
parameters.put("per_page", "" + perPage);
}
if (page > 0) {
parameters.put("page", "" + page);
}
Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret);
if (response.isError()) {
throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
}
Element photosElement = response.getPayload();
photos.setPage(photosElement.getAttribute("page"));
photos.setPages(photosElement.getAttribute("pages"));
photos.setPerPage(photosElement.getAttribute("perpage"));
photos.setTotal(photosElement.getAttribute("total"));
NodeList photoNodes = photosElement.getElementsByTagName("photo");
for (int i = 0; i < photoNodes.getLength(); i++) {
Element photoElement = (Element) photoNodes.item(i);
photos.add(PhotoUtils.createPhoto(photoElement));
}
return photos;
} | class class_name[name] begin[{]
method[search, return_type[type[PhotoList]], modifier[public], parameter[params, perPage, page]] begin[{]
local_variable[type[PhotoList], photos]
local_variable[type[Map], parameters]
call[parameters.put, parameter[literal["method"], member[.METHOD_SEARCH]]]
call[parameters.putAll, parameter[call[params.getAsParameters, parameter[]]]]
if[binary_operation[member[.perPage], >, literal[0]]] begin[{]
call[parameters.put, parameter[literal["per_page"], binary_operation[literal[""], +, member[.perPage]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.page], >, literal[0]]] begin[{]
call[parameters.put, parameter[literal["page"], binary_operation[literal[""], +, member[.page]]]]
else begin[{]
None
end[}]
local_variable[type[Response], response]
if[call[response.isError, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getErrorCode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FlickrException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Element], photosElement]
call[photos.setPage, parameter[call[photosElement.getAttribute, parameter[literal["page"]]]]]
call[photos.setPages, parameter[call[photosElement.getAttribute, parameter[literal["pages"]]]]]
call[photos.setPerPage, parameter[call[photosElement.getAttribute, parameter[literal["perpage"]]]]]
call[photos.setTotal, parameter[call[photosElement.getAttribute, parameter[literal["total"]]]]]
local_variable[type[NodeList], photoNodes]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=photoNodes, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=photoElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=photoElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createPhoto, postfix_operators=[], prefix_operators=[], qualifier=PhotoUtils, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=photos, 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=photoNodes, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.photos]]
end[}]
END[}] | Keyword[public] identifier[PhotoList] operator[<] identifier[Photo] operator[>] identifier[search] operator[SEP] identifier[SearchParameters] identifier[params] , Keyword[int] identifier[perPage] , Keyword[int] identifier[page] operator[SEP] Keyword[throws] identifier[FlickrException] {
identifier[PhotoList] operator[<] identifier[Photo] operator[>] identifier[photos] operator[=] Keyword[new] identifier[PhotoList] operator[<] identifier[Photo] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[METHOD_SEARCH] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[putAll] operator[SEP] identifier[params] operator[SEP] identifier[getAsParameters] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[perPage] operator[>] Other[0] operator[SEP] {
identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[+] identifier[perPage] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[page] operator[>] Other[0] operator[SEP] {
identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[+] identifier[page] operator[SEP] operator[SEP]
}
identifier[Response] identifier[response] operator[=] identifier[transport] operator[SEP] identifier[get] operator[SEP] identifier[transport] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[parameters] , identifier[apiKey] , identifier[sharedSecret] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[FlickrException] operator[SEP] identifier[response] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] , identifier[response] operator[SEP] identifier[getErrorMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Element] identifier[photosElement] operator[=] identifier[response] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPage] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPages] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPerPage] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setTotal] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[photoNodes] operator[=] identifier[photosElement] operator[SEP] identifier[getElementsByTagName] 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[photoNodes] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Element] identifier[photoElement] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[photoNodes] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[add] operator[SEP] identifier[PhotoUtils] operator[SEP] identifier[createPhoto] operator[SEP] identifier[photoElement] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[photos] operator[SEP]
}
|
public static JSONArray monitorForHA() {
Map<String, Cache> CACHE = Redis.unmodifiableCache();
JSONArray monitors = new JSONArray();
if (CACHE == null || CACHE.isEmpty())
return monitors;
JSONObject monitor = new JSONObject();
monitor.put("application", EnvUtil.getApplication());
monitor.put("nodeId", LocalNodeManager.LOCAL_NODE_ID);
for (Map.Entry<String, Cache> entry : CACHE.entrySet()) {
Cache cache = entry.getValue();
if (cache == null)
continue;
try {
monitor.put("instance", cache.getName());
monitors.add(new JSONObject() {{
putAll(monitor);
put("value", cache.highAvailable() ? 1 : -1);
put("name", "HA");
}});
} catch (Exception e) {
LOG.error(String.format("Jedis Pool: %s (Grafana) monitor 出现异常", entry.getKey()), e);
}
}
return monitors;
} | class class_name[name] begin[{]
method[monitorForHA, return_type[type[JSONArray]], modifier[public static], parameter[]] begin[{]
local_variable[type[Map], CACHE]
local_variable[type[JSONArray], monitors]
if[binary_operation[binary_operation[member[.CACHE], ==, literal[null]], ||, call[CACHE.isEmpty, parameter[]]]] begin[{]
return[member[.monitors]]
else begin[{]
None
end[}]
local_variable[type[JSONObject], monitor]
call[monitor.put, parameter[literal["application"], call[EnvUtil.getApplication, parameter[]]]]
call[monitor.put, parameter[literal["nodeId"], member[LocalNodeManager.LOCAL_NODE_ID]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=cache)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cache, 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=ContinueStatement(goto=None, label=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="instance"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=monitor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=monitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value"), TernaryExpression(condition=MethodInvocation(arguments=[], member=highAvailable, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HA")], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONObject, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=monitors, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Jedis Pool: %s (Grafana) monitor 出现异常"), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=CACHE, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[member[.monitors]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[JSONArray] identifier[monitorForHA] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Cache] operator[>] identifier[CACHE] operator[=] identifier[Redis] operator[SEP] identifier[unmodifiableCache] operator[SEP] operator[SEP] operator[SEP] identifier[JSONArray] identifier[monitors] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CACHE] operator[==] Other[null] operator[||] identifier[CACHE] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[monitors] operator[SEP] identifier[JSONObject] identifier[monitor] operator[=] Keyword[new] identifier[JSONObject] operator[SEP] operator[SEP] operator[SEP] identifier[monitor] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[EnvUtil] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[monitor] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[LocalNodeManager] operator[SEP] identifier[LOCAL_NODE_ID] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Cache] operator[>] identifier[entry] operator[:] identifier[CACHE] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Cache] identifier[cache] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cache] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[try] {
identifier[monitor] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[cache] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[monitors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[JSONObject] operator[SEP] operator[SEP] {
{
identifier[putAll] operator[SEP] identifier[monitor] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[cache] operator[SEP] identifier[highAvailable] operator[SEP] operator[SEP] operator[?] Other[1] operator[:] operator[-] Other[1] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[monitors] operator[SEP]
}
|
DatabaseSession readPrimitives(String id, String appName, Connection con) throws SQLException {
PreparedStatement ps = null;
ResultSet rs = null;
DatabaseSession sess = null;
try {
if (usingDB2 || usingDerby) {
ps = con.prepareStatement(readPrimitiveDataDb2);
} else {
ps = con.prepareStatement(readPrimitiveData);
}
ps.setString(1, id);
ps.setString(2, id);
ps.setString(3, appName);
rs = ps.executeQuery();
if (rs.next()) {
sess = new DatabaseSession(this, id, ((DatabaseStore) getIStore()).getStoreCallback());
long lastaccess = rs.getLong(1);
long createTime = rs.getLong(2);
int maxInact = rs.getInt(3);
String userName = rs.getString(4);
short listenerflag = rs.getShort(5);
sess.updateLastAccessTime(lastaccess);
sess.setCreationTime(createTime);
sess.internalSetMaxInactive(maxInact);
sess.internalSetUser(userName);
sess.setIsValid(true);
sess.setListenerFlag(listenerflag);
}
} finally {
if (rs != null)
closeResultSet(rs);
if (ps != null)
closeStatement(ps);
}
return sess;
} | class class_name[name] begin[{]
method[readPrimitives, return_type[type[DatabaseSession]], modifier[default], parameter[id, appName, con]] begin[{]
local_variable[type[PreparedStatement], ps]
local_variable[type[ResultSet], rs]
local_variable[type[DatabaseSession], sess]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=usingDB2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=usingDerby, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=readPrimitiveData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=con, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=readPrimitiveDataDb2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=con, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=appName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=getIStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DatabaseStore, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseSession, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=lastaccess)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=createTime)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=maxInact)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=getString, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=userName)], 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=5)], member=getShort, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=listenerflag)], modifiers=set(), type=BasicType(dimensions=[], name=short)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lastaccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateLastAccessTime, postfix_operators=[], prefix_operators=[], qualifier=sess, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=createTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCreationTime, postfix_operators=[], prefix_operators=[], qualifier=sess, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=maxInact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=internalSetMaxInactive, postfix_operators=[], prefix_operators=[], qualifier=sess, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=userName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=internalSetUser, postfix_operators=[], prefix_operators=[], qualifier=sess, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setIsValid, postfix_operators=[], prefix_operators=[], qualifier=sess, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=listenerflag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setListenerFlag, postfix_operators=[], prefix_operators=[], qualifier=sess, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeResultSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None))], label=None, resources=None)
return[member[.sess]]
end[}]
END[}] | identifier[DatabaseSession] identifier[readPrimitives] operator[SEP] identifier[String] identifier[id] , identifier[String] identifier[appName] , identifier[Connection] identifier[con] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[PreparedStatement] identifier[ps] operator[=] Other[null] operator[SEP] identifier[ResultSet] identifier[rs] operator[=] Other[null] operator[SEP] identifier[DatabaseSession] identifier[sess] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[usingDB2] operator[||] identifier[usingDerby] operator[SEP] {
identifier[ps] operator[=] identifier[con] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[readPrimitiveDataDb2] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ps] operator[=] identifier[con] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[readPrimitiveData] operator[SEP] operator[SEP]
}
identifier[ps] operator[SEP] identifier[setString] operator[SEP] Other[1] , identifier[id] operator[SEP] operator[SEP] identifier[ps] operator[SEP] identifier[setString] operator[SEP] Other[2] , identifier[id] operator[SEP] operator[SEP] identifier[ps] operator[SEP] identifier[setString] operator[SEP] Other[3] , identifier[appName] operator[SEP] operator[SEP] identifier[rs] operator[=] identifier[ps] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
identifier[sess] operator[=] Keyword[new] identifier[DatabaseSession] operator[SEP] Keyword[this] , identifier[id] , operator[SEP] operator[SEP] identifier[DatabaseStore] operator[SEP] identifier[getIStore] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getStoreCallback] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[lastaccess] operator[=] identifier[rs] operator[SEP] identifier[getLong] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[long] identifier[createTime] operator[=] identifier[rs] operator[SEP] identifier[getLong] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[maxInact] operator[=] identifier[rs] operator[SEP] identifier[getInt] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[String] identifier[userName] operator[=] identifier[rs] operator[SEP] identifier[getString] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[short] identifier[listenerflag] operator[=] identifier[rs] operator[SEP] identifier[getShort] operator[SEP] Other[5] operator[SEP] operator[SEP] identifier[sess] operator[SEP] identifier[updateLastAccessTime] operator[SEP] identifier[lastaccess] operator[SEP] operator[SEP] identifier[sess] operator[SEP] identifier[setCreationTime] operator[SEP] identifier[createTime] operator[SEP] operator[SEP] identifier[sess] operator[SEP] identifier[internalSetMaxInactive] operator[SEP] identifier[maxInact] operator[SEP] operator[SEP] identifier[sess] operator[SEP] identifier[internalSetUser] operator[SEP] identifier[userName] operator[SEP] operator[SEP] identifier[sess] operator[SEP] identifier[setIsValid] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[sess] operator[SEP] identifier[setListenerFlag] operator[SEP] identifier[listenerflag] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[rs] operator[!=] Other[null] operator[SEP] identifier[closeResultSet] operator[SEP] identifier[rs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ps] operator[!=] Other[null] operator[SEP] identifier[closeStatement] operator[SEP] identifier[ps] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sess] operator[SEP]
}
|
private void setExcludeFromProxyUrls() {
List<String> fullList = new ArrayList<>();
fullList.addAll(this.excludeFromProxyRegexs);
fullList.addAll(getGlobalExcludeURLRegexs());
Control.getSingleton().setExcludeFromProxyUrls(fullList);
} | class class_name[name] begin[{]
method[setExcludeFromProxyUrls, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[List], fullList]
call[fullList.addAll, parameter[THIS[member[None.excludeFromProxyRegexs]]]]
call[fullList.addAll, parameter[call[.getGlobalExcludeURLRegexs, parameter[]]]]
call[Control.getSingleton, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[setExcludeFromProxyUrls] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[fullList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[fullList] operator[SEP] identifier[addAll] operator[SEP] Keyword[this] operator[SEP] identifier[excludeFromProxyRegexs] operator[SEP] operator[SEP] identifier[fullList] operator[SEP] identifier[addAll] operator[SEP] identifier[getGlobalExcludeURLRegexs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Control] operator[SEP] identifier[getSingleton] operator[SEP] operator[SEP] operator[SEP] identifier[setExcludeFromProxyUrls] operator[SEP] identifier[fullList] operator[SEP] operator[SEP]
}
|
public com.google.api.ads.admanager.axis.v201902.BaseAdRuleSlot getMidroll() {
return midroll;
} | class class_name[name] begin[{]
method[getMidroll, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.midroll]]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201902] operator[SEP] identifier[BaseAdRuleSlot] identifier[getMidroll] operator[SEP] operator[SEP] {
Keyword[return] identifier[midroll] operator[SEP]
}
|
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Override
public String getMessageToClient(@FormParam(Constants.Message.MFC) String json) {
HttpSession httpSession = getHttpSession();
setContext(httpSession);
MessageFromClient message = MessageFromClient.createFromJson(json);
MessageToClient mtc = getMessageToClientService().createMessageToClient(message, httpSession);
return mtc.toJson();
} | class class_name[name] begin[{]
method[getMessageToClient, return_type[type[String]], modifier[public], parameter[json]] begin[{]
local_variable[type[HttpSession], httpSession]
call[.setContext, parameter[member[.httpSession]]]
local_variable[type[MessageFromClient], message]
local_variable[type[MessageToClient], mtc]
return[call[mtc.toJson, parameter[]]]
end[}]
END[}] | annotation[@] identifier[POST] annotation[@] identifier[Produces] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] annotation[@] identifier[Consumes] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_FORM_URLENCODED] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getMessageToClient] operator[SEP] annotation[@] identifier[FormParam] operator[SEP] identifier[Constants] operator[SEP] identifier[Message] operator[SEP] identifier[MFC] operator[SEP] identifier[String] identifier[json] operator[SEP] {
identifier[HttpSession] identifier[httpSession] operator[=] identifier[getHttpSession] operator[SEP] operator[SEP] operator[SEP] identifier[setContext] operator[SEP] identifier[httpSession] operator[SEP] operator[SEP] identifier[MessageFromClient] identifier[message] operator[=] identifier[MessageFromClient] operator[SEP] identifier[createFromJson] operator[SEP] identifier[json] operator[SEP] operator[SEP] identifier[MessageToClient] identifier[mtc] operator[=] identifier[getMessageToClientService] operator[SEP] operator[SEP] operator[SEP] identifier[createMessageToClient] operator[SEP] identifier[message] , identifier[httpSession] operator[SEP] operator[SEP] Keyword[return] identifier[mtc] operator[SEP] identifier[toJson] operator[SEP] operator[SEP] operator[SEP]
}
|
private FlowScope traverseDestructuringPatternHelper(
Node pattern, FlowScope scope, JSType patternType, TypeDeclaringCallback declarer) {
checkArgument(pattern.isDestructuringPattern(), pattern);
checkNotNull(patternType);
for (DestructuredTarget target :
DestructuredTarget.createAllNonEmptyTargetsInPattern(registry, patternType, pattern)) {
// The computed property is always evaluated first.
if (target.hasComputedProperty()) {
scope = traverse(target.getComputedProperty().getFirstChild(), scope);
}
Node targetNode = target.getNode();
if (targetNode.isDestructuringPattern()) {
if (target.hasDefaultValue()) {
traverse(target.getDefaultValue(), scope);
}
// traverse into nested patterns
JSType targetType = target.inferType();
targetType = targetType != null ? targetType : getNativeType(UNKNOWN_TYPE);
scope = traverseDestructuringPatternHelper(targetNode, scope, targetType, declarer);
} else {
scope = traverse(targetNode, scope);
if (target.hasDefaultValue()) {
// TODO(lharker): what do we do with the inferred slots in the scope?
// throw them away or join them with the previous scope?
traverse(target.getDefaultValue(), scope);
}
// declare in the scope
scope = declarer.declareTypeInScope(scope, targetNode, target.inferType());
}
}
// put the `inferred type` of a pattern on it, to make it easier to do typechecking
pattern.setJSType(patternType);
return scope;
} | class class_name[name] begin[{]
method[traverseDestructuringPatternHelper, return_type[type[FlowScope]], modifier[private], parameter[pattern, scope, patternType, declarer]] begin[{]
call[.checkArgument, parameter[call[pattern.isDestructuringPattern, parameter[]], member[.pattern]]]
call[.checkNotNull, parameter[member[.patternType]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=hasComputedProperty, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getComputedProperty, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[MethodInvocation(arguments=[], member=getFirstChild, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), name=targetNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDestructuringPattern, postfix_operators=[], prefix_operators=[], qualifier=targetNode, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=targetNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=hasDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=inferType, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None)], member=declareTypeInScope, postfix_operators=[], prefix_operators=[], qualifier=declarer, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=hasDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=inferType, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), name=targetType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSType, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=targetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[MemberReference(member=UNKNOWN_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNativeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MemberReference(member=targetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=targetNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=declarer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverseDestructuringPatternHelper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=registry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=patternType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createAllNonEmptyTargetsInPattern, postfix_operators=[], prefix_operators=[], qualifier=DestructuredTarget, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DestructuredTarget, sub_type=None))), label=None)
call[pattern.setJSType, parameter[member[.patternType]]]
return[member[.scope]]
end[}]
END[}] | Keyword[private] identifier[FlowScope] identifier[traverseDestructuringPatternHelper] operator[SEP] identifier[Node] identifier[pattern] , identifier[FlowScope] identifier[scope] , identifier[JSType] identifier[patternType] , identifier[TypeDeclaringCallback] identifier[declarer] operator[SEP] {
identifier[checkArgument] operator[SEP] identifier[pattern] operator[SEP] identifier[isDestructuringPattern] operator[SEP] operator[SEP] , identifier[pattern] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[patternType] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DestructuredTarget] identifier[target] operator[:] identifier[DestructuredTarget] operator[SEP] identifier[createAllNonEmptyTargetsInPattern] operator[SEP] identifier[registry] , identifier[patternType] , identifier[pattern] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[target] operator[SEP] identifier[hasComputedProperty] operator[SEP] operator[SEP] operator[SEP] {
identifier[scope] operator[=] identifier[traverse] operator[SEP] identifier[target] operator[SEP] identifier[getComputedProperty] operator[SEP] operator[SEP] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] , identifier[scope] operator[SEP] operator[SEP]
}
identifier[Node] identifier[targetNode] operator[=] identifier[target] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetNode] operator[SEP] identifier[isDestructuringPattern] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[target] operator[SEP] identifier[hasDefaultValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[traverse] operator[SEP] identifier[target] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] , identifier[scope] operator[SEP] operator[SEP]
}
identifier[JSType] identifier[targetType] operator[=] identifier[target] operator[SEP] identifier[inferType] operator[SEP] operator[SEP] operator[SEP] identifier[targetType] operator[=] identifier[targetType] operator[!=] Other[null] operator[?] identifier[targetType] operator[:] identifier[getNativeType] operator[SEP] identifier[UNKNOWN_TYPE] operator[SEP] operator[SEP] identifier[scope] operator[=] identifier[traverseDestructuringPatternHelper] operator[SEP] identifier[targetNode] , identifier[scope] , identifier[targetType] , identifier[declarer] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[scope] operator[=] identifier[traverse] operator[SEP] identifier[targetNode] , identifier[scope] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[SEP] identifier[hasDefaultValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[traverse] operator[SEP] identifier[target] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] , identifier[scope] operator[SEP] operator[SEP]
}
identifier[scope] operator[=] identifier[declarer] operator[SEP] identifier[declareTypeInScope] operator[SEP] identifier[scope] , identifier[targetNode] , identifier[target] operator[SEP] identifier[inferType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[pattern] operator[SEP] identifier[setJSType] operator[SEP] identifier[patternType] operator[SEP] operator[SEP] Keyword[return] identifier[scope] operator[SEP]
}
|
AnnotationInfo getImmutableAnnotation(Tree tree, VisitorState state) {
Symbol sym = ASTHelpers.getSymbol(tree);
return sym == null ? null : threadSafety.getMarkerOrAcceptedAnnotation(sym, state);
} | class class_name[name] begin[{]
method[getImmutableAnnotation, return_type[type[AnnotationInfo]], modifier[default], parameter[tree, state]] begin[{]
local_variable[type[Symbol], sym]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMarkerOrAcceptedAnnotation, postfix_operators=[], prefix_operators=[], qualifier=threadSafety, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | identifier[AnnotationInfo] identifier[getImmutableAnnotation] operator[SEP] identifier[Tree] identifier[tree] , identifier[VisitorState] identifier[state] operator[SEP] {
identifier[Symbol] identifier[sym] operator[=] identifier[ASTHelpers] operator[SEP] identifier[getSymbol] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[return] identifier[sym] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[threadSafety] operator[SEP] identifier[getMarkerOrAcceptedAnnotation] operator[SEP] identifier[sym] , identifier[state] operator[SEP] operator[SEP]
}
|
public static void main(String[] args) throws Exception {
StringUtils.printErrInvocationString("CMMClassifier", args);
Properties props = StringUtils.argsToProperties(args);
CMMClassifier cmm = new CMMClassifier<CoreLabel>(props);
String testFile = cmm.flags.testFile;
String textFile = cmm.flags.textFile;
String loadPath = cmm.flags.loadClassifier;
String serializeTo = cmm.flags.serializeTo;
// cmm.crossValidateTrainAndTest(trainFile);
if (loadPath != null) {
cmm.loadClassifierNoExceptions(loadPath, props);
} else if (cmm.flags.loadJarClassifier != null) {
cmm.loadJarClassifier(cmm.flags.loadJarClassifier, props);
} else if (cmm.flags.trainFile != null) {
if (cmm.flags.biasedTrainFile != null) {
cmm.trainSemiSup();
} else {
cmm.train();
}
} else {
cmm.loadDefaultClassifier();
}
if (serializeTo != null) {
cmm.serializeClassifier(serializeTo);
}
if (testFile != null) {
cmm.classifyAndWriteAnswers(testFile, cmm.makeReaderAndWriter());
} else if (cmm.flags.testFiles != null) {
cmm.classifyAndWriteAnswers(cmm.flags.baseTestDir, cmm.flags.testFiles,
cmm.makeReaderAndWriter());
}
if (textFile != null) {
DocumentReaderAndWriter readerAndWriter =
new PlainTextDocumentReaderAndWriter();
cmm.classifyAndWriteAnswers(textFile, readerAndWriter);
}
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[args]] begin[{]
call[StringUtils.printErrInvocationString, parameter[literal["CMMClassifier"], member[.args]]]
local_variable[type[Properties], props]
local_variable[type[CMMClassifier], cmm]
local_variable[type[String], testFile]
local_variable[type[String], textFile]
local_variable[type[String], loadPath]
local_variable[type[String], serializeTo]
if[binary_operation[member[.loadPath], !=, literal[null]]] begin[{]
call[cmm.loadClassifierNoExceptions, parameter[member[.loadPath], member[.props]]]
else begin[{]
if[binary_operation[member[cmm.flags.loadJarClassifier], !=, literal[null]]] begin[{]
call[cmm.loadJarClassifier, parameter[member[cmm.flags.loadJarClassifier], member[.props]]]
else begin[{]
if[binary_operation[member[cmm.flags.trainFile], !=, literal[null]]] begin[{]
if[binary_operation[member[cmm.flags.biasedTrainFile], !=, literal[null]]] begin[{]
call[cmm.trainSemiSup, parameter[]]
else begin[{]
call[cmm.train, parameter[]]
end[}]
else begin[{]
call[cmm.loadDefaultClassifier, parameter[]]
end[}]
end[}]
end[}]
if[binary_operation[member[.serializeTo], !=, literal[null]]] begin[{]
call[cmm.serializeClassifier, parameter[member[.serializeTo]]]
else begin[{]
None
end[}]
if[binary_operation[member[.testFile], !=, literal[null]]] begin[{]
call[cmm.classifyAndWriteAnswers, parameter[member[.testFile], call[cmm.makeReaderAndWriter, parameter[]]]]
else begin[{]
if[binary_operation[member[cmm.flags.testFiles], !=, literal[null]]] begin[{]
call[cmm.classifyAndWriteAnswers, parameter[member[cmm.flags.baseTestDir], member[cmm.flags.testFiles], call[cmm.makeReaderAndWriter, parameter[]]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.textFile], !=, literal[null]]] begin[{]
local_variable[type[DocumentReaderAndWriter], readerAndWriter]
call[cmm.classifyAndWriteAnswers, parameter[member[.textFile], member[.readerAndWriter]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[StringUtils] operator[SEP] identifier[printErrInvocationString] operator[SEP] literal[String] , identifier[args] operator[SEP] operator[SEP] identifier[Properties] identifier[props] operator[=] identifier[StringUtils] operator[SEP] identifier[argsToProperties] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[CMMClassifier] identifier[cmm] operator[=] Keyword[new] identifier[CMMClassifier] operator[<] identifier[CoreLabel] operator[>] operator[SEP] identifier[props] operator[SEP] operator[SEP] identifier[String] identifier[testFile] operator[=] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[testFile] operator[SEP] identifier[String] identifier[textFile] operator[=] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[textFile] operator[SEP] identifier[String] identifier[loadPath] operator[=] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[loadClassifier] operator[SEP] identifier[String] identifier[serializeTo] operator[=] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[serializeTo] operator[SEP] Keyword[if] operator[SEP] identifier[loadPath] operator[!=] Other[null] operator[SEP] {
identifier[cmm] operator[SEP] identifier[loadClassifierNoExceptions] operator[SEP] identifier[loadPath] , identifier[props] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[loadJarClassifier] operator[!=] Other[null] operator[SEP] {
identifier[cmm] operator[SEP] identifier[loadJarClassifier] operator[SEP] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[loadJarClassifier] , identifier[props] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[trainFile] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[biasedTrainFile] operator[!=] Other[null] operator[SEP] {
identifier[cmm] operator[SEP] identifier[trainSemiSup] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[cmm] operator[SEP] identifier[train] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[cmm] operator[SEP] identifier[loadDefaultClassifier] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[serializeTo] operator[!=] Other[null] operator[SEP] {
identifier[cmm] operator[SEP] identifier[serializeClassifier] operator[SEP] identifier[serializeTo] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[testFile] operator[!=] Other[null] operator[SEP] {
identifier[cmm] operator[SEP] identifier[classifyAndWriteAnswers] operator[SEP] identifier[testFile] , identifier[cmm] operator[SEP] identifier[makeReaderAndWriter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[testFiles] operator[!=] Other[null] operator[SEP] {
identifier[cmm] operator[SEP] identifier[classifyAndWriteAnswers] operator[SEP] identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[baseTestDir] , identifier[cmm] operator[SEP] identifier[flags] operator[SEP] identifier[testFiles] , identifier[cmm] operator[SEP] identifier[makeReaderAndWriter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[textFile] operator[!=] Other[null] operator[SEP] {
identifier[DocumentReaderAndWriter] identifier[readerAndWriter] operator[=] Keyword[new] identifier[PlainTextDocumentReaderAndWriter] operator[SEP] operator[SEP] operator[SEP] identifier[cmm] operator[SEP] identifier[classifyAndWriteAnswers] operator[SEP] identifier[textFile] , identifier[readerAndWriter] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("cast")
public static int calcHash(char[] buffer, int start, int len) {
int hash = (int) buffer[start];
for (int i = 1; i < len; ++i) {
hash = (hash * 31) + (int) buffer[start+i];
}
return hash;
} | class class_name[name] begin[{]
method[calcHash, return_type[type[int]], modifier[public static], parameter[buffer, start, len]] begin[{]
local_variable[type[int], hash]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31), operator=*), operandr=Cast(expression=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type=BasicType(dimensions=[], name=int)), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[member[.hash]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[int] identifier[calcHash] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[buffer] , Keyword[int] identifier[start] , Keyword[int] identifier[len] operator[SEP] {
Keyword[int] identifier[hash] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[buffer] operator[SEP] identifier[start] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[hash] operator[=] operator[SEP] identifier[hash] operator[*] Other[31] operator[SEP] operator[+] operator[SEP] Keyword[int] operator[SEP] identifier[buffer] operator[SEP] identifier[start] operator[+] identifier[i] operator[SEP] operator[SEP]
}
Keyword[return] identifier[hash] operator[SEP]
}
|
@Override
public ModifyInstanceCreditSpecificationResult modifyInstanceCreditSpecification(ModifyInstanceCreditSpecificationRequest request) {
request = beforeClientExecution(request);
return executeModifyInstanceCreditSpecification(request);
} | class class_name[name] begin[{]
method[modifyInstanceCreditSpecification, return_type[type[ModifyInstanceCreditSpecificationResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeModifyInstanceCreditSpecification, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ModifyInstanceCreditSpecificationResult] identifier[modifyInstanceCreditSpecification] operator[SEP] identifier[ModifyInstanceCreditSpecificationRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeModifyInstanceCreditSpecification] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public final String[][] getAllPosTags(final String[] tokens) {
final String[][] allPosTags = this.posTagger.tag(13, tokens);
return allPosTags;
} | class class_name[name] begin[{]
method[getAllPosTags, return_type[type[String]], modifier[final public], parameter[tokens]] begin[{]
local_variable[type[String], allPosTags]
return[member[.allPosTags]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getAllPosTags] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] {
Keyword[final] identifier[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[allPosTags] operator[=] Keyword[this] operator[SEP] identifier[posTagger] operator[SEP] identifier[tag] operator[SEP] Other[13] , identifier[tokens] operator[SEP] operator[SEP] Keyword[return] identifier[allPosTags] operator[SEP]
}
|
@Override
public void removeRange(int fromIndex, int toIndex) {
int fromIdx = getRealIndex(fromIndex);
int toIdx = getRealIndex(toIndex);
super.removeRange(fromIdx, toIdx);
} | class class_name[name] begin[{]
method[removeRange, return_type[void], modifier[public], parameter[fromIndex, toIndex]] begin[{]
local_variable[type[int], fromIdx]
local_variable[type[int], toIdx]
SuperMethodInvocation(arguments=[MemberReference(member=fromIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=toIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeRange, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeRange] operator[SEP] Keyword[int] identifier[fromIndex] , Keyword[int] identifier[toIndex] operator[SEP] {
Keyword[int] identifier[fromIdx] operator[=] identifier[getRealIndex] operator[SEP] identifier[fromIndex] operator[SEP] operator[SEP] Keyword[int] identifier[toIdx] operator[=] identifier[getRealIndex] operator[SEP] identifier[toIndex] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[removeRange] operator[SEP] identifier[fromIdx] , identifier[toIdx] operator[SEP] operator[SEP]
}
|
@Deprecated
public Object[] getValues() {
T v = getValue();
return v != null ? new Object[] { v } : new Object[0];
} | class class_name[name] begin[{]
method[getValues, return_type[type[Object]], modifier[public], parameter[]] begin[{]
local_variable[type[T], v]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), if_true=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)))]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] identifier[Object] operator[SEP] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] {
identifier[T] identifier[v] operator[=] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[v] operator[!=] Other[null] operator[?] Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[v]
} operator[:] Keyword[new] identifier[Object] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
|
private List<PaymentTransactionInfoPlugin> getPaymentTransactionInfoPluginsIfNeeded(@Nullable final PaymentPluginApi pluginApi, final PaymentModelDao paymentModelDao, final TenantContext context) {
if (pluginApi == null) {
return null;
}
try {
return getPaymentTransactionInfoPlugins(pluginApi, paymentModelDao, PLUGIN_PROPERTIES, context);
} catch (final PaymentApiException e) {
log.warn("Unable to retrieve plugin info for payment " + paymentModelDao.getId());
return null;
}
} | class class_name[name] begin[{]
method[getPaymentTransactionInfoPluginsIfNeeded, return_type[type[List]], modifier[private], parameter[pluginApi, paymentModelDao, context]] begin[{]
if[binary_operation[member[.pluginApi], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=pluginApi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paymentModelDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PLUGIN_PROPERTIES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPaymentTransactionInfoPlugins, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to retrieve plugin info for payment "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=paymentModelDao, selectors=[], type_arguments=None), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, 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=['PaymentApiException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[PaymentTransactionInfoPlugin] operator[>] identifier[getPaymentTransactionInfoPluginsIfNeeded] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[PaymentPluginApi] identifier[pluginApi] , Keyword[final] identifier[PaymentModelDao] identifier[paymentModelDao] , Keyword[final] identifier[TenantContext] identifier[context] operator[SEP] {
Keyword[if] operator[SEP] identifier[pluginApi] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[getPaymentTransactionInfoPlugins] operator[SEP] identifier[pluginApi] , identifier[paymentModelDao] , identifier[PLUGIN_PROPERTIES] , identifier[context] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[PaymentApiException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[paymentModelDao] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
|
public void log(Level mesgLevel, String mesg, Throwable t) {
if (mesgLevel.ordinal() >= level.ordinal()) {
StringBuilder builder = new StringBuilder();
builder.append(mesgLevel.name());
builder.append(": [");
builder.append(simpleClassName != null ? simpleClassName : className);
builder.append("] [");
builder.append(Thread.currentThread());
builder.append("] ");
builder.append(mesg);
if (mesgLevel == Level.SEVERE) {
if (julLogger != null) {
julLogger.log(java.util.logging.Level.SEVERE, builder.toString(), t);
} else {
System.err.println(builder.toString());
}
} else {
if (julLogger != null) {
julLogger.info(builder.toString());
} else {
System.out.println(builder.toString());
}
}
if (t != null) {
t.printStackTrace();
}
}
} | class class_name[name] begin[{]
method[log, return_type[void], modifier[public], parameter[mesgLevel, mesg, t]] begin[{]
if[binary_operation[call[mesgLevel.ordinal, parameter[]], >=, call[level.ordinal, parameter[]]]] begin[{]
local_variable[type[StringBuilder], builder]
call[builder.append, parameter[call[mesgLevel.name, parameter[]]]]
call[builder.append, parameter[literal[": ["]]]
call[builder.append, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=simpleClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=simpleClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]]
call[builder.append, parameter[literal["] ["]]]
call[builder.append, parameter[call[Thread.currentThread, parameter[]]]]
call[builder.append, parameter[literal["] "]]]
call[builder.append, parameter[member[.mesg]]]
if[binary_operation[member[.mesgLevel], ==, member[Level.SEVERE]]] begin[{]
if[binary_operation[member[.julLogger], !=, literal[null]]] begin[{]
call[julLogger.log, parameter[member[java.util.logging.Level.SEVERE], call[builder.toString, parameter[]], member[.t]]]
else begin[{]
call[System.err.println, parameter[call[builder.toString, parameter[]]]]
end[}]
else begin[{]
if[binary_operation[member[.julLogger], !=, literal[null]]] begin[{]
call[julLogger.info, parameter[call[builder.toString, parameter[]]]]
else begin[{]
call[System.out.println, parameter[call[builder.toString, parameter[]]]]
end[}]
end[}]
if[binary_operation[member[.t], !=, literal[null]]] begin[{]
call[t.printStackTrace, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[log] operator[SEP] identifier[Level] identifier[mesgLevel] , identifier[String] identifier[mesg] , identifier[Throwable] identifier[t] operator[SEP] {
Keyword[if] operator[SEP] identifier[mesgLevel] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[>=] identifier[level] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[mesgLevel] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[simpleClassName] operator[!=] Other[null] operator[?] identifier[simpleClassName] operator[:] identifier[className] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[mesg] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mesgLevel] operator[==] identifier[Level] operator[SEP] identifier[SEVERE] operator[SEP] {
Keyword[if] operator[SEP] identifier[julLogger] operator[!=] Other[null] operator[SEP] {
identifier[julLogger] operator[SEP] identifier[log] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[logging] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[t] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[julLogger] operator[!=] Other[null] operator[SEP] {
identifier[julLogger] operator[SEP] identifier[info] operator[SEP] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[t] operator[!=] Other[null] operator[SEP] {
identifier[t] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
protected IWord getNextDatetimeWord(IWord word, int entityIdx) throws IOException
{
IWord dWord = super.next();
if ( dWord == null ) {
return null;
}
String[] entity = dWord.getEntity();
if ( entity == null ) {
eWordPool.add(dWord);
return null;
}
int eIdx = 0;
if ( (eIdx = ArrayUtil.startsWith("datetime.h", entity)) > -1 ) {
// do nothing here
} else if ( (eIdx = ArrayUtil.startsWith("time.a", entity)) > -1
|| (eIdx = ArrayUtil.startsWith(Entity.E_DATETIME_P, entity)) > -1 ) {
/*
* @Note: added at 2017/04/01
* 1, A word start with time.h or datetime.h could be merged
* 2, if the new time merged word could not be merged with the origin word
* and we should put the dWord to the first of the eWordPool cuz #getNextTimeMergedWord
* may append some IWord to the end of eWordPool
*/
IWord mWord = getNextTimeMergedWord(dWord, eIdx);
if ( mWord == null ) {
eWordPool.addFirst(dWord);
return null;
}
String mEntity = mWord.getEntity(0);
if ( ! (mEntity.contains(".h") || mEntity.contains(".a")) ) {
eWordPool.addFirst(mWord);
return null;
}
eIdx = 0;
dWord = mWord;
entity = dWord.getEntity();
} else {
eWordPool.add(dWord);
return null;
}
buffer.clear().append(word.getValue()).append(' ').append(dWord.getValue());
dWord = new Word(buffer.toString(), IWord.T_BASIC_LATIN);
dWord.setPosition(word.getPosition());
dWord.setPartSpeech(IWord.TIME_POSPEECH);
//re-define the entity
//int sIdx = entity.indexOf('.') + 1;
// int sIdx = entity[eIdx].charAt(0) == 't' ? 5 : 9;
int sIdx = 9; // datetime
buffer.clear().append(word.getEntity(0)).append(entity[eIdx].substring(sIdx));
dWord.addEntity(buffer.toString());
return dWord;
} | class class_name[name] begin[{]
method[getNextDatetimeWord, return_type[type[IWord]], modifier[protected], parameter[word, entityIdx]] begin[{]
local_variable[type[IWord], dWord]
if[binary_operation[member[.dWord], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], entity]
if[binary_operation[member[.entity], ==, literal[null]]] begin[{]
call[eWordPool.add, parameter[member[.dWord]]]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[int], eIdx]
if[binary_operation[assign[member[.eIdx], call[ArrayUtil.startsWith, parameter[literal["datetime.h"], member[.entity]]]], >, literal[1]]] begin[{]
else begin[{]
if[binary_operation[binary_operation[assign[member[.eIdx], call[ArrayUtil.startsWith, parameter[literal["time.a"], member[.entity]]]], >, literal[1]], ||, binary_operation[assign[member[.eIdx], call[ArrayUtil.startsWith, parameter[member[Entity.E_DATETIME_P], member[.entity]]]], >, literal[1]]]] begin[{]
local_variable[type[IWord], mWord]
if[binary_operation[member[.mWord], ==, literal[null]]] begin[{]
call[eWordPool.addFirst, parameter[member[.dWord]]]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], mEntity]
if[binary_operation[call[mEntity.contains, parameter[literal[".h"]]], ||, call[mEntity.contains, parameter[literal[".a"]]]]] begin[{]
call[eWordPool.addFirst, parameter[member[.mWord]]]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.eIdx], literal[0]]
assign[member[.dWord], member[.mWord]]
assign[member[.entity], call[dWord.getEntity, parameter[]]]
else begin[{]
call[eWordPool.add, parameter[member[.dWord]]]
return[literal[null]]
end[}]
end[}]
call[buffer.clear, parameter[]]
assign[member[.dWord], ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), MemberReference(member=T_BASIC_LATIN, postfix_operators=[], prefix_operators=[], qualifier=IWord, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Word, sub_type=None))]
call[dWord.setPosition, parameter[call[word.getPosition, parameter[]]]]
call[dWord.setPartSpeech, parameter[member[IWord.TIME_POSPEECH]]]
local_variable[type[int], sIdx]
call[buffer.clear, parameter[]]
call[dWord.addEntity, parameter[call[buffer.toString, parameter[]]]]
return[member[.dWord]]
end[}]
END[}] | Keyword[protected] identifier[IWord] identifier[getNextDatetimeWord] operator[SEP] identifier[IWord] identifier[word] , Keyword[int] identifier[entityIdx] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[IWord] identifier[dWord] operator[=] Keyword[super] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dWord] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[entity] operator[=] identifier[dWord] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entity] operator[==] Other[null] operator[SEP] {
identifier[eWordPool] operator[SEP] identifier[add] operator[SEP] identifier[dWord] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[int] identifier[eIdx] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[eIdx] operator[=] identifier[ArrayUtil] operator[SEP] identifier[startsWith] operator[SEP] literal[String] , identifier[entity] operator[SEP] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[eIdx] operator[=] identifier[ArrayUtil] operator[SEP] identifier[startsWith] operator[SEP] literal[String] , identifier[entity] operator[SEP] operator[SEP] operator[>] operator[-] Other[1] operator[||] operator[SEP] identifier[eIdx] operator[=] identifier[ArrayUtil] operator[SEP] identifier[startsWith] operator[SEP] identifier[Entity] operator[SEP] identifier[E_DATETIME_P] , identifier[entity] operator[SEP] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[IWord] identifier[mWord] operator[=] identifier[getNextTimeMergedWord] operator[SEP] identifier[dWord] , identifier[eIdx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mWord] operator[==] Other[null] operator[SEP] {
identifier[eWordPool] operator[SEP] identifier[addFirst] operator[SEP] identifier[dWord] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[String] identifier[mEntity] operator[=] identifier[mWord] operator[SEP] identifier[getEntity] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[mEntity] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[mEntity] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] {
identifier[eWordPool] operator[SEP] identifier[addFirst] operator[SEP] identifier[mWord] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[eIdx] operator[=] Other[0] operator[SEP] identifier[dWord] operator[=] identifier[mWord] operator[SEP] identifier[entity] operator[=] identifier[dWord] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[eWordPool] operator[SEP] identifier[add] operator[SEP] identifier[dWord] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[buffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[word] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[dWord] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dWord] operator[=] Keyword[new] identifier[Word] operator[SEP] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[IWord] operator[SEP] identifier[T_BASIC_LATIN] operator[SEP] operator[SEP] identifier[dWord] operator[SEP] identifier[setPosition] operator[SEP] identifier[word] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dWord] operator[SEP] identifier[setPartSpeech] operator[SEP] identifier[IWord] operator[SEP] identifier[TIME_POSPEECH] operator[SEP] operator[SEP] Keyword[int] identifier[sIdx] operator[=] Other[9] operator[SEP] identifier[buffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[word] operator[SEP] identifier[getEntity] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[entity] operator[SEP] identifier[eIdx] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[sIdx] operator[SEP] operator[SEP] operator[SEP] identifier[dWord] operator[SEP] identifier[addEntity] operator[SEP] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dWord] operator[SEP]
}
|
public static boolean setFeatureStyle(MarkerOptions markerOptions, FeatureStyleExtension featureStyleExtension, FeatureRow featureRow, float density, IconCache iconCache) {
FeatureStyle featureStyle = featureStyleExtension.getFeatureStyle(featureRow);
return setFeatureStyle(markerOptions, featureStyle, density, iconCache);
} | class class_name[name] begin[{]
method[setFeatureStyle, return_type[type[boolean]], modifier[public static], parameter[markerOptions, featureStyleExtension, featureRow, density, iconCache]] begin[{]
local_variable[type[FeatureStyle], featureStyle]
return[call[.setFeatureStyle, parameter[member[.markerOptions], member[.featureStyle], member[.density], member[.iconCache]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[setFeatureStyle] operator[SEP] identifier[MarkerOptions] identifier[markerOptions] , identifier[FeatureStyleExtension] identifier[featureStyleExtension] , identifier[FeatureRow] identifier[featureRow] , Keyword[float] identifier[density] , identifier[IconCache] identifier[iconCache] operator[SEP] {
identifier[FeatureStyle] identifier[featureStyle] operator[=] identifier[featureStyleExtension] operator[SEP] identifier[getFeatureStyle] operator[SEP] identifier[featureRow] operator[SEP] operator[SEP] Keyword[return] identifier[setFeatureStyle] operator[SEP] identifier[markerOptions] , identifier[featureStyle] , identifier[density] , identifier[iconCache] operator[SEP] operator[SEP]
}
|
private static void assertXpathEquality(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument,
boolean equal)
throws XpathException {
XpathEngine xpath = XMLUnit.newXpathEngine();
Diff diff = new Diff(asXpathResultDocument(XMLUnit.newControlParser(),
xpath.getMatchingNodes(controlXpath,
controlDocument)),
asXpathResultDocument(XMLUnit.newTestParser(),
xpath.getMatchingNodes(testXpath,
testDocument)));
assertXMLEqual(diff, equal);
} | class class_name[name] begin[{]
method[assertXpathEquality, return_type[void], modifier[private static], parameter[controlXpath, controlDocument, testXpath, testDocument, equal]] begin[{]
local_variable[type[XpathEngine], xpath]
local_variable[type[Diff], diff]
call[.assertXMLEqual, parameter[member[.diff], member[.equal]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[assertXpathEquality] operator[SEP] identifier[String] identifier[controlXpath] , identifier[Document] identifier[controlDocument] , identifier[String] identifier[testXpath] , identifier[Document] identifier[testDocument] , Keyword[boolean] identifier[equal] operator[SEP] Keyword[throws] identifier[XpathException] {
identifier[XpathEngine] identifier[xpath] operator[=] identifier[XMLUnit] operator[SEP] identifier[newXpathEngine] operator[SEP] operator[SEP] operator[SEP] identifier[Diff] identifier[diff] operator[=] Keyword[new] identifier[Diff] operator[SEP] identifier[asXpathResultDocument] operator[SEP] identifier[XMLUnit] operator[SEP] identifier[newControlParser] operator[SEP] operator[SEP] , identifier[xpath] operator[SEP] identifier[getMatchingNodes] operator[SEP] identifier[controlXpath] , identifier[controlDocument] operator[SEP] operator[SEP] , identifier[asXpathResultDocument] operator[SEP] identifier[XMLUnit] operator[SEP] identifier[newTestParser] operator[SEP] operator[SEP] , identifier[xpath] operator[SEP] identifier[getMatchingNodes] operator[SEP] identifier[testXpath] , identifier[testDocument] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[assertXMLEqual] operator[SEP] identifier[diff] , identifier[equal] operator[SEP] operator[SEP]
}
|
public TokenRequest setScopes(Collection<String> scopes) {
this.scopes = scopes == null ? null : Joiner.on(' ').join(scopes);
return this;
} | class class_name[name] begin[{]
method[setScopes, return_type[type[TokenRequest]], modifier[public], parameter[scopes]] begin[{]
assign[THIS[member[None.scopes]], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=scopes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=on, postfix_operators=[], prefix_operators=[], qualifier=Joiner, selectors=[MethodInvocation(arguments=[MemberReference(member=scopes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[TokenRequest] identifier[setScopes] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[scopes] operator[SEP] {
Keyword[this] operator[SEP] identifier[scopes] operator[=] identifier[scopes] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[scopes] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static void symmRankTranA_sub(DMatrixRMaj a , DMatrixRMaj c ,
int startIndexC )
{
// TODO update so that it doesn't modify/read parts that it shouldn't
final double dataA[] = a.data;
final double dataC[] = c.data;
// for( int i = 0; i < a.numCols; i++ ) {
// for( int k = 0; k < a.numRows; k++ ) {
// double valA = dataA[k*a.numCols+i];
//
// for( int j = i; j < a.numCols; j++ ) {
// dataC[startIndexC+i*c.numCols+j] -= valA * dataA[k*a.numCols+j];
// }
// }
// }
final int strideC = c.numCols + 1;
for( int i = 0; i < a.numCols; i++ ) {
int indexA = i;
int endR = a.numCols;
for( int k = 0; k < a.numRows; k++ , indexA += a.numCols , endR += a.numCols) {
int indexC = startIndexC;
final double valA = dataA[indexA];
int indexR = indexA;
while( indexR < endR ) {
dataC[indexC++] -= valA * dataA[indexR++];
}
}
startIndexC += strideC;
}
} | class class_name[name] begin[{]
method[symmRankTranA_sub, return_type[void], modifier[public static], parameter[a, c, startIndexC]] begin[{]
local_variable[type[double], dataA]
local_variable[type[double], dataC]
local_variable[type[int], strideC]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=indexA)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[]), name=endR)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=startIndexC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=indexC)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dataA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=valA)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=indexA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=indexR)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexC, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type=-=, value=BinaryOperation(operandl=MemberReference(member=valA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dataA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexR, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=indexR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=endR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=a, 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=[]), Assignment(expressionl=MemberReference(member=indexA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[])), Assignment(expressionl=MemberReference(member=endR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[]))]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=startIndexC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=strideC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[symmRankTranA_sub] operator[SEP] identifier[DMatrixRMaj] identifier[a] , identifier[DMatrixRMaj] identifier[c] , Keyword[int] identifier[startIndexC] operator[SEP] {
Keyword[final] Keyword[double] identifier[dataA] operator[SEP] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[data] operator[SEP] Keyword[final] Keyword[double] identifier[dataC] operator[SEP] operator[SEP] operator[=] identifier[c] operator[SEP] identifier[data] operator[SEP] Keyword[final] Keyword[int] identifier[strideC] operator[=] identifier[c] operator[SEP] identifier[numCols] operator[+] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[a] operator[SEP] identifier[numCols] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[indexA] operator[=] identifier[i] operator[SEP] Keyword[int] identifier[endR] operator[=] identifier[a] operator[SEP] identifier[numCols] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[a] operator[SEP] identifier[numRows] operator[SEP] identifier[k] operator[++] , identifier[indexA] operator[+=] identifier[a] operator[SEP] identifier[numCols] , identifier[endR] operator[+=] identifier[a] operator[SEP] identifier[numCols] operator[SEP] {
Keyword[int] identifier[indexC] operator[=] identifier[startIndexC] operator[SEP] Keyword[final] Keyword[double] identifier[valA] operator[=] identifier[dataA] operator[SEP] identifier[indexA] operator[SEP] operator[SEP] Keyword[int] identifier[indexR] operator[=] identifier[indexA] operator[SEP] Keyword[while] operator[SEP] identifier[indexR] operator[<] identifier[endR] operator[SEP] {
identifier[dataC] operator[SEP] identifier[indexC] operator[++] operator[SEP] operator[-=] identifier[valA] operator[*] identifier[dataA] operator[SEP] identifier[indexR] operator[++] operator[SEP] operator[SEP]
}
}
identifier[startIndexC] operator[+=] identifier[strideC] operator[SEP]
}
}
|
private Table joinInternal(Table table1, Table table2, boolean outer, boolean allowDuplicates, String... col2Names) {
if (allowDuplicates) {
renameColumnsWithDuplicateNames(table1, table2, col2Names);
}
Table result = emptyTableFromColumns(table1, table2, col2Names);
Map<Column<?>, Index> columnIndexMap = new HashMap<>();
for (int i = 0; i < joinColumns.length; i++) {
Column<?> col = joinColumns[i];
String col2Name = col2Names[i];
columnIndexMap.put(col, indexFor(table2, col2Name, col));
}
for (Row row : table1) {
int ri = row.getRowNumber();
Table table1Rows = table1.where(Selection.with(ri));
Selection rowBitMapMultiCol = null;
for (int i = 0; i < joinColumns.length; i++) {
// Need to use the column from table1 that is the same column originally
// defined for this DataFrameJoiner. Column names must be unique within the
// same table, so use the original column's name to get the corresponding
// column out of the table1 input Table.
Column<?> column = joinColumns[i];
Column<?> table1Column = table1.column(column.name());
ColumnType type = table1Column.type();
// relies on both arrays, columns, and col2Names,
// having corresponding values at same index
Selection rowBitMapOneCol = null;
if (type instanceof DateColumnType) {
IntIndex index = (IntIndex) columnIndexMap.get(column);
DateColumn col1 = (DateColumn) table1Column;
int value = col1.getIntInternal(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof DateTimeColumnType) {
LongIndex index = (LongIndex) columnIndexMap.get(column);
DateTimeColumn col1 = (DateTimeColumn) table1Column;
long value = col1.getLongInternal(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof TimeColumnType) {
IntIndex index = (IntIndex) columnIndexMap.get(column);
TimeColumn col1 = (TimeColumn) table1Column;
int value = col1.getIntInternal(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof StringColumnType || type instanceof TextColumnType) {
StringIndex index = (StringIndex) columnIndexMap.get(column);
StringColumn col1 = (StringColumn) table1Column;
String value = col1.get(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof IntColumnType) {
IntIndex index = (IntIndex) columnIndexMap.get(column);
IntColumn col1 = (IntColumn) table1Column;
int value = col1.getInt(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof LongColumnType) {
LongIndex index = (LongIndex) columnIndexMap.get(column);
LongColumn col1 = (LongColumn) table1Column;
long value = col1.getLong(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof ShortColumnType) {
ShortIndex index = (ShortIndex) columnIndexMap.get(column);
ShortColumn col1 = (ShortColumn) table1Column;
short value = col1.getShort(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof BooleanColumnType) {
ByteIndex index = (ByteIndex) columnIndexMap.get(column);
BooleanColumn col1 = (BooleanColumn) table1Column;
byte value = col1.getByte(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof DoubleColumnType) {
DoubleIndex index = (DoubleIndex) columnIndexMap.get(column);
DoubleColumn col1 = (DoubleColumn) table1Column;
double value = col1.getDouble(ri);
rowBitMapOneCol = index.get(value);
} else if (type instanceof FloatColumnType) {
FloatIndex index = (FloatIndex) columnIndexMap.get(column);
FloatColumn col1 = (FloatColumn) table1Column;
float value = col1.getFloat(ri);
rowBitMapOneCol = index.get(value);
} else {
throw new IllegalArgumentException(
"Joining is supported on numeric, string, and date-like columns. Column "
+ table1Column.name() + " is of type " + table1Column.type());
}
// combine Selection's into one big AND Selection
if (rowBitMapOneCol != null) {
rowBitMapMultiCol =
rowBitMapMultiCol != null
? rowBitMapMultiCol.and(rowBitMapOneCol)
: rowBitMapOneCol;
}
}
Table table2Rows = table2.where(rowBitMapMultiCol);
table2Rows.removeColumns(col2Names);
if (outer && table2Rows.isEmpty()) {
withMissingLeftJoin(result, table1Rows);
} else {
crossProduct(result, table1Rows, table2Rows);
}
}
return result;
} | class class_name[name] begin[{]
method[joinInternal, return_type[type[Table]], modifier[private], parameter[table1, table2, outer, allowDuplicates, col2Names]] begin[{]
if[member[.allowDuplicates]] begin[{]
call[.renameColumnsWithDuplicateNames, parameter[member[.table1], member[.table2], member[.col2Names]]]
else begin[{]
None
end[}]
local_variable[type[Table], result]
local_variable[type[Map], columnIndexMap]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=joinColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=col)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Column, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=col2Names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=col2Name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=table2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=col2Name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexFor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=joinColumns, 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)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRowNumber, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), name=ri)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=with, postfix_operators=[], prefix_operators=[], qualifier=Selection, selectors=[], type_arguments=None)], member=where, postfix_operators=[], prefix_operators=[], qualifier=table1, selectors=[], type_arguments=None), name=table1Rows)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=rowBitMapMultiCol)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Selection, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=joinColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=column)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Column, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], member=column, postfix_operators=[], prefix_operators=[], qualifier=table1, selectors=[], type_arguments=None), name=table1Column)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Column, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=table1Column, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnType, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=rowBitMapOneCol)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Selection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DateColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DateTimeColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TimeColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=StringColumnType, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TextColumnType, sub_type=None), operator=instanceof), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IntColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=LongColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ShortColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BooleanColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DoubleColumnType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=FloatColumnType, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Joining is supported on numeric, string, and date-like columns. Column "), operandr=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=table1Column, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is of type "), operator=+), operandr=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=table1Column, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FloatIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FloatIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FloatColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FloatColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=float)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DoubleIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DoubleIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DoubleColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DoubleColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ByteIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BooleanColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BooleanColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ShortIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShortIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ShortColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShortColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getShort, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=short)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=LongIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LongIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LongColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LongColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IntIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=StringIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StringColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IntIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TimeColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimeColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIntInternal, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=LongIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LongIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DateTimeColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DateTimeColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLongInternal, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IntIndex, sub_type=None)), name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=table1Column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DateColumn, sub_type=None)), name=col1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DateColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIntInternal, postfix_operators=[], prefix_operators=[], qualifier=col1, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rowBitMapOneCol, 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=rowBitMapMultiCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=rowBitMapMultiCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=rowBitMapOneCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=and, postfix_operators=[], prefix_operators=[], qualifier=rowBitMapMultiCol, selectors=[], type_arguments=None))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=joinColumns, 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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rowBitMapMultiCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=where, postfix_operators=[], prefix_operators=[], qualifier=table2, selectors=[], type_arguments=None), name=table2Rows)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=col2Names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeColumns, postfix_operators=[], prefix_operators=[], qualifier=table2Rows, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=outer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=table2Rows, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=table1Rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=table2Rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=crossProduct, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=table1Rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withMissingLeftJoin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=table1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[Table] identifier[joinInternal] operator[SEP] identifier[Table] identifier[table1] , identifier[Table] identifier[table2] , Keyword[boolean] identifier[outer] , Keyword[boolean] identifier[allowDuplicates] , identifier[String] operator[...] identifier[col2Names] operator[SEP] {
Keyword[if] operator[SEP] identifier[allowDuplicates] operator[SEP] {
identifier[renameColumnsWithDuplicateNames] operator[SEP] identifier[table1] , identifier[table2] , identifier[col2Names] operator[SEP] operator[SEP]
}
identifier[Table] identifier[result] operator[=] identifier[emptyTableFromColumns] operator[SEP] identifier[table1] , identifier[table2] , identifier[col2Names] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Column] operator[<] operator[?] operator[>] , identifier[Index] operator[>] identifier[columnIndexMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[joinColumns] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Column] operator[<] operator[?] operator[>] identifier[col] operator[=] identifier[joinColumns] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[col2Name] operator[=] identifier[col2Names] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[put] operator[SEP] identifier[col] , identifier[indexFor] operator[SEP] identifier[table2] , identifier[col2Name] , identifier[col] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Row] identifier[row] operator[:] identifier[table1] operator[SEP] {
Keyword[int] identifier[ri] operator[=] identifier[row] operator[SEP] identifier[getRowNumber] operator[SEP] operator[SEP] operator[SEP] identifier[Table] identifier[table1Rows] operator[=] identifier[table1] operator[SEP] identifier[where] operator[SEP] identifier[Selection] operator[SEP] identifier[with] operator[SEP] identifier[ri] operator[SEP] operator[SEP] operator[SEP] identifier[Selection] identifier[rowBitMapMultiCol] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[joinColumns] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Column] operator[<] operator[?] operator[>] identifier[column] operator[=] identifier[joinColumns] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Column] operator[<] operator[?] operator[>] identifier[table1Column] operator[=] identifier[table1] operator[SEP] identifier[column] operator[SEP] identifier[column] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ColumnType] identifier[type] operator[=] identifier[table1Column] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[Selection] identifier[rowBitMapOneCol] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[DateColumnType] operator[SEP] {
identifier[IntIndex] identifier[index] operator[=] operator[SEP] identifier[IntIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[DateColumn] identifier[col1] operator[=] operator[SEP] identifier[DateColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[int] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getIntInternal] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[DateTimeColumnType] operator[SEP] {
identifier[LongIndex] identifier[index] operator[=] operator[SEP] identifier[LongIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[DateTimeColumn] identifier[col1] operator[=] operator[SEP] identifier[DateTimeColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[long] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getLongInternal] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[TimeColumnType] operator[SEP] {
identifier[IntIndex] identifier[index] operator[=] operator[SEP] identifier[IntIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[TimeColumn] identifier[col1] operator[=] operator[SEP] identifier[TimeColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[int] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getIntInternal] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[StringColumnType] operator[||] identifier[type] Keyword[instanceof] identifier[TextColumnType] operator[SEP] {
identifier[StringIndex] identifier[index] operator[=] operator[SEP] identifier[StringIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[StringColumn] identifier[col1] operator[=] operator[SEP] identifier[StringColumn] operator[SEP] identifier[table1Column] operator[SEP] identifier[String] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[get] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[IntColumnType] operator[SEP] {
identifier[IntIndex] identifier[index] operator[=] operator[SEP] identifier[IntIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[IntColumn] identifier[col1] operator[=] operator[SEP] identifier[IntColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[int] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getInt] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[LongColumnType] operator[SEP] {
identifier[LongIndex] identifier[index] operator[=] operator[SEP] identifier[LongIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[LongColumn] identifier[col1] operator[=] operator[SEP] identifier[LongColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[long] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getLong] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[ShortColumnType] operator[SEP] {
identifier[ShortIndex] identifier[index] operator[=] operator[SEP] identifier[ShortIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[ShortColumn] identifier[col1] operator[=] operator[SEP] identifier[ShortColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[short] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getShort] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[BooleanColumnType] operator[SEP] {
identifier[ByteIndex] identifier[index] operator[=] operator[SEP] identifier[ByteIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[BooleanColumn] identifier[col1] operator[=] operator[SEP] identifier[BooleanColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[byte] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getByte] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[DoubleColumnType] operator[SEP] {
identifier[DoubleIndex] identifier[index] operator[=] operator[SEP] identifier[DoubleIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[DoubleColumn] identifier[col1] operator[=] operator[SEP] identifier[DoubleColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[double] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getDouble] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[FloatColumnType] operator[SEP] {
identifier[FloatIndex] identifier[index] operator[=] operator[SEP] identifier[FloatIndex] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[FloatColumn] identifier[col1] operator[=] operator[SEP] identifier[FloatColumn] operator[SEP] identifier[table1Column] operator[SEP] Keyword[float] identifier[value] operator[=] identifier[col1] operator[SEP] identifier[getFloat] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[rowBitMapOneCol] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[table1Column] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[table1Column] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[rowBitMapOneCol] operator[!=] Other[null] operator[SEP] {
identifier[rowBitMapMultiCol] operator[=] identifier[rowBitMapMultiCol] operator[!=] Other[null] operator[?] identifier[rowBitMapMultiCol] operator[SEP] identifier[and] operator[SEP] identifier[rowBitMapOneCol] operator[SEP] operator[:] identifier[rowBitMapOneCol] operator[SEP]
}
}
identifier[Table] identifier[table2Rows] operator[=] identifier[table2] operator[SEP] identifier[where] operator[SEP] identifier[rowBitMapMultiCol] operator[SEP] operator[SEP] identifier[table2Rows] operator[SEP] identifier[removeColumns] operator[SEP] identifier[col2Names] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outer] operator[&&] identifier[table2Rows] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[withMissingLeftJoin] operator[SEP] identifier[result] , identifier[table1Rows] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[crossProduct] operator[SEP] identifier[result] , identifier[table1Rows] , identifier[table2Rows] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public final boolean showAnimated(@Nullable final DialogAnimation animation,
@Nullable final AnimatorListener listener) {
hidden = false;
if (animation != null) {
Window window = getWindow();
View view = getRootView();
if (view != null && window != null) {
View animatedView = getDialog().isFullscreen() ? window.getDecorView() : view;
if (animation instanceof FadeAnimation) {
FadeAnimation fadeAnimation = (FadeAnimation) animation;
ViewPropertyAnimator animator =
createAnimator(animatedView, fadeAnimation, listener, true);
if (animator != null) {
animator.start();
return true;
}
} else if (animation instanceof RectangleRevealAnimation) {
RectangleRevealAnimation rectangleRevealAnimation =
(RectangleRevealAnimation) animation;
ViewPropertyAnimator animator =
createAnimator(animatedView, rectangleRevealAnimation, listener);
if (animator != null) {
configureShowAnimator(animatedView, rectangleRevealAnimation, animator);
animator.start();
return true;
}
} else if (animation instanceof CircleRevealAnimation) {
CircleRevealAnimation circleRevealAnimation = (CircleRevealAnimation) animation;
Animator animator = createAnimator(window.getDecorView(), animatedView,
circleRevealAnimation, listener, true);
if (animator != null) {
animator.start();
return true;
}
} else {
throw new RuntimeException(
"Unknown type of animation: " + animation.getClass().getSimpleName());
}
}
}
return false;
} | class class_name[name] begin[{]
method[showAnimated, return_type[type[boolean]], modifier[final public], parameter[animation, listener]] begin[{]
assign[member[.hidden], literal[false]]
if[binary_operation[member[.animation], !=, literal[null]]] begin[{]
local_variable[type[Window], window]
local_variable[type[View], view]
if[binary_operation[binary_operation[member[.view], !=, literal[null]], &&, binary_operation[member[.window], !=, literal[null]]]] begin[{]
local_variable[type[View], animatedView]
if[binary_operation[member[.animation], instanceof, type[FadeAnimation]]] begin[{]
local_variable[type[FadeAnimation], fadeAnimation]
local_variable[type[ViewPropertyAnimator], animator]
if[binary_operation[member[.animator], !=, literal[null]]] begin[{]
call[animator.start, parameter[]]
return[literal[true]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[.animation], instanceof, type[RectangleRevealAnimation]]] begin[{]
local_variable[type[RectangleRevealAnimation], rectangleRevealAnimation]
local_variable[type[ViewPropertyAnimator], animator]
if[binary_operation[member[.animator], !=, literal[null]]] begin[{]
call[.configureShowAnimator, parameter[member[.animatedView], member[.rectangleRevealAnimation], member[.animator]]]
call[animator.start, parameter[]]
return[literal[true]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[.animation], instanceof, type[CircleRevealAnimation]]] begin[{]
local_variable[type[CircleRevealAnimation], circleRevealAnimation]
local_variable[type[Animator], animator]
if[binary_operation[member[.animator], !=, literal[null]]] begin[{]
call[animator.start, parameter[]]
return[literal[true]]
else begin[{]
None
end[}]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown type of animation: "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=animation, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[boolean] identifier[showAnimated] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[DialogAnimation] identifier[animation] , annotation[@] identifier[Nullable] Keyword[final] identifier[AnimatorListener] identifier[listener] operator[SEP] {
identifier[hidden] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[animation] operator[!=] Other[null] operator[SEP] {
identifier[Window] identifier[window] operator[=] identifier[getWindow] operator[SEP] operator[SEP] operator[SEP] identifier[View] identifier[view] operator[=] identifier[getRootView] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[view] operator[!=] Other[null] operator[&&] identifier[window] operator[!=] Other[null] operator[SEP] {
identifier[View] identifier[animatedView] operator[=] identifier[getDialog] operator[SEP] operator[SEP] operator[SEP] identifier[isFullscreen] operator[SEP] operator[SEP] operator[?] identifier[window] operator[SEP] identifier[getDecorView] operator[SEP] operator[SEP] operator[:] identifier[view] operator[SEP] Keyword[if] operator[SEP] identifier[animation] Keyword[instanceof] identifier[FadeAnimation] operator[SEP] {
identifier[FadeAnimation] identifier[fadeAnimation] operator[=] operator[SEP] identifier[FadeAnimation] operator[SEP] identifier[animation] operator[SEP] identifier[ViewPropertyAnimator] identifier[animator] operator[=] identifier[createAnimator] operator[SEP] identifier[animatedView] , identifier[fadeAnimation] , identifier[listener] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[animator] operator[!=] Other[null] operator[SEP] {
identifier[animator] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[animation] Keyword[instanceof] identifier[RectangleRevealAnimation] operator[SEP] {
identifier[RectangleRevealAnimation] identifier[rectangleRevealAnimation] operator[=] operator[SEP] identifier[RectangleRevealAnimation] operator[SEP] identifier[animation] operator[SEP] identifier[ViewPropertyAnimator] identifier[animator] operator[=] identifier[createAnimator] operator[SEP] identifier[animatedView] , identifier[rectangleRevealAnimation] , identifier[listener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[animator] operator[!=] Other[null] operator[SEP] {
identifier[configureShowAnimator] operator[SEP] identifier[animatedView] , identifier[rectangleRevealAnimation] , identifier[animator] operator[SEP] operator[SEP] identifier[animator] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[animation] Keyword[instanceof] identifier[CircleRevealAnimation] operator[SEP] {
identifier[CircleRevealAnimation] identifier[circleRevealAnimation] operator[=] operator[SEP] identifier[CircleRevealAnimation] operator[SEP] identifier[animation] operator[SEP] identifier[Animator] identifier[animator] operator[=] identifier[createAnimator] operator[SEP] identifier[window] operator[SEP] identifier[getDecorView] operator[SEP] operator[SEP] , identifier[animatedView] , identifier[circleRevealAnimation] , identifier[listener] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[animator] operator[!=] Other[null] operator[SEP] {
identifier[animator] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[animation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private boolean addManifestClassPath(List<String> scannedJars,
List<String> newJars,
JarURLConnection jconn){
Manifest manifest;
try {
manifest = jconn.getManifest();
} catch (IOException ex) {
// Maybe non existing jar, ignored
return false;
}
String file = jconn.getJarFileURL().toString();
if (! file.contains("WEB-INF")) {
// Only jar in WEB-INF is considered here
return true;
}
if (manifest == null)
return true;
java.util.jar.Attributes attrs = manifest.getMainAttributes();
String cp = (String) attrs.getValue("Class-Path");
if (cp == null)
return true;
String[] paths = cp.split(" ");
int lastIndex = file.lastIndexOf('/');
if (lastIndex < 0) {
lastIndex = file.lastIndexOf('\\');
}
String baseDir = "";
if (lastIndex > 0) {
baseDir = file.substring(0, lastIndex+1);
}
for (String path: paths) {
String p;
if (path.startsWith("/") || path.startsWith("\\")){
p = "file:" + path;
} else {
p = baseDir + path;
}
if ((scannedJars == null || !scannedJars.contains(p)) &&
!newJars.contains(p) ){
newJars.add(p);
}
}
return true;
} | class class_name[name] begin[{]
method[addManifestClassPath, return_type[type[boolean]], modifier[private], parameter[scannedJars, newJars, jconn]] begin[{]
local_variable[type[Manifest], manifest]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=manifest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getManifest, postfix_operators=[], prefix_operators=[], qualifier=jconn, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None)
local_variable[type[String], file]
if[call[file.contains, parameter[literal["WEB-INF"]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
if[binary_operation[member[.manifest], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[java], attrs]
local_variable[type[String], cp]
if[binary_operation[member[.cp], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[String], paths]
local_variable[type[int], lastIndex]
if[binary_operation[member[.lastIndex], <, literal[0]]] begin[{]
assign[member[.lastIndex], call[file.lastIndexOf, parameter[literal['\\']]]]
else begin[{]
None
end[}]
local_variable[type[String], baseDir]
if[binary_operation[member[.lastIndex], >, literal[0]]] begin[{]
assign[member[.baseDir], call[file.substring, parameter[literal[0], binary_operation[member[.lastIndex], +, literal[1]]]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=baseDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="file:"), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=scannedJars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=scannedJars, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=newJars, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newJars, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[addManifestClassPath] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[scannedJars] , identifier[List] operator[<] identifier[String] operator[>] identifier[newJars] , identifier[JarURLConnection] identifier[jconn] operator[SEP] {
identifier[Manifest] identifier[manifest] operator[SEP] Keyword[try] {
identifier[manifest] operator[=] identifier[jconn] operator[SEP] identifier[getManifest] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[String] identifier[file] operator[=] identifier[jconn] operator[SEP] identifier[getJarFileURL] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[manifest] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[jar] operator[SEP] identifier[Attributes] identifier[attrs] operator[=] identifier[manifest] operator[SEP] identifier[getMainAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[cp] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[attrs] operator[SEP] identifier[getValue] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cp] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[paths] operator[=] identifier[cp] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[lastIndex] operator[=] identifier[file] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastIndex] operator[<] Other[0] operator[SEP] {
identifier[lastIndex] operator[=] identifier[file] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[baseDir] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[lastIndex] operator[>] Other[0] operator[SEP] {
identifier[baseDir] operator[=] identifier[file] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastIndex] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[paths] operator[SEP] {
identifier[String] identifier[p] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[p] operator[=] literal[String] operator[+] identifier[path] operator[SEP]
}
Keyword[else] {
identifier[p] operator[=] identifier[baseDir] operator[+] identifier[path] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[scannedJars] operator[==] Other[null] operator[||] operator[!] identifier[scannedJars] operator[SEP] identifier[contains] operator[SEP] identifier[p] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[newJars] operator[SEP] identifier[contains] operator[SEP] identifier[p] operator[SEP] operator[SEP] {
identifier[newJars] operator[SEP] identifier[add] operator[SEP] identifier[p] operator[SEP] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public Map<String, Float> getTermAndRank(List<Term> termList)
{
List<String> wordList = new ArrayList<String>(termList.size());
for (Term t : termList)
{
if (shouldInclude(t))
{
wordList.add(t.word);
}
}
// System.out.println(wordList);
Map<String, Set<String>> words = new TreeMap<String, Set<String>>();
Queue<String> que = new LinkedList<String>();
for (String w : wordList)
{
if (!words.containsKey(w))
{
words.put(w, new TreeSet<String>());
}
// 复杂度O(n-1)
if (que.size() >= 5)
{
que.poll();
}
for (String qWord : que)
{
if (w.equals(qWord))
{
continue;
}
//既然是邻居,那么关系是相互的,遍历一遍即可
words.get(w).add(qWord);
words.get(qWord).add(w);
}
que.offer(w);
}
// System.out.println(words);
Map<String, Float> score = new HashMap<String, Float>();
//依据TF来设置初值
for (Map.Entry<String, Set<String>> entry : words.entrySet())
{
score.put(entry.getKey(), sigMoid(entry.getValue().size()));
}
for (int i = 0; i < max_iter; ++i)
{
Map<String, Float> m = new HashMap<String, Float>();
float max_diff = 0;
for (Map.Entry<String, Set<String>> entry : words.entrySet())
{
String key = entry.getKey();
Set<String> value = entry.getValue();
m.put(key, 1 - d);
for (String element : value)
{
int size = words.get(element).size();
if (key.equals(element) || size == 0) continue;
m.put(key, m.get(key) + d / size * (score.get(element) == null ? 0 : score.get(element)));
}
max_diff = Math.max(max_diff, Math.abs(m.get(key) - (score.get(key) == null ? 0 : score.get(key))));
}
score = m;
if (max_diff <= min_diff) break;
}
return score;
} | class class_name[name] begin[{]
method[getTermAndRank, return_type[type[Map]], modifier[public], parameter[termList]] begin[{]
local_variable[type[List], wordList]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shouldInclude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=wordList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=termList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Term, sub_type=None))), label=None)
local_variable[type[Map], words]
local_variable[type[Queue], que]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=words, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=TreeSet, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=que, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=poll, postfix_operators=[], prefix_operators=[], qualifier=que, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=qWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[MethodInvocation(arguments=[MemberReference(member=qWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=qWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=que, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=qWord)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=offer, postfix_operators=[], prefix_operators=[], qualifier=que, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=wordList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=w)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
local_variable[type[Map], score]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=sigMoid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), name=m)], 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=Float, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=max_diff)], modifiers=set(), type=BasicType(dimensions=[], name=float)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=put, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), operator=*), operator=+)], member=put, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=max_diff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=max_diff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), operandr=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=max_diff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min_diff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max_iter, 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)
return[member[.score]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Float] operator[>] identifier[getTermAndRank] operator[SEP] identifier[List] operator[<] identifier[Term] operator[>] identifier[termList] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[wordList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[termList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Term] identifier[t] operator[:] identifier[termList] operator[SEP] {
Keyword[if] operator[SEP] identifier[shouldInclude] operator[SEP] identifier[t] operator[SEP] operator[SEP] {
identifier[wordList] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] identifier[word] operator[SEP] operator[SEP]
}
}
identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[words] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Queue] operator[<] identifier[String] operator[>] identifier[que] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[w] operator[:] identifier[wordList] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[words] operator[SEP] identifier[containsKey] operator[SEP] identifier[w] operator[SEP] operator[SEP] {
identifier[words] operator[SEP] identifier[put] operator[SEP] identifier[w] , Keyword[new] identifier[TreeSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[que] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>=] Other[5] operator[SEP] {
identifier[que] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[qWord] operator[:] identifier[que] operator[SEP] {
Keyword[if] operator[SEP] identifier[w] operator[SEP] identifier[equals] operator[SEP] identifier[qWord] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[words] operator[SEP] identifier[get] operator[SEP] identifier[w] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[qWord] operator[SEP] operator[SEP] identifier[words] operator[SEP] identifier[get] operator[SEP] identifier[qWord] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[w] operator[SEP] operator[SEP]
}
identifier[que] operator[SEP] identifier[offer] operator[SEP] identifier[w] operator[SEP] operator[SEP]
}
identifier[Map] operator[<] identifier[String] , identifier[Float] operator[>] identifier[score] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Float] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[words] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[score] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[sigMoid] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[max_iter] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Float] operator[>] identifier[m] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Float] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[max_diff] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[words] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[key] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[value] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[m] operator[SEP] identifier[put] operator[SEP] identifier[key] , Other[1] operator[-] identifier[d] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[element] operator[:] identifier[value] operator[SEP] {
Keyword[int] identifier[size] operator[=] identifier[words] operator[SEP] identifier[get] operator[SEP] identifier[element] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[element] operator[SEP] operator[||] identifier[size] operator[==] Other[0] operator[SEP] Keyword[continue] operator[SEP] identifier[m] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[m] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[+] identifier[d] operator[/] identifier[size] operator[*] operator[SEP] identifier[score] operator[SEP] identifier[get] operator[SEP] identifier[element] operator[SEP] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[score] operator[SEP] identifier[get] operator[SEP] identifier[element] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[max_diff] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[max_diff] , identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[m] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[-] operator[SEP] identifier[score] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[score] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[score] operator[=] identifier[m] operator[SEP] Keyword[if] operator[SEP] identifier[max_diff] operator[<=] identifier[min_diff] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[return] identifier[score] operator[SEP]
}
|
public static HttpURLConnection copyFrom(final URI uri, final FileRequestOptions fileOptions,
final OperationContext opContext, final AccessCondition sourceAccessCondition,
final AccessCondition destinationAccessCondition, String source)
throws StorageException, IOException, URISyntaxException {
final HttpURLConnection request = BaseRequest.createURLConnection(uri, fileOptions, null, opContext);
request.setFixedLengthStreamingMode(0);
request.setDoOutput(true);
request.setRequestMethod(Constants.HTTP_PUT);
request.setRequestProperty(Constants.HeaderConstants.COPY_SOURCE_HEADER, source);
if (sourceAccessCondition != null) {
sourceAccessCondition.applyConditionToRequest(request);
}
if (destinationAccessCondition != null) {
destinationAccessCondition.applyConditionToRequest(request);
}
return request;
} | class class_name[name] begin[{]
method[copyFrom, return_type[type[HttpURLConnection]], modifier[public static], parameter[uri, fileOptions, opContext, sourceAccessCondition, destinationAccessCondition, source]] begin[{]
local_variable[type[HttpURLConnection], request]
call[request.setFixedLengthStreamingMode, parameter[literal[0]]]
call[request.setDoOutput, parameter[literal[true]]]
call[request.setRequestMethod, parameter[member[Constants.HTTP_PUT]]]
call[request.setRequestProperty, parameter[member[Constants.HeaderConstants.COPY_SOURCE_HEADER], member[.source]]]
if[binary_operation[member[.sourceAccessCondition], !=, literal[null]]] begin[{]
call[sourceAccessCondition.applyConditionToRequest, parameter[member[.request]]]
else begin[{]
None
end[}]
if[binary_operation[member[.destinationAccessCondition], !=, literal[null]]] begin[{]
call[destinationAccessCondition.applyConditionToRequest, parameter[member[.request]]]
else begin[{]
None
end[}]
return[member[.request]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[HttpURLConnection] identifier[copyFrom] operator[SEP] Keyword[final] identifier[URI] identifier[uri] , Keyword[final] identifier[FileRequestOptions] identifier[fileOptions] , Keyword[final] identifier[OperationContext] identifier[opContext] , Keyword[final] identifier[AccessCondition] identifier[sourceAccessCondition] , Keyword[final] identifier[AccessCondition] identifier[destinationAccessCondition] , identifier[String] identifier[source] operator[SEP] Keyword[throws] identifier[StorageException] , identifier[IOException] , identifier[URISyntaxException] {
Keyword[final] identifier[HttpURLConnection] identifier[request] operator[=] identifier[BaseRequest] operator[SEP] identifier[createURLConnection] operator[SEP] identifier[uri] , identifier[fileOptions] , Other[null] , identifier[opContext] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setFixedLengthStreamingMode] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setRequestMethod] operator[SEP] identifier[Constants] operator[SEP] identifier[HTTP_PUT] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[COPY_SOURCE_HEADER] , identifier[source] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sourceAccessCondition] operator[!=] Other[null] operator[SEP] {
identifier[sourceAccessCondition] operator[SEP] identifier[applyConditionToRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[destinationAccessCondition] operator[!=] Other[null] operator[SEP] {
identifier[destinationAccessCondition] operator[SEP] identifier[applyConditionToRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
Keyword[return] identifier[request] operator[SEP]
}
|
public Formula not(final Formula operand) {
if (operand.type() == LITERAL || operand.type() == FALSE || operand.type() == TRUE || operand.type() == NOT)
return operand.negate();
Not not = this.nots.get(operand);
if (not == null) {
not = new Not(operand, this);
this.nots.put(operand, not);
}
return not;
} | class class_name[name] begin[{]
method[not, return_type[type[Formula]], modifier[public], parameter[operand]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[call[operand.type, parameter[]], ==, member[.LITERAL]], ||, binary_operation[call[operand.type, parameter[]], ==, member[.FALSE]]], ||, binary_operation[call[operand.type, parameter[]], ==, member[.TRUE]]], ||, binary_operation[call[operand.type, parameter[]], ==, member[.NOT]]]] begin[{]
return[call[operand.negate, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[Not], not]
if[binary_operation[member[.not], ==, literal[null]]] begin[{]
assign[member[.not], ClassCreator(arguments=[MemberReference(member=operand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Not, sub_type=None))]
THIS[member[None.nots]call[None.put, parameter[member[.operand], member[.not]]]]
else begin[{]
None
end[}]
return[member[.not]]
end[}]
END[}] | Keyword[public] identifier[Formula] identifier[not] operator[SEP] Keyword[final] identifier[Formula] identifier[operand] operator[SEP] {
Keyword[if] operator[SEP] identifier[operand] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[LITERAL] operator[||] identifier[operand] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[FALSE] operator[||] identifier[operand] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[TRUE] operator[||] identifier[operand] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[NOT] operator[SEP] Keyword[return] identifier[operand] operator[SEP] identifier[negate] operator[SEP] operator[SEP] operator[SEP] identifier[Not] identifier[not] operator[=] Keyword[this] operator[SEP] identifier[nots] operator[SEP] identifier[get] operator[SEP] identifier[operand] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[not] operator[==] Other[null] operator[SEP] {
identifier[not] operator[=] Keyword[new] identifier[Not] operator[SEP] identifier[operand] , Keyword[this] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[nots] operator[SEP] identifier[put] operator[SEP] identifier[operand] , identifier[not] operator[SEP] operator[SEP]
}
Keyword[return] identifier[not] operator[SEP]
}
|
public void copyResource(
CmsDbContext dbc,
CmsResource source,
String destination,
CmsResource.CmsResourceCopyMode siblingMode)
throws CmsException, CmsIllegalArgumentException {
// check the sibling mode to see if this resource has to be copied as a sibling
boolean copyAsSibling = false;
// siblings of folders are not supported
if (!source.isFolder()) {
// if the "copy as sibling" mode is used, set the flag to true
if (siblingMode == CmsResource.COPY_AS_SIBLING) {
copyAsSibling = true;
}
// if the mode is "preserve siblings", we have to check the sibling counter
if (siblingMode == CmsResource.COPY_PRESERVE_SIBLING) {
if (source.getSiblingCount() > 1) {
copyAsSibling = true;
}
}
}
// read the source properties
List<CmsProperty> properties = readPropertyObjects(dbc, source, false);
if (copyAsSibling) {
// create a sibling of the source file at the destination
createSibling(dbc, source, destination, properties);
// after the sibling is created the copy operation is finished
return;
}
// prepare the content if required
byte[] content = null;
if (source.isFile()) {
if (source instanceof CmsFile) {
// resource already is a file
content = ((CmsFile)source).getContents();
}
if ((content == null) || (content.length < 1)) {
// no known content yet - read from database
content = getVfsDriver(dbc).readContent(dbc, dbc.currentProject().getUuid(), source.getResourceId());
}
}
// determine destination folder
String destinationFoldername = CmsResource.getParentFolder(destination);
// read the destination folder (will also check read permissions)
CmsFolder destinationFolder = m_securityManager.readFolder(
dbc,
destinationFoldername,
CmsResourceFilter.IGNORE_EXPIRATION);
// no further permission check required here, will be done in createResource()
// set user and creation time stamps
long currentTime = System.currentTimeMillis();
long dateLastModified;
CmsUUID userLastModified;
if (source.isFolder()) {
// folders always get a new date and user when they are copied
dateLastModified = currentTime;
userLastModified = dbc.currentUser().getId();
} else {
// files keep the date and user last modified from the source
dateLastModified = source.getDateLastModified();
userLastModified = source.getUserLastModified();
}
// check the resource flags
int flags = source.getFlags();
if (source.isLabeled()) {
// reset "labeled" link flag for new resource
flags &= ~CmsResource.FLAG_LABELED;
}
// create the new resource
CmsResource newResource = new CmsResource(
new CmsUUID(),
new CmsUUID(),
destination,
source.getTypeId(),
source.isFolder(),
flags,
dbc.currentProject().getUuid(),
CmsResource.STATE_NEW,
currentTime,
dbc.currentUser().getId(),
dateLastModified,
userLastModified,
source.getDateReleased(),
source.getDateExpired(),
1,
source.getLength(),
source.getDateContent(),
source.getVersion()); // version number does not matter since it will be computed later
// trigger "is touched" state on resource (will ensure modification date is kept unchanged)
newResource.setDateLastModified(dateLastModified);
// log it
log(
dbc,
new CmsLogEntry(
dbc,
newResource.getStructureId(),
CmsLogEntryType.RESOURCE_COPIED,
new String[] {newResource.getRootPath()}),
false);
// create the resource
newResource = createResource(dbc, destination, newResource, content, properties, false);
// copy relations
copyRelations(dbc, source, newResource);
// copy the access control entries to the created resource
copyAccessControlEntries(dbc, source, newResource, false);
// clear the cache
m_monitor.clearAccessControlListCache();
List<CmsResource> modifiedResources = new ArrayList<CmsResource>();
modifiedResources.add(source);
modifiedResources.add(newResource);
modifiedResources.add(destinationFolder);
OpenCms.fireCmsEvent(
new CmsEvent(
I_CmsEventListener.EVENT_RESOURCE_COPIED,
Collections.<String, Object> singletonMap(I_CmsEventListener.KEY_RESOURCES, modifiedResources)));
} | class class_name[name] begin[{]
method[copyResource, return_type[void], modifier[public], parameter[dbc, source, destination, siblingMode]] begin[{]
local_variable[type[boolean], copyAsSibling]
if[call[source.isFolder, parameter[]]] begin[{]
if[binary_operation[member[.siblingMode], ==, member[CmsResource.COPY_AS_SIBLING]]] begin[{]
assign[member[.copyAsSibling], literal[true]]
else begin[{]
None
end[}]
if[binary_operation[member[.siblingMode], ==, member[CmsResource.COPY_PRESERVE_SIBLING]]] begin[{]
if[binary_operation[call[source.getSiblingCount, parameter[]], >, literal[1]]] begin[{]
assign[member[.copyAsSibling], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[List], properties]
if[member[.copyAsSibling]] begin[{]
call[.createSibling, parameter[member[.dbc], member[.source], member[.destination], member[.properties]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[byte], content]
if[call[source.isFile, parameter[]]] begin[{]
if[binary_operation[member[.source], instanceof, type[CmsFile]]] begin[{]
assign[member[.content], Cast(expression=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CmsFile, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.content], ==, literal[null]], ||, binary_operation[member[content.length], <, literal[1]]]] begin[{]
assign[member[.content], call[.getVfsDriver, parameter[member[.dbc]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[String], destinationFoldername]
local_variable[type[CmsFolder], destinationFolder]
local_variable[type[long], currentTime]
local_variable[type[long], dateLastModified]
local_variable[type[CmsUUID], userLastModified]
if[call[source.isFolder, parameter[]]] begin[{]
assign[member[.dateLastModified], member[.currentTime]]
assign[member[.userLastModified], call[dbc.currentUser, parameter[]]]
else begin[{]
assign[member[.dateLastModified], call[source.getDateLastModified, parameter[]]]
assign[member[.userLastModified], call[source.getUserLastModified, parameter[]]]
end[}]
local_variable[type[int], flags]
if[call[source.isLabeled, parameter[]]] begin[{]
assign[member[.flags], member[CmsResource.FLAG_LABELED]]
else begin[{]
None
end[}]
local_variable[type[CmsResource], newResource]
call[newResource.setDateLastModified, parameter[member[.dateLastModified]]]
call[.log, parameter[member[.dbc], ClassCreator(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=newResource, selectors=[], type_arguments=None), MemberReference(member=RESOURCE_COPIED, postfix_operators=[], prefix_operators=[], qualifier=CmsLogEntryType, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=newResource, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsLogEntry, sub_type=None)), literal[false]]]
assign[member[.newResource], call[.createResource, parameter[member[.dbc], member[.destination], member[.newResource], member[.content], member[.properties], literal[false]]]]
call[.copyRelations, parameter[member[.dbc], member[.source], member[.newResource]]]
call[.copyAccessControlEntries, parameter[member[.dbc], member[.source], member[.newResource], literal[false]]]
call[m_monitor.clearAccessControlListCache, parameter[]]
local_variable[type[List], modifiedResources]
call[modifiedResources.add, parameter[member[.source]]]
call[modifiedResources.add, parameter[member[.newResource]]]
call[modifiedResources.add, parameter[member[.destinationFolder]]]
call[OpenCms.fireCmsEvent, parameter[ClassCreator(arguments=[MemberReference(member=EVENT_RESOURCE_COPIED, postfix_operators=[], prefix_operators=[], qualifier=I_CmsEventListener, selectors=[]), MethodInvocation(arguments=[MemberReference(member=KEY_RESOURCES, postfix_operators=[], prefix_operators=[], qualifier=I_CmsEventListener, selectors=[]), MemberReference(member=modifiedResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_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))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsEvent, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[copyResource] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[CmsResource] identifier[source] , identifier[String] identifier[destination] , identifier[CmsResource] operator[SEP] identifier[CmsResourceCopyMode] identifier[siblingMode] operator[SEP] Keyword[throws] identifier[CmsException] , identifier[CmsIllegalArgumentException] {
Keyword[boolean] identifier[copyAsSibling] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[source] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[siblingMode] operator[==] identifier[CmsResource] operator[SEP] identifier[COPY_AS_SIBLING] operator[SEP] {
identifier[copyAsSibling] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[siblingMode] operator[==] identifier[CmsResource] operator[SEP] identifier[COPY_PRESERVE_SIBLING] operator[SEP] {
Keyword[if] operator[SEP] identifier[source] operator[SEP] identifier[getSiblingCount] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[copyAsSibling] operator[=] literal[boolean] operator[SEP]
}
}
}
identifier[List] operator[<] identifier[CmsProperty] operator[>] identifier[properties] operator[=] identifier[readPropertyObjects] operator[SEP] identifier[dbc] , identifier[source] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[copyAsSibling] operator[SEP] {
identifier[createSibling] operator[SEP] identifier[dbc] , identifier[source] , identifier[destination] , identifier[properties] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[content] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[source] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[source] Keyword[instanceof] identifier[CmsFile] operator[SEP] {
identifier[content] operator[=] operator[SEP] operator[SEP] identifier[CmsFile] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[getContents] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[content] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[content] operator[SEP] identifier[length] operator[<] Other[1] operator[SEP] operator[SEP] {
identifier[content] operator[=] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readContent] operator[SEP] identifier[dbc] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] , identifier[source] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[String] identifier[destinationFoldername] operator[=] identifier[CmsResource] operator[SEP] identifier[getParentFolder] operator[SEP] identifier[destination] operator[SEP] operator[SEP] identifier[CmsFolder] identifier[destinationFolder] operator[=] identifier[m_securityManager] operator[SEP] identifier[readFolder] operator[SEP] identifier[dbc] , identifier[destinationFoldername] , identifier[CmsResourceFilter] operator[SEP] identifier[IGNORE_EXPIRATION] operator[SEP] operator[SEP] Keyword[long] identifier[currentTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[dateLastModified] operator[SEP] identifier[CmsUUID] identifier[userLastModified] operator[SEP] Keyword[if] operator[SEP] identifier[source] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] operator[SEP] {
identifier[dateLastModified] operator[=] identifier[currentTime] operator[SEP] identifier[userLastModified] operator[=] identifier[dbc] operator[SEP] identifier[currentUser] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[dateLastModified] operator[=] identifier[source] operator[SEP] identifier[getDateLastModified] operator[SEP] operator[SEP] operator[SEP] identifier[userLastModified] operator[=] identifier[source] operator[SEP] identifier[getUserLastModified] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[int] identifier[flags] operator[=] identifier[source] operator[SEP] identifier[getFlags] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[source] operator[SEP] identifier[isLabeled] operator[SEP] operator[SEP] operator[SEP] {
identifier[flags] operator[&=] operator[~] identifier[CmsResource] operator[SEP] identifier[FLAG_LABELED] operator[SEP]
}
identifier[CmsResource] identifier[newResource] operator[=] Keyword[new] identifier[CmsResource] operator[SEP] Keyword[new] identifier[CmsUUID] operator[SEP] operator[SEP] , Keyword[new] identifier[CmsUUID] operator[SEP] operator[SEP] , identifier[destination] , identifier[source] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] , identifier[source] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] , identifier[flags] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] , identifier[CmsResource] operator[SEP] identifier[STATE_NEW] , identifier[currentTime] , identifier[dbc] operator[SEP] identifier[currentUser] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[dateLastModified] , identifier[userLastModified] , identifier[source] operator[SEP] identifier[getDateReleased] operator[SEP] operator[SEP] , identifier[source] operator[SEP] identifier[getDateExpired] operator[SEP] operator[SEP] , Other[1] , identifier[source] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] , identifier[source] operator[SEP] identifier[getDateContent] operator[SEP] operator[SEP] , identifier[source] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[newResource] operator[SEP] identifier[setDateLastModified] operator[SEP] identifier[dateLastModified] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[dbc] , Keyword[new] identifier[CmsLogEntry] operator[SEP] identifier[dbc] , identifier[newResource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] , identifier[CmsLogEntryType] operator[SEP] identifier[RESOURCE_COPIED] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[newResource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP]
} operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[newResource] operator[=] identifier[createResource] operator[SEP] identifier[dbc] , identifier[destination] , identifier[newResource] , identifier[content] , identifier[properties] , literal[boolean] operator[SEP] operator[SEP] identifier[copyRelations] operator[SEP] identifier[dbc] , identifier[source] , identifier[newResource] operator[SEP] operator[SEP] identifier[copyAccessControlEntries] operator[SEP] identifier[dbc] , identifier[source] , identifier[newResource] , literal[boolean] operator[SEP] operator[SEP] identifier[m_monitor] operator[SEP] identifier[clearAccessControlListCache] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[modifiedResources] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsResource] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[modifiedResources] operator[SEP] identifier[add] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[modifiedResources] operator[SEP] identifier[add] operator[SEP] identifier[newResource] operator[SEP] operator[SEP] identifier[modifiedResources] operator[SEP] identifier[add] operator[SEP] identifier[destinationFolder] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[fireCmsEvent] operator[SEP] Keyword[new] identifier[CmsEvent] operator[SEP] identifier[I_CmsEventListener] operator[SEP] identifier[EVENT_RESOURCE_COPIED] , identifier[Collections] operator[SEP] operator[<] identifier[String] , identifier[Object] operator[>] identifier[singletonMap] operator[SEP] identifier[I_CmsEventListener] operator[SEP] identifier[KEY_RESOURCES] , identifier[modifiedResources] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void encrypt(PdfReader reader, OutputStream os, byte userPassword[], byte ownerPassword[], int permissions, boolean strength128Bits) throws DocumentException, IOException {
PdfStamper stamper = new PdfStamper(reader, os);
stamper.setEncryption(userPassword, ownerPassword, permissions, strength128Bits);
stamper.close();
} | class class_name[name] begin[{]
method[encrypt, return_type[void], modifier[public static], parameter[reader, os, userPassword, ownerPassword, permissions, strength128Bits]] begin[{]
local_variable[type[PdfStamper], stamper]
call[stamper.setEncryption, parameter[member[.userPassword], member[.ownerPassword], member[.permissions], member[.strength128Bits]]]
call[stamper.close, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[encrypt] operator[SEP] identifier[PdfReader] identifier[reader] , identifier[OutputStream] identifier[os] , Keyword[byte] identifier[userPassword] operator[SEP] operator[SEP] , Keyword[byte] identifier[ownerPassword] operator[SEP] operator[SEP] , Keyword[int] identifier[permissions] , Keyword[boolean] identifier[strength128Bits] operator[SEP] Keyword[throws] identifier[DocumentException] , identifier[IOException] {
identifier[PdfStamper] identifier[stamper] operator[=] Keyword[new] identifier[PdfStamper] operator[SEP] identifier[reader] , identifier[os] operator[SEP] operator[SEP] identifier[stamper] operator[SEP] identifier[setEncryption] operator[SEP] identifier[userPassword] , identifier[ownerPassword] , identifier[permissions] , identifier[strength128Bits] operator[SEP] operator[SEP] identifier[stamper] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
|
void addManagementGraph(final JobID jobID, final ManagementGraph managementGraph) {
synchronized (this.recentManagementGraphs) {
this.recentManagementGraphs.put(jobID, managementGraph);
}
} | class class_name[name] begin[{]
method[addManagementGraph, return_type[void], modifier[default], parameter[jobID, managementGraph]] begin[{]
SYNCHRONIZED[THIS[member[None.recentManagementGraphs]]] BEGIN[{]
THIS[member[None.recentManagementGraphs]call[None.put, parameter[member[.jobID], member[.managementGraph]]]]
END[}]
end[}]
END[}] | Keyword[void] identifier[addManagementGraph] operator[SEP] Keyword[final] identifier[JobID] identifier[jobID] , Keyword[final] identifier[ManagementGraph] identifier[managementGraph] operator[SEP] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[recentManagementGraphs] operator[SEP] {
Keyword[this] operator[SEP] identifier[recentManagementGraphs] operator[SEP] identifier[put] operator[SEP] identifier[jobID] , identifier[managementGraph] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
private static <T> Node<T>[] genericNodeArray(int size) {
return (Node<T>[]) new Node<?>[size];
} | class class_name[name] begin[{]
method[genericNodeArray, return_type[type[Node]], modifier[private static], parameter[size]] begin[{]
return[Cast(expression=ArrayCreator(dimensions=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Node, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[None], name=Node, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[Node] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] identifier[genericNodeArray] operator[SEP] Keyword[int] identifier[size] operator[SEP] {
Keyword[return] operator[SEP] identifier[Node] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[Node] operator[<] operator[?] operator[>] operator[SEP] identifier[size] operator[SEP] operator[SEP]
}
|
public static String recommend(BitmapStatistics s) {
if (s.containerCount() == 0) {
return "Empty statistics, cannot recommend.";
}
StringBuilder sb = new StringBuilder();
containerCountRecommendations(s, sb);
double acFraction = s.containerFraction(s.getArrayContainersStats().getContainersCount());
if (acFraction > ArrayContainersDomination) {
if (s.getArrayContainersStats().averageCardinality() < WorthUsingArraysCardinalityThreshold) {
arrayContainerRecommendations(s, sb);
} else {
denseArrayWarning(sb);
constantMemoryRecommendation(s, sb);
}
} else if (s.containerFraction(s.getRunContainerCount()) > RunContainersDomination) {
runContainerRecommendations(sb);
} else {
constantMemoryRecommendation(s, sb);
}
return sb.toString();
} | class class_name[name] begin[{]
method[recommend, return_type[type[String]], modifier[public static], parameter[s]] begin[{]
if[binary_operation[call[s.containerCount, parameter[]], ==, literal[0]]] begin[{]
return[literal["Empty statistics, cannot recommend."]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], sb]
call[.containerCountRecommendations, parameter[member[.s], member[.sb]]]
local_variable[type[double], acFraction]
if[binary_operation[member[.acFraction], >, member[.ArrayContainersDomination]]] begin[{]
if[binary_operation[call[s.getArrayContainersStats, parameter[]], <, member[.WorthUsingArraysCardinalityThreshold]]] begin[{]
call[.arrayContainerRecommendations, parameter[member[.s], member[.sb]]]
else begin[{]
call[.denseArrayWarning, parameter[member[.sb]]]
call[.constantMemoryRecommendation, parameter[member[.s], member[.sb]]]
end[}]
else begin[{]
if[binary_operation[call[s.containerFraction, parameter[call[s.getRunContainerCount, parameter[]]]], >, member[.RunContainersDomination]]] begin[{]
call[.runContainerRecommendations, parameter[member[.sb]]]
else begin[{]
call[.constantMemoryRecommendation, parameter[member[.s], member[.sb]]]
end[}]
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[recommend] operator[SEP] identifier[BitmapStatistics] identifier[s] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[containerCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[containerCountRecommendations] operator[SEP] identifier[s] , identifier[sb] operator[SEP] operator[SEP] Keyword[double] identifier[acFraction] operator[=] identifier[s] operator[SEP] identifier[containerFraction] operator[SEP] identifier[s] operator[SEP] identifier[getArrayContainersStats] operator[SEP] operator[SEP] operator[SEP] identifier[getContainersCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[acFraction] operator[>] identifier[ArrayContainersDomination] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[getArrayContainersStats] operator[SEP] operator[SEP] operator[SEP] identifier[averageCardinality] operator[SEP] operator[SEP] operator[<] identifier[WorthUsingArraysCardinalityThreshold] operator[SEP] {
identifier[arrayContainerRecommendations] operator[SEP] identifier[s] , identifier[sb] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[denseArrayWarning] operator[SEP] identifier[sb] operator[SEP] operator[SEP] identifier[constantMemoryRecommendation] operator[SEP] identifier[s] , identifier[sb] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[containerFraction] operator[SEP] identifier[s] operator[SEP] identifier[getRunContainerCount] operator[SEP] operator[SEP] operator[SEP] operator[>] identifier[RunContainersDomination] operator[SEP] {
identifier[runContainerRecommendations] operator[SEP] identifier[sb] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[constantMemoryRecommendation] operator[SEP] identifier[s] , identifier[sb] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(DeleteAgentRequest deleteAgentRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteAgentRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteAgentRequest.getAgentArn(), AGENTARN_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[deleteAgentRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deleteAgentRequest], ==, 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=getAgentArn, postfix_operators=[], prefix_operators=[], qualifier=deleteAgentRequest, selectors=[], type_arguments=None), MemberReference(member=AGENTARN_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[DeleteAgentRequest] identifier[deleteAgentRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteAgentRequest] 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[deleteAgentRequest] operator[SEP] identifier[getAgentArn] operator[SEP] operator[SEP] , identifier[AGENTARN_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 String getErrorMessage(IOException e) {
// Prefer to use message from GJRE.
GoogleJsonResponseException gjre = getJsonResponseExceptionOrNull(e);
if (gjre != null && gjre.getDetails() != null) {
return gjre.getDetails().getMessage();
}
return e.getMessage();
} | class class_name[name] begin[{]
method[getErrorMessage, return_type[type[String]], modifier[public], parameter[e]] begin[{]
local_variable[type[GoogleJsonResponseException], gjre]
if[binary_operation[binary_operation[member[.gjre], !=, literal[null]], &&, binary_operation[call[gjre.getDetails, parameter[]], !=, literal[null]]]] begin[{]
return[call[gjre.getDetails, parameter[]]]
else begin[{]
None
end[}]
return[call[e.getMessage, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getErrorMessage] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[GoogleJsonResponseException] identifier[gjre] operator[=] identifier[getJsonResponseExceptionOrNull] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gjre] operator[!=] Other[null] operator[&&] identifier[gjre] operator[SEP] identifier[getDetails] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[gjre] operator[SEP] identifier[getDetails] operator[SEP] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP]
}
|
public UrlBuilder withPath(String path) {
if (path == null || path.isEmpty()) {
this.path = null;
} else {
with(path, UrlTokenizerState.PATH);
}
return this;
} | class class_name[name] begin[{]
method[withPath, return_type[type[UrlBuilder]], modifier[public], parameter[path]] begin[{]
if[binary_operation[binary_operation[member[.path], ==, literal[null]], ||, call[path.isEmpty, parameter[]]]] begin[{]
assign[THIS[member[None.path]], literal[null]]
else begin[{]
call[.with, parameter[member[.path], member[UrlTokenizerState.PATH]]]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[UrlBuilder] identifier[withPath] operator[SEP] identifier[String] identifier[path] operator[SEP] {
Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[||] identifier[path] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[path] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
identifier[with] operator[SEP] identifier[path] , identifier[UrlTokenizerState] operator[SEP] identifier[PATH] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public boolean recordImplicitCast() {
if (!currentInfo.isImplicitCast()) {
currentInfo.setImplicitCast(true);
populated = true;
return true;
} else {
return false;
}
} | class class_name[name] begin[{]
method[recordImplicitCast, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[call[currentInfo.isImplicitCast, parameter[]]] begin[{]
call[currentInfo.setImplicitCast, parameter[literal[true]]]
assign[member[.populated], literal[true]]
return[literal[true]]
else begin[{]
return[literal[false]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[recordImplicitCast] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[currentInfo] operator[SEP] identifier[isImplicitCast] operator[SEP] operator[SEP] operator[SEP] {
identifier[currentInfo] operator[SEP] identifier[setImplicitCast] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[populated] operator[=] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public void distributedProcess(ResponseBuilder rb, ComponentFields mtasFields)
throws IOException {
// System.out.println("collection: " + System.nanoTime() + " - "
// + Thread.currentThread().getId() + " - "
// + rb.req.getParams().getBool("isShard", false) + " DISTRIBUTEDPROCESS "
// + rb.stage + " " + rb.req.getParamString());
NamedList<Object> mtasResponse = null;
try {
mtasResponse = (NamedList<Object>) rb.rsp.getValues()
.get(MtasSolrSearchComponent.NAME);
} catch (ClassCastException e) {
log.debug(e);
mtasResponse = null;
}
if (mtasResponse != null) {
if (rb.stage == MtasSolrSearchComponent.STAGE_COLLECTION_INIT) {
// build index
Map<String, MtasSolrCollectionResult> index = new HashMap<>();
ArrayList<Object> mtasResponseCollection;
try {
mtasResponseCollection = (ArrayList<Object>) mtasResponse.get(NAME);
for (Object item : mtasResponseCollection) {
if (item instanceof SimpleOrderedMap) {
SimpleOrderedMap<Object> itemMap = (SimpleOrderedMap<Object>) item;
if (itemMap.get("data") != null
&& itemMap.get("data") instanceof MtasSolrCollectionResult) {
MtasSolrCollectionResult collectionItem = (MtasSolrCollectionResult) itemMap
.get("data");
index.put(collectionItem.id(), collectionItem);
}
}
}
} catch (ClassCastException e) {
log.debug(e);
mtasResponse.remove(NAME);
}
// check and remove previous responses
Map<String, Set<String>> createPostAfterMissingCheckResult = new HashMap<>();
for (ShardRequest sreq : rb.finished) {
if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)
&& sreq.params.getBool(PARAM_MTAS_COLLECTION, false)) {
for (ShardResponse shardResponse : sreq.responses) {
NamedList<Object> solrShardResponse = shardResponse
.getSolrResponse().getResponse();
try {
ArrayList<SimpleOrderedMap<Object>> data = (ArrayList<SimpleOrderedMap<Object>>) solrShardResponse
.findRecursive(MtasSolrSearchComponent.NAME, NAME);
if (data != null) {
for (SimpleOrderedMap<Object> dataItem : data) {
if (dataItem.get("data") != null && dataItem
.get("data") instanceof MtasSolrCollectionResult) {
MtasSolrCollectionResult dataItemResult = (MtasSolrCollectionResult) dataItem
.get("data");
if (index.containsKey(dataItemResult.id())
&& index.get(dataItemResult.id()).action()
.equals(ComponentCollection.ACTION_CHECK)) {
if (dataItemResult.status == null) {
if (!createPostAfterMissingCheckResult
.containsKey(shardResponse.getShard())) {
createPostAfterMissingCheckResult
.put(shardResponse.getShard(), new HashSet<>());
}
createPostAfterMissingCheckResult
.get(shardResponse.getShard())
.add(dataItemResult.id());
}
}
}
}
data.clear();
}
} catch (ClassCastException e) {
log.debug(e);
// shouldn't happen
}
}
}
}
// construct new requests
HashMap<String, ModifiableSolrParams> requestParamList = new HashMap<>();
int id = 0;
for (ComponentCollection componentCollection : mtasFields.collection) {
if (componentCollection.action()
.equals(ComponentCollection.ACTION_CHECK)) {
for (String shardAddress : rb.shards) {
if (createPostAfterMissingCheckResult.containsKey(shardAddress)) {
if (createPostAfterMissingCheckResult.get(shardAddress)
.contains(componentCollection.id)) {
HashSet<String> values = searchComponent.getCollectionCache()
.getDataById(componentCollection.id);
if (values != null) {
ModifiableSolrParams paramsNewRequest;
if (!requestParamList.containsKey(shardAddress)) {
paramsNewRequest = new ModifiableSolrParams();
requestParamList.put(shardAddress, paramsNewRequest);
} else {
paramsNewRequest = requestParamList.get(shardAddress);
}
paramsNewRequest.add(
PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_KEY,
componentCollection.key);
paramsNewRequest.add(PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_ID, componentCollection.id);
paramsNewRequest.add(
PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_ACTION,
ComponentCollection.ACTION_POST);
paramsNewRequest.add(
PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_POST,
stringValuesToString(values));
id++;
}
}
}
}
} else if (componentCollection.action()
.equals(ComponentCollection.ACTION_CREATE)) {
if (componentCollection.version == null) {
componentCollection.version = searchComponent.getCollectionCache()
.create(componentCollection.id,
componentCollection.values().size(),
componentCollection.values(), null);
}
if (index.containsKey(componentCollection.id)) {
index.get(componentCollection.id).setCreate(
searchComponent.getCollectionCache().now(), searchComponent
.getCollectionCache().check(componentCollection.id));
}
for (String shardAddress : rb.shards) {
ModifiableSolrParams paramsNewRequest;
if (!requestParamList.containsKey(shardAddress)) {
paramsNewRequest = new ModifiableSolrParams();
requestParamList.put(shardAddress, paramsNewRequest);
} else {
paramsNewRequest = requestParamList.get(shardAddress);
}
paramsNewRequest.add(PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_KEY, componentCollection.key);
paramsNewRequest.add(PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_ID, componentCollection.id);
paramsNewRequest.add(
PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_ACTION,
ComponentCollection.ACTION_POST);
paramsNewRequest.add(
PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_VERSION,
componentCollection.version);
paramsNewRequest.add(
PARAM_MTAS_COLLECTION + "." + id + "."
+ NAME_MTAS_COLLECTION_POST,
stringValuesToString(componentCollection.values()));
}
}
id++;
}
// add new requests
for (Entry<String, ModifiableSolrParams> entry : requestParamList
.entrySet()) {
ShardRequest newSreq = new ShardRequest();
newSreq.shards = new String[] { entry.getKey() };
newSreq.purpose = ShardRequest.PURPOSE_PRIVATE;
newSreq.params = entry.getValue();
newSreq.params.add(CommonParams.Q, "*");
newSreq.params.add(CommonParams.ROWS, "0");
newSreq.params.add(MtasSolrSearchComponent.PARAM_MTAS,
rb.req.getOriginalParams()
.getParams(MtasSolrSearchComponent.PARAM_MTAS));
newSreq.params.add(PARAM_MTAS_COLLECTION,
rb.req.getOriginalParams().getParams(PARAM_MTAS_COLLECTION));
rb.addRequest(searchComponent, newSreq);
}
} else if (rb.stage == MtasSolrSearchComponent.STAGE_COLLECTION_FINISH) {
// just rewrite
ArrayList<Object> mtasResponseCollection;
try {
mtasResponseCollection = (ArrayList<Object>) mtasResponse.get(NAME);
if (mtasResponseCollection != null) {
MtasSolrResultUtil.rewrite(mtasResponseCollection, searchComponent);
}
} catch (ClassCastException e) {
log.debug(e);
mtasResponse.remove(NAME);
}
}
}
} | class class_name[name] begin[{]
method[distributedProcess, return_type[void], modifier[public], parameter[rb, mtasFields]] begin[{]
local_variable[type[NamedList], mtasResponse]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mtasResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getValues, postfix_operators=[], prefix_operators=[], qualifier=rb.rsp, selectors=[MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=MtasSolrSearchComponent, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=NamedList, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mtasResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.mtasResponse], !=, literal[null]]] begin[{]
if[binary_operation[member[rb.stage], ==, member[MtasSolrSearchComponent.STAGE_COLLECTION_INIT]]] begin[{]
local_variable[type[Map], index]
local_variable[type[ArrayList], mtasResponseCollection]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mtasResponseCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mtasResponse, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SimpleOrderedMap, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=SimpleOrderedMap, sub_type=None)), name=itemMap)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=SimpleOrderedMap, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data")], member=get, postfix_operators=[], prefix_operators=[], qualifier=itemMap, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data")], member=get, postfix_operators=[], prefix_operators=[], qualifier=itemMap, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=MtasSolrCollectionResult, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data")], member=get, postfix_operators=[], prefix_operators=[], qualifier=itemMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MtasSolrCollectionResult, sub_type=None)), name=collectionItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MtasSolrCollectionResult, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=id, postfix_operators=[], prefix_operators=[], qualifier=collectionItem, selectors=[], type_arguments=None), MemberReference(member=collectionItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=mtasResponseCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=mtasResponse, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)
local_variable[type[Map], createPostAfterMissingCheckResult]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=PARAM_MTAS, postfix_operators=[], prefix_operators=[], qualifier=MtasSolrSearchComponent, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBool, postfix_operators=[], prefix_operators=[], qualifier=sreq.params, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBool, postfix_operators=[], prefix_operators=[], qualifier=sreq.params, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSolrResponse, postfix_operators=[], prefix_operators=[], qualifier=shardResponse, selectors=[MethodInvocation(arguments=[], member=getResponse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=solrShardResponse)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=NamedList, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=MtasSolrSearchComponent, selectors=[]), MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findRecursive, postfix_operators=[], prefix_operators=[], qualifier=solrShardResponse, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=SimpleOrderedMap, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), name=data)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=SimpleOrderedMap, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data")], member=get, postfix_operators=[], prefix_operators=[], qualifier=dataItem, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data")], member=get, postfix_operators=[], prefix_operators=[], qualifier=dataItem, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=MtasSolrCollectionResult, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data")], member=get, postfix_operators=[], prefix_operators=[], qualifier=dataItem, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MtasSolrCollectionResult, sub_type=None)), name=dataItemResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MtasSolrCollectionResult, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=id, postfix_operators=[], prefix_operators=[], qualifier=dataItemResult, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=id, postfix_operators=[], prefix_operators=[], qualifier=dataItemResult, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[MethodInvocation(arguments=[], member=action, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ACTION_CHECK, postfix_operators=[], prefix_operators=[], qualifier=ComponentCollection, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=dataItemResult, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getShard, postfix_operators=[], prefix_operators=[], qualifier=shardResponse, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=createPostAfterMissingCheckResult, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getShard, postfix_operators=[], prefix_operators=[], qualifier=shardResponse, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=createPostAfterMissingCheckResult, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getShard, postfix_operators=[], prefix_operators=[], qualifier=shardResponse, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=createPostAfterMissingCheckResult, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=id, postfix_operators=[], prefix_operators=[], qualifier=dataItemResult, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]))]))]), control=EnhancedForControl(iterable=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dataItem)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=SimpleOrderedMap, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=responses, postfix_operators=[], prefix_operators=[], qualifier=sreq, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=shardResponse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShardResponse, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=finished, postfix_operators=[], prefix_operators=[], qualifier=rb, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sreq)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShardRequest, sub_type=None))), label=None)
local_variable[type[HashMap], requestParamList]
local_variable[type[int], id]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=action, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[MethodInvocation(arguments=[MemberReference(member=ACTION_CHECK, postfix_operators=[], prefix_operators=[], qualifier=ComponentCollection, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=action, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[MethodInvocation(arguments=[MemberReference(member=ACTION_CREATE, postfix_operators=[], prefix_operators=[], qualifier=ComponentCollection, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, 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=version, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getCollectionCache, postfix_operators=[], prefix_operators=[], qualifier=searchComponent, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[]), MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCollectionCache, postfix_operators=[], prefix_operators=[], qualifier=searchComponent, selectors=[MethodInvocation(arguments=[], member=now, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getCollectionCache, postfix_operators=[], prefix_operators=[], qualifier=searchComponent, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=check, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setCreate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=paramsNewRequest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModifiableSolrParams, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=requestParamList, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramsNewRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=requestParamList, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramsNewRequest, 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=ModifiableSolrParams, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramsNewRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=requestParamList, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_ACTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ACTION_POST, postfix_operators=[], prefix_operators=[], qualifier=ComponentCollection, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_VERSION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_POST, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[], type_arguments=None)], member=stringValuesToString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=shards, postfix_operators=[], prefix_operators=[], qualifier=rb, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=shardAddress)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=createPostAfterMissingCheckResult, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=createPostAfterMissingCheckResult, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCollectionCache, postfix_operators=[], prefix_operators=[], qualifier=searchComponent, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=getDataById, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=values)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashSet, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=values, 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=None, name=paramsNewRequest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModifiableSolrParams, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=requestParamList, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramsNewRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=requestParamList, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramsNewRequest, 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=ModifiableSolrParams, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shardAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramsNewRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=requestParamList, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=componentCollection, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_ACTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ACTION_POST, postfix_operators=[], prefix_operators=[], qualifier=ComponentCollection, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=NAME_MTAS_COLLECTION_POST, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stringValuesToString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramsNewRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=id, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]))]))]), control=EnhancedForControl(iterable=MemberReference(member=shards, postfix_operators=[], prefix_operators=[], qualifier=rb, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=shardAddress)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)])), StatementExpression(expression=MemberReference(member=id, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=collection, postfix_operators=[], prefix_operators=[], qualifier=mtasFields, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=componentCollection)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ComponentCollection, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShardRequest, sub_type=None)), name=newSreq)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShardRequest, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=shards, postfix_operators=[], prefix_operators=[], qualifier=newSreq, selectors=[]), type==, value=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=purpose, postfix_operators=[], prefix_operators=[], qualifier=newSreq, selectors=[]), type==, value=MemberReference(member=PURPOSE_PRIVATE, postfix_operators=[], prefix_operators=[], qualifier=ShardRequest, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=newSreq, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=Q, postfix_operators=[], prefix_operators=[], qualifier=CommonParams, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=add, postfix_operators=[], prefix_operators=[], qualifier=newSreq.params, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ROWS, postfix_operators=[], prefix_operators=[], qualifier=CommonParams, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0")], member=add, postfix_operators=[], prefix_operators=[], qualifier=newSreq.params, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PARAM_MTAS, postfix_operators=[], prefix_operators=[], qualifier=MtasSolrSearchComponent, selectors=[]), MethodInvocation(arguments=[], member=getOriginalParams, postfix_operators=[], prefix_operators=[], qualifier=rb.req, selectors=[MethodInvocation(arguments=[MemberReference(member=PARAM_MTAS, postfix_operators=[], prefix_operators=[], qualifier=MtasSolrSearchComponent, selectors=[])], member=getParams, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=newSreq.params, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getOriginalParams, postfix_operators=[], prefix_operators=[], qualifier=rb.req, selectors=[MethodInvocation(arguments=[MemberReference(member=PARAM_MTAS_COLLECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParams, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=newSreq.params, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=searchComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newSreq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRequest, postfix_operators=[], prefix_operators=[], qualifier=rb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=requestParamList, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], 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=ModifiableSolrParams, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
else begin[{]
if[binary_operation[member[rb.stage], ==, member[MtasSolrSearchComponent.STAGE_COLLECTION_FINISH]]] begin[{]
local_variable[type[ArrayList], mtasResponseCollection]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mtasResponseCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mtasResponse, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mtasResponseCollection, 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=mtasResponseCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=searchComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rewrite, postfix_operators=[], prefix_operators=[], qualifier=MtasSolrResultUtil, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=mtasResponse, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[distributedProcess] operator[SEP] identifier[ResponseBuilder] identifier[rb] , identifier[ComponentFields] identifier[mtasFields] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[NamedList] operator[<] identifier[Object] operator[>] identifier[mtasResponse] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[mtasResponse] operator[=] operator[SEP] identifier[NamedList] operator[<] identifier[Object] operator[>] operator[SEP] identifier[rb] operator[SEP] identifier[rsp] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[MtasSolrSearchComponent] operator[SEP] identifier[NAME] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[mtasResponse] operator[=] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mtasResponse] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[rb] operator[SEP] identifier[stage] operator[==] identifier[MtasSolrSearchComponent] operator[SEP] identifier[STAGE_COLLECTION_INIT] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[MtasSolrCollectionResult] operator[>] identifier[index] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Object] operator[>] identifier[mtasResponseCollection] operator[SEP] Keyword[try] {
identifier[mtasResponseCollection] operator[=] operator[SEP] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] identifier[mtasResponse] operator[SEP] identifier[get] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[item] operator[:] identifier[mtasResponseCollection] operator[SEP] {
Keyword[if] operator[SEP] identifier[item] Keyword[instanceof] identifier[SimpleOrderedMap] operator[SEP] {
identifier[SimpleOrderedMap] operator[<] identifier[Object] operator[>] identifier[itemMap] operator[=] operator[SEP] identifier[SimpleOrderedMap] operator[<] identifier[Object] operator[>] operator[SEP] identifier[item] operator[SEP] Keyword[if] operator[SEP] identifier[itemMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[&&] identifier[itemMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] Keyword[instanceof] identifier[MtasSolrCollectionResult] operator[SEP] {
identifier[MtasSolrCollectionResult] identifier[collectionItem] operator[=] operator[SEP] identifier[MtasSolrCollectionResult] operator[SEP] identifier[itemMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[index] operator[SEP] identifier[put] operator[SEP] identifier[collectionItem] operator[SEP] identifier[id] operator[SEP] operator[SEP] , identifier[collectionItem] operator[SEP] operator[SEP]
}
}
}
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[mtasResponse] operator[SEP] identifier[remove] operator[SEP] identifier[NAME] operator[SEP] operator[SEP]
}
identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[createPostAfterMissingCheckResult] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ShardRequest] identifier[sreq] operator[:] identifier[rb] operator[SEP] identifier[finished] operator[SEP] {
Keyword[if] operator[SEP] identifier[sreq] operator[SEP] identifier[params] operator[SEP] identifier[getBool] operator[SEP] identifier[MtasSolrSearchComponent] operator[SEP] identifier[PARAM_MTAS] , literal[boolean] operator[SEP] operator[&&] identifier[sreq] operator[SEP] identifier[params] operator[SEP] identifier[getBool] operator[SEP] identifier[PARAM_MTAS_COLLECTION] , literal[boolean] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[ShardResponse] identifier[shardResponse] operator[:] identifier[sreq] operator[SEP] identifier[responses] operator[SEP] {
identifier[NamedList] operator[<] identifier[Object] operator[>] identifier[solrShardResponse] operator[=] identifier[shardResponse] operator[SEP] identifier[getSolrResponse] operator[SEP] operator[SEP] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[ArrayList] operator[<] identifier[SimpleOrderedMap] operator[<] identifier[Object] operator[>] operator[>] identifier[data] operator[=] operator[SEP] identifier[ArrayList] operator[<] identifier[SimpleOrderedMap] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] identifier[solrShardResponse] operator[SEP] identifier[findRecursive] operator[SEP] identifier[MtasSolrSearchComponent] operator[SEP] identifier[NAME] , identifier[NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[SimpleOrderedMap] operator[<] identifier[Object] operator[>] identifier[dataItem] operator[:] identifier[data] operator[SEP] {
Keyword[if] operator[SEP] identifier[dataItem] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[&&] identifier[dataItem] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] Keyword[instanceof] identifier[MtasSolrCollectionResult] operator[SEP] {
identifier[MtasSolrCollectionResult] identifier[dataItemResult] operator[=] operator[SEP] identifier[MtasSolrCollectionResult] operator[SEP] identifier[dataItem] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[SEP] identifier[containsKey] operator[SEP] identifier[dataItemResult] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[dataItemResult] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ComponentCollection] operator[SEP] identifier[ACTION_CHECK] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[dataItemResult] operator[SEP] identifier[status] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[createPostAfterMissingCheckResult] operator[SEP] identifier[containsKey] operator[SEP] identifier[shardResponse] operator[SEP] identifier[getShard] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[createPostAfterMissingCheckResult] operator[SEP] identifier[put] operator[SEP] identifier[shardResponse] operator[SEP] identifier[getShard] operator[SEP] operator[SEP] , Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[createPostAfterMissingCheckResult] operator[SEP] identifier[get] operator[SEP] identifier[shardResponse] operator[SEP] identifier[getShard] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[dataItemResult] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
identifier[data] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
}
identifier[HashMap] operator[<] identifier[String] , identifier[ModifiableSolrParams] operator[>] identifier[requestParamList] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[id] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[ComponentCollection] identifier[componentCollection] operator[:] identifier[mtasFields] operator[SEP] identifier[collection] operator[SEP] {
Keyword[if] operator[SEP] identifier[componentCollection] operator[SEP] identifier[action] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ComponentCollection] operator[SEP] identifier[ACTION_CHECK] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[shardAddress] operator[:] identifier[rb] operator[SEP] identifier[shards] operator[SEP] {
Keyword[if] operator[SEP] identifier[createPostAfterMissingCheckResult] operator[SEP] identifier[containsKey] operator[SEP] identifier[shardAddress] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[createPostAfterMissingCheckResult] operator[SEP] identifier[get] operator[SEP] identifier[shardAddress] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[componentCollection] operator[SEP] identifier[id] operator[SEP] operator[SEP] {
identifier[HashSet] operator[<] identifier[String] operator[>] identifier[values] operator[=] identifier[searchComponent] operator[SEP] identifier[getCollectionCache] operator[SEP] operator[SEP] operator[SEP] identifier[getDataById] operator[SEP] identifier[componentCollection] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[!=] Other[null] operator[SEP] {
identifier[ModifiableSolrParams] identifier[paramsNewRequest] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[requestParamList] operator[SEP] identifier[containsKey] operator[SEP] identifier[shardAddress] operator[SEP] operator[SEP] {
identifier[paramsNewRequest] operator[=] Keyword[new] identifier[ModifiableSolrParams] operator[SEP] operator[SEP] operator[SEP] identifier[requestParamList] operator[SEP] identifier[put] operator[SEP] identifier[shardAddress] , identifier[paramsNewRequest] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[paramsNewRequest] operator[=] identifier[requestParamList] operator[SEP] identifier[get] operator[SEP] identifier[shardAddress] operator[SEP] operator[SEP]
}
identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_KEY] , identifier[componentCollection] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_ID] , identifier[componentCollection] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_ACTION] , identifier[ComponentCollection] operator[SEP] identifier[ACTION_POST] operator[SEP] operator[SEP] identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_POST] , identifier[stringValuesToString] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[++] operator[SEP]
}
}
}
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[componentCollection] operator[SEP] identifier[action] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ComponentCollection] operator[SEP] identifier[ACTION_CREATE] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[componentCollection] operator[SEP] identifier[version] operator[==] Other[null] operator[SEP] {
identifier[componentCollection] operator[SEP] identifier[version] operator[=] identifier[searchComponent] operator[SEP] identifier[getCollectionCache] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[componentCollection] operator[SEP] identifier[id] , identifier[componentCollection] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[componentCollection] operator[SEP] identifier[values] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[index] operator[SEP] identifier[containsKey] operator[SEP] identifier[componentCollection] operator[SEP] identifier[id] operator[SEP] operator[SEP] {
identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[componentCollection] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[setCreate] operator[SEP] identifier[searchComponent] operator[SEP] identifier[getCollectionCache] operator[SEP] operator[SEP] operator[SEP] identifier[now] operator[SEP] operator[SEP] , identifier[searchComponent] operator[SEP] identifier[getCollectionCache] operator[SEP] operator[SEP] operator[SEP] identifier[check] operator[SEP] identifier[componentCollection] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[shardAddress] operator[:] identifier[rb] operator[SEP] identifier[shards] operator[SEP] {
identifier[ModifiableSolrParams] identifier[paramsNewRequest] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[requestParamList] operator[SEP] identifier[containsKey] operator[SEP] identifier[shardAddress] operator[SEP] operator[SEP] {
identifier[paramsNewRequest] operator[=] Keyword[new] identifier[ModifiableSolrParams] operator[SEP] operator[SEP] operator[SEP] identifier[requestParamList] operator[SEP] identifier[put] operator[SEP] identifier[shardAddress] , identifier[paramsNewRequest] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[paramsNewRequest] operator[=] identifier[requestParamList] operator[SEP] identifier[get] operator[SEP] identifier[shardAddress] operator[SEP] operator[SEP]
}
identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_KEY] , identifier[componentCollection] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_ID] , identifier[componentCollection] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_ACTION] , identifier[ComponentCollection] operator[SEP] identifier[ACTION_POST] operator[SEP] operator[SEP] identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_VERSION] , identifier[componentCollection] operator[SEP] identifier[version] operator[SEP] operator[SEP] identifier[paramsNewRequest] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[NAME_MTAS_COLLECTION_POST] , identifier[stringValuesToString] operator[SEP] identifier[componentCollection] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[id] operator[++] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ModifiableSolrParams] operator[>] identifier[entry] operator[:] identifier[requestParamList] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[ShardRequest] identifier[newSreq] operator[=] Keyword[new] identifier[ShardRequest] operator[SEP] operator[SEP] operator[SEP] identifier[newSreq] operator[SEP] identifier[shards] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP]
} operator[SEP] identifier[newSreq] operator[SEP] identifier[purpose] operator[=] identifier[ShardRequest] operator[SEP] identifier[PURPOSE_PRIVATE] operator[SEP] identifier[newSreq] operator[SEP] identifier[params] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[newSreq] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] identifier[CommonParams] operator[SEP] identifier[Q] , literal[String] operator[SEP] operator[SEP] identifier[newSreq] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] identifier[CommonParams] operator[SEP] identifier[ROWS] , literal[String] operator[SEP] operator[SEP] identifier[newSreq] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] identifier[MtasSolrSearchComponent] operator[SEP] identifier[PARAM_MTAS] , identifier[rb] operator[SEP] identifier[req] operator[SEP] identifier[getOriginalParams] operator[SEP] operator[SEP] operator[SEP] identifier[getParams] operator[SEP] identifier[MtasSolrSearchComponent] operator[SEP] identifier[PARAM_MTAS] operator[SEP] operator[SEP] operator[SEP] identifier[newSreq] operator[SEP] identifier[params] operator[SEP] identifier[add] operator[SEP] identifier[PARAM_MTAS_COLLECTION] , identifier[rb] operator[SEP] identifier[req] operator[SEP] identifier[getOriginalParams] operator[SEP] operator[SEP] operator[SEP] identifier[getParams] operator[SEP] identifier[PARAM_MTAS_COLLECTION] operator[SEP] operator[SEP] operator[SEP] identifier[rb] operator[SEP] identifier[addRequest] operator[SEP] identifier[searchComponent] , identifier[newSreq] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[rb] operator[SEP] identifier[stage] operator[==] identifier[MtasSolrSearchComponent] operator[SEP] identifier[STAGE_COLLECTION_FINISH] operator[SEP] {
identifier[ArrayList] operator[<] identifier[Object] operator[>] identifier[mtasResponseCollection] operator[SEP] Keyword[try] {
identifier[mtasResponseCollection] operator[=] operator[SEP] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] identifier[mtasResponse] operator[SEP] identifier[get] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mtasResponseCollection] operator[!=] Other[null] operator[SEP] {
identifier[MtasSolrResultUtil] operator[SEP] identifier[rewrite] operator[SEP] identifier[mtasResponseCollection] , identifier[searchComponent] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[mtasResponse] operator[SEP] identifier[remove] operator[SEP] identifier[NAME] operator[SEP] operator[SEP]
}
}
}
}
|
public ServiceFuture<List<AvailableCulture>> listSupportedCulturesAsync(final ServiceCallback<List<AvailableCulture>> serviceCallback) {
return ServiceFuture.fromResponse(listSupportedCulturesWithServiceResponseAsync(), serviceCallback);
} | class class_name[name] begin[{]
method[listSupportedCulturesAsync, return_type[type[ServiceFuture]], modifier[public], parameter[serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.listSupportedCulturesWithServiceResponseAsync, parameter[]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[AvailableCulture] operator[>] operator[>] identifier[listSupportedCulturesAsync] operator[SEP] Keyword[final] identifier[ServiceCallback] operator[<] identifier[List] operator[<] identifier[AvailableCulture] operator[>] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listSupportedCulturesWithServiceResponseAsync] operator[SEP] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
protected CmsWorkflowActionParams getWorkflowActionParams() {
if (m_publishSelectPanel.isShowResources()) {
List<CmsUUID> resourcesToPublish = new ArrayList<CmsUUID>(m_publishSelectPanel.getResourcesToPublish());
List<CmsUUID> resourcesToRemove = new ArrayList<CmsUUID>(m_publishSelectPanel.getResourcesToRemove());
CmsWorkflowActionParams actionParams = new CmsWorkflowActionParams(resourcesToPublish, resourcesToRemove);
return actionParams;
} else {
CmsPublishOptions options = getPublishOptions();
CmsWorkflow workflow = getSelectedWorkflow();
return new CmsWorkflowActionParams(new CmsPublishListToken(workflow, options));
}
} | class class_name[name] begin[{]
method[getWorkflowActionParams, return_type[type[CmsWorkflowActionParams]], modifier[protected], parameter[]] begin[{]
if[call[m_publishSelectPanel.isShowResources, parameter[]]] begin[{]
local_variable[type[List], resourcesToPublish]
local_variable[type[List], resourcesToRemove]
local_variable[type[CmsWorkflowActionParams], actionParams]
return[member[.actionParams]]
else begin[{]
local_variable[type[CmsPublishOptions], options]
local_variable[type[CmsWorkflow], workflow]
return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=workflow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, 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=CmsPublishListToken, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsWorkflowActionParams, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[protected] identifier[CmsWorkflowActionParams] identifier[getWorkflowActionParams] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_publishSelectPanel] operator[SEP] identifier[isShowResources] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[CmsUUID] operator[>] identifier[resourcesToPublish] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsUUID] operator[>] operator[SEP] identifier[m_publishSelectPanel] operator[SEP] identifier[getResourcesToPublish] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsUUID] operator[>] identifier[resourcesToRemove] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsUUID] operator[>] operator[SEP] identifier[m_publishSelectPanel] operator[SEP] identifier[getResourcesToRemove] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CmsWorkflowActionParams] identifier[actionParams] operator[=] Keyword[new] identifier[CmsWorkflowActionParams] operator[SEP] identifier[resourcesToPublish] , identifier[resourcesToRemove] operator[SEP] operator[SEP] Keyword[return] identifier[actionParams] operator[SEP]
}
Keyword[else] {
identifier[CmsPublishOptions] identifier[options] operator[=] identifier[getPublishOptions] operator[SEP] operator[SEP] operator[SEP] identifier[CmsWorkflow] identifier[workflow] operator[=] identifier[getSelectedWorkflow] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CmsWorkflowActionParams] operator[SEP] Keyword[new] identifier[CmsPublishListToken] operator[SEP] identifier[workflow] , identifier[options] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ZMatrixRMaj getH(ZMatrixRMaj H ) {
H = UtilDecompositons_ZDRM.checkZeros(H,N,N);
// copy the first row
System.arraycopy(QH.data, 0, H.data, 0, N*2);
for( int i = 1; i < N; i++ ) {
System.arraycopy(QH.data, (i*N+i-1)*2, H.data, (i*N+i-1)*2, (N-i+1)*2);
}
return H;
} | class class_name[name] begin[{]
method[getH, return_type[type[ZMatrixRMaj]], modifier[public], parameter[H]] begin[{]
assign[member[.H], call[UtilDecompositons_ZDRM.checkZeros, parameter[member[.H], member[.N], member[.N]]]]
call[System.arraycopy, parameter[member[QH.data], literal[0], member[H.data], literal[0], binary_operation[member[.N], *, literal[2]]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=QH, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=H, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.H]]
end[}]
END[}] | Keyword[public] identifier[ZMatrixRMaj] identifier[getH] operator[SEP] identifier[ZMatrixRMaj] identifier[H] operator[SEP] {
identifier[H] operator[=] identifier[UtilDecompositons_ZDRM] operator[SEP] identifier[checkZeros] operator[SEP] identifier[H] , identifier[N] , identifier[N] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[QH] operator[SEP] identifier[data] , Other[0] , identifier[H] operator[SEP] identifier[data] , Other[0] , identifier[N] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[N] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[QH] operator[SEP] identifier[data] , operator[SEP] identifier[i] operator[*] identifier[N] operator[+] identifier[i] operator[-] Other[1] operator[SEP] operator[*] Other[2] , identifier[H] operator[SEP] identifier[data] , operator[SEP] identifier[i] operator[*] identifier[N] operator[+] identifier[i] operator[-] Other[1] operator[SEP] operator[*] Other[2] , operator[SEP] identifier[N] operator[-] identifier[i] operator[+] Other[1] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP]
}
Keyword[return] identifier[H] operator[SEP]
}
|
public void setLocale(final Locale locale) {
if (!equals(this.locale, locale)) {
this.locale = locale;
super.setValue(toString(locale));
i18nBundleProvider.reloadBundles(locale);
}
} | class class_name[name] begin[{]
method[setLocale, return_type[void], modifier[public], parameter[locale]] begin[{]
if[call[.equals, parameter[THIS[member[None.locale]], member[.locale]]]] begin[{]
assign[THIS[member[None.locale]], member[.locale]]
SuperMethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
call[i18nBundleProvider.reloadBundles, parameter[member[.locale]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setLocale] operator[SEP] Keyword[final] identifier[Locale] identifier[locale] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[locale] , identifier[locale] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[locale] operator[=] identifier[locale] operator[SEP] Keyword[super] operator[SEP] identifier[setValue] operator[SEP] identifier[toString] operator[SEP] identifier[locale] operator[SEP] operator[SEP] operator[SEP] identifier[i18nBundleProvider] operator[SEP] identifier[reloadBundles] operator[SEP] identifier[locale] operator[SEP] operator[SEP]
}
}
|
public static URI changeProtocolAndPort(String protocol, int port, URI template) throws URISyntaxException {
return new URI(protocol, template.getUserInfo(), template.getHost(), port, template.getPath(), template.getQuery(), null);
} | class class_name[name] begin[{]
method[changeProtocolAndPort, return_type[type[URI]], modifier[public static], parameter[protocol, port, template]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=protocol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getUserInfo, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getQuery, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), 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=URI, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[URI] identifier[changeProtocolAndPort] operator[SEP] identifier[String] identifier[protocol] , Keyword[int] identifier[port] , identifier[URI] identifier[template] operator[SEP] Keyword[throws] identifier[URISyntaxException] {
Keyword[return] Keyword[new] identifier[URI] operator[SEP] identifier[protocol] , identifier[template] operator[SEP] identifier[getUserInfo] operator[SEP] operator[SEP] , identifier[template] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] , identifier[port] , identifier[template] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[template] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP]
}
|
protected JScrollPane wrapContent(final JComponent panel) {
panel.setMaximumSize(new Dimension(WIDTH_CONTENT, Integer.MAX_VALUE));
panel.setAlignmentX(Component.LEFT_ALIGNMENT);
final DCPanel wrappingPanel = new DCPanel();
final BoxLayout layout = new BoxLayout(wrappingPanel, BoxLayout.PAGE_AXIS);
wrappingPanel.setLayout(layout);
wrappingPanel.add(panel);
wrappingPanel.setBorder(new EmptyBorder(0, MARGIN_LEFT, 0, 0));
return WidgetUtils.scrolleable(wrappingPanel);
} | class class_name[name] begin[{]
method[wrapContent, return_type[type[JScrollPane]], modifier[protected], parameter[panel]] begin[{]
call[panel.setMaximumSize, parameter[ClassCreator(arguments=[MemberReference(member=WIDTH_CONTENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dimension, sub_type=None))]]
call[panel.setAlignmentX, parameter[member[Component.LEFT_ALIGNMENT]]]
local_variable[type[DCPanel], wrappingPanel]
local_variable[type[BoxLayout], layout]
call[wrappingPanel.setLayout, parameter[member[.layout]]]
call[wrappingPanel.add, parameter[member[.panel]]]
call[wrappingPanel.setBorder, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=MARGIN_LEFT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EmptyBorder, sub_type=None))]]
return[call[WidgetUtils.scrolleable, parameter[member[.wrappingPanel]]]]
end[}]
END[}] | Keyword[protected] identifier[JScrollPane] identifier[wrapContent] operator[SEP] Keyword[final] identifier[JComponent] identifier[panel] operator[SEP] {
identifier[panel] operator[SEP] identifier[setMaximumSize] operator[SEP] Keyword[new] identifier[Dimension] operator[SEP] identifier[WIDTH_CONTENT] , identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[setAlignmentX] operator[SEP] identifier[Component] operator[SEP] identifier[LEFT_ALIGNMENT] operator[SEP] operator[SEP] Keyword[final] identifier[DCPanel] identifier[wrappingPanel] operator[=] Keyword[new] identifier[DCPanel] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[BoxLayout] identifier[layout] operator[=] Keyword[new] identifier[BoxLayout] operator[SEP] identifier[wrappingPanel] , identifier[BoxLayout] operator[SEP] identifier[PAGE_AXIS] operator[SEP] operator[SEP] identifier[wrappingPanel] operator[SEP] identifier[setLayout] operator[SEP] identifier[layout] operator[SEP] operator[SEP] identifier[wrappingPanel] operator[SEP] identifier[add] operator[SEP] identifier[panel] operator[SEP] operator[SEP] identifier[wrappingPanel] operator[SEP] identifier[setBorder] operator[SEP] Keyword[new] identifier[EmptyBorder] operator[SEP] Other[0] , identifier[MARGIN_LEFT] , Other[0] , Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[WidgetUtils] operator[SEP] identifier[scrolleable] operator[SEP] identifier[wrappingPanel] operator[SEP] operator[SEP]
}
|
private ProcessInstance getProcInstFromDB(Long procInstId) throws DataAccessException {
TransactionWrapper transaction = null;
EngineDataAccessDB edao = new EngineDataAccessDB();
try {
transaction = edao.startTransaction();
return edao.getProcessInstance(procInstId);
} catch (SQLException e) {
logger.severe("InvokeSubProcessActivity -> Failed to load process instance for " + procInstId);
return null;
} finally {
edao.stopTransaction(transaction);
}
} | class class_name[name] begin[{]
method[getProcInstFromDB, return_type[type[ProcessInstance]], modifier[private], parameter[procInstId]] begin[{]
local_variable[type[TransactionWrapper], transaction]
local_variable[type[EngineDataAccessDB], edao]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=startTransaction, postfix_operators=[], prefix_operators=[], qualifier=edao, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=procInstId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProcessInstance, postfix_operators=[], prefix_operators=[], qualifier=edao, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InvokeSubProcessActivity -> Failed to load process instance for "), operandr=MemberReference(member=procInstId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=severe, postfix_operators=[], prefix_operators=[], qualifier=logger, 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=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stopTransaction, postfix_operators=[], prefix_operators=[], qualifier=edao, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] identifier[ProcessInstance] identifier[getProcInstFromDB] operator[SEP] identifier[Long] identifier[procInstId] operator[SEP] Keyword[throws] identifier[DataAccessException] {
identifier[TransactionWrapper] identifier[transaction] operator[=] Other[null] operator[SEP] identifier[EngineDataAccessDB] identifier[edao] operator[=] Keyword[new] identifier[EngineDataAccessDB] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[transaction] operator[=] identifier[edao] operator[SEP] identifier[startTransaction] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[edao] operator[SEP] identifier[getProcessInstance] operator[SEP] identifier[procInstId] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[procInstId] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[finally] {
identifier[edao] operator[SEP] identifier[stopTransaction] operator[SEP] identifier[transaction] operator[SEP] operator[SEP]
}
}
|
public void setProperty(String key, boolean value) {
getResourceFactory()
.getApiResource("/user/property/" + key)
.entity(new PropertyValue(value),
MediaType.APPLICATION_JSON_TYPE).put();
} | class class_name[name] begin[{]
method[setProperty, return_type[void], modifier[public], parameter[key, value]] begin[{]
call[.getResourceFactory, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setProperty] operator[SEP] identifier[String] identifier[key] , Keyword[boolean] identifier[value] operator[SEP] {
identifier[getResourceFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getApiResource] operator[SEP] literal[String] operator[+] identifier[key] operator[SEP] operator[SEP] identifier[entity] operator[SEP] Keyword[new] identifier[PropertyValue] operator[SEP] identifier[value] operator[SEP] , identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON_TYPE] operator[SEP] operator[SEP] identifier[put] operator[SEP] operator[SEP] operator[SEP]
}
|
public static CommerceDiscount fetchByLtD_S_Last(Date displayDate,
int status, OrderByComparator<CommerceDiscount> orderByComparator) {
return getPersistence()
.fetchByLtD_S_Last(displayDate, status, orderByComparator);
} | class class_name[name] begin[{]
method[fetchByLtD_S_Last, return_type[type[CommerceDiscount]], modifier[public static], parameter[displayDate, status, orderByComparator]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CommerceDiscount] identifier[fetchByLtD_S_Last] operator[SEP] identifier[Date] identifier[displayDate] , Keyword[int] identifier[status] , identifier[OrderByComparator] operator[<] identifier[CommerceDiscount] operator[>] identifier[orderByComparator] operator[SEP] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByLtD_S_Last] operator[SEP] identifier[displayDate] , identifier[status] , identifier[orderByComparator] operator[SEP] operator[SEP]
}
|
public static Optional<Class> resolveInterfaceTypeArgument(Class type, Class interfaceType) {
Type[] genericInterfaces = type.getGenericInterfaces();
for (Type genericInterface : genericInterfaces) {
if (genericInterface instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) genericInterface;
if (pt.getRawType() == interfaceType) {
return resolveSingleTypeArgument(genericInterface);
}
}
}
Class superClass = type.getSuperclass();
if (superClass != null && superClass != Object.class) {
return resolveInterfaceTypeArgument(superClass, interfaceType);
}
return Optional.empty();
} | class class_name[name] begin[{]
method[resolveInterfaceTypeArgument, return_type[type[Optional]], modifier[public static], parameter[type, interfaceType]] begin[{]
local_variable[type[Type], genericInterfaces]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=genericInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=genericInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None)), name=pt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRawType, postfix_operators=[], prefix_operators=[], qualifier=pt, selectors=[], type_arguments=None), operandr=MemberReference(member=interfaceType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=genericInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveSingleTypeArgument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=genericInterfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=genericInterface)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
local_variable[type[Class], superClass]
if[binary_operation[binary_operation[member[.superClass], !=, literal[null]], &&, binary_operation[member[.superClass], !=, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] begin[{]
return[call[.resolveInterfaceTypeArgument, parameter[member[.superClass], member[.interfaceType]]]]
else begin[{]
None
end[}]
return[call[Optional.empty, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[Class] operator[>] identifier[resolveInterfaceTypeArgument] operator[SEP] identifier[Class] identifier[type] , identifier[Class] identifier[interfaceType] operator[SEP] {
identifier[Type] operator[SEP] operator[SEP] identifier[genericInterfaces] operator[=] identifier[type] operator[SEP] identifier[getGenericInterfaces] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Type] identifier[genericInterface] operator[:] identifier[genericInterfaces] operator[SEP] {
Keyword[if] operator[SEP] identifier[genericInterface] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] {
identifier[ParameterizedType] identifier[pt] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[genericInterface] operator[SEP] Keyword[if] operator[SEP] identifier[pt] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[==] identifier[interfaceType] operator[SEP] {
Keyword[return] identifier[resolveSingleTypeArgument] operator[SEP] identifier[genericInterface] operator[SEP] operator[SEP]
}
}
}
identifier[Class] identifier[superClass] operator[=] identifier[type] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[superClass] operator[!=] Other[null] operator[&&] identifier[superClass] operator[!=] identifier[Object] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[resolveInterfaceTypeArgument] operator[SEP] identifier[superClass] , identifier[interfaceType] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP]
}
|
public String htmlCell(CmsListItem item, boolean isPrintable) {
StringBuffer html = new StringBuffer(512);
Iterator<I_CmsListDirectAction> itActions = m_directActions.iterator();
while (itActions.hasNext()) {
I_CmsListDirectAction action = itActions.next();
action.setItem(item);
boolean enabled = action.isEnabled();
if (isPrintable) {
action.setEnabled(false);
}
html.append(action.buttonHtml());
if (isPrintable) {
action.setEnabled(enabled);
}
}
if (!m_defaultActions.isEmpty()) {
Iterator<CmsListDefaultAction> itDefaultActions = m_defaultActions.iterator();
while (itDefaultActions.hasNext()) {
CmsListDefaultAction defAction = itDefaultActions.next();
defAction.setItem(item);
boolean enabled = defAction.isEnabled();
if (isPrintable) {
defAction.setEnabled(false);
}
html.append(defAction.buttonHtml());
if (isPrintable) {
defAction.setEnabled(enabled);
}
}
} else {
if (m_formatter == null) {
// unformatted output
if (item.get(m_id) != null) {
// null values are not showed by default
html.append(item.get(m_id).toString());
}
} else {
// formatted output
html.append(m_formatter.format(item.get(m_id), getWp().getLocale()));
}
}
html.append("\n");
return html.toString();
} | class class_name[name] begin[{]
method[htmlCell, return_type[type[String]], modifier[public], parameter[item, isPrintable]] begin[{]
local_variable[type[StringBuffer], html]
local_variable[type[Iterator], itActions]
while[call[itActions.hasNext, parameter[]]] begin[{]
local_variable[type[I_CmsListDirectAction], action]
call[action.setItem, parameter[member[.item]]]
local_variable[type[boolean], enabled]
if[member[.isPrintable]] begin[{]
call[action.setEnabled, parameter[literal[false]]]
else begin[{]
None
end[}]
call[html.append, parameter[call[action.buttonHtml, parameter[]]]]
if[member[.isPrintable]] begin[{]
call[action.setEnabled, parameter[member[.enabled]]]
else begin[{]
None
end[}]
end[}]
if[call[m_defaultActions.isEmpty, parameter[]]] begin[{]
local_variable[type[Iterator], itDefaultActions]
while[call[itDefaultActions.hasNext, parameter[]]] begin[{]
local_variable[type[CmsListDefaultAction], defAction]
call[defAction.setItem, parameter[member[.item]]]
local_variable[type[boolean], enabled]
if[member[.isPrintable]] begin[{]
call[defAction.setEnabled, parameter[literal[false]]]
else begin[{]
None
end[}]
call[html.append, parameter[call[defAction.buttonHtml, parameter[]]]]
if[member[.isPrintable]] begin[{]
call[defAction.setEnabled, parameter[member[.enabled]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
if[binary_operation[member[.m_formatter], ==, literal[null]]] begin[{]
if[binary_operation[call[item.get, parameter[member[.m_id]]], !=, literal[null]]] begin[{]
call[html.append, parameter[call[item.get, parameter[member[.m_id]]]]]
else begin[{]
None
end[}]
else begin[{]
call[html.append, parameter[call[m_formatter.format, parameter[call[item.get, parameter[member[.m_id]]], call[.getWp, parameter[]]]]]]
end[}]
end[}]
call[html.append, parameter[literal["\n"]]]
return[call[html.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[htmlCell] operator[SEP] identifier[CmsListItem] identifier[item] , Keyword[boolean] identifier[isPrintable] operator[SEP] {
identifier[StringBuffer] identifier[html] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[512] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[I_CmsListDirectAction] operator[>] identifier[itActions] operator[=] identifier[m_directActions] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itActions] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[I_CmsListDirectAction] identifier[action] operator[=] identifier[itActions] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setItem] operator[SEP] identifier[item] operator[SEP] operator[SEP] Keyword[boolean] identifier[enabled] operator[=] identifier[action] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPrintable] operator[SEP] {
identifier[action] operator[SEP] identifier[setEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[action] operator[SEP] identifier[buttonHtml] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPrintable] operator[SEP] {
identifier[action] operator[SEP] identifier[setEnabled] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[m_defaultActions] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[Iterator] operator[<] identifier[CmsListDefaultAction] operator[>] identifier[itDefaultActions] operator[=] identifier[m_defaultActions] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itDefaultActions] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsListDefaultAction] identifier[defAction] operator[=] identifier[itDefaultActions] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[defAction] operator[SEP] identifier[setItem] operator[SEP] identifier[item] operator[SEP] operator[SEP] Keyword[boolean] identifier[enabled] operator[=] identifier[defAction] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPrintable] operator[SEP] {
identifier[defAction] operator[SEP] identifier[setEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[defAction] operator[SEP] identifier[buttonHtml] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPrintable] operator[SEP] {
identifier[defAction] operator[SEP] identifier[setEnabled] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[m_formatter] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[get] operator[SEP] identifier[m_id] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[item] operator[SEP] identifier[get] operator[SEP] identifier[m_id] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[m_formatter] operator[SEP] identifier[format] operator[SEP] identifier[item] operator[SEP] identifier[get] operator[SEP] identifier[m_id] operator[SEP] , identifier[getWp] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[html] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void release() {
HMSAgentLog.d("release");
isResolving = false;
resolveActivity = null;
hasOverActivity = false;
HuaweiApiClient client = getApiClient();
if (client != null) {
client.disconnect();
}
synchronized (APICLIENT_LOCK) {
apiClient = null;
}
synchronized (STATIC_CALLBACK_LOCK) {
staticCallbacks.clear();
}
synchronized (CALLBACK_LOCK) {
connCallbacks.clear();
}
} | class class_name[name] begin[{]
method[release, return_type[void], modifier[public], parameter[]] begin[{]
call[HMSAgentLog.d, parameter[literal["release"]]]
assign[member[.isResolving], literal[false]]
assign[member[.resolveActivity], literal[null]]
assign[member[.hasOverActivity], literal[false]]
local_variable[type[HuaweiApiClient], client]
if[binary_operation[member[.client], !=, literal[null]]] begin[{]
call[client.disconnect, parameter[]]
else begin[{]
None
end[}]
SYNCHRONIZED[member[.APICLIENT_LOCK]] BEGIN[{]
assign[member[.apiClient], literal[null]]
END[}]
SYNCHRONIZED[member[.STATIC_CALLBACK_LOCK]] BEGIN[{]
call[staticCallbacks.clear, parameter[]]
END[}]
SYNCHRONIZED[member[.CALLBACK_LOCK]] BEGIN[{]
call[connCallbacks.clear, parameter[]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[release] operator[SEP] operator[SEP] {
identifier[HMSAgentLog] operator[SEP] identifier[d] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[isResolving] operator[=] literal[boolean] operator[SEP] identifier[resolveActivity] operator[=] Other[null] operator[SEP] identifier[hasOverActivity] operator[=] literal[boolean] operator[SEP] identifier[HuaweiApiClient] identifier[client] operator[=] identifier[getApiClient] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[client] operator[!=] Other[null] operator[SEP] {
identifier[client] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[APICLIENT_LOCK] operator[SEP] {
identifier[apiClient] operator[=] Other[null] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[STATIC_CALLBACK_LOCK] operator[SEP] {
identifier[staticCallbacks] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[CALLBACK_LOCK] operator[SEP] {
identifier[connCallbacks] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private BasicDBObject identifyFieldsToRetrieve(Class<T> entityClass, String viewOfClassName) {
if (viewOfClassName == null) {
return null; // Null is equivalent to retrieving all fields
}
BasicDBObject fields = new BasicDBObject();
try {
determineFieldsToRetrieve(entityClass, Class.forName(viewOfClassName), "", fields);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
if (optimisticLockEnabled) {
fields.put(OPTIMISTIC_LOCK_VERSION_FIELD, 1);
}
if (accessControlContextProvider != null) {
fields.put(ACCESS_CONTROL_FIELD, 1);
}
if (fields.containsField("id")) {
fields.remove("id"); // Included by default, no need to specify
} else {
fields.put(ID_FIELD, 0); // Need to explicitly exclude it
}
return fields;
} | class class_name[name] begin[{]
method[identifyFieldsToRetrieve, return_type[type[BasicDBObject]], modifier[private], parameter[entityClass, viewOfClassName]] begin[{]
if[binary_operation[member[.viewOfClassName], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[BasicDBObject], fields]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entityClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=viewOfClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=determineFieldsToRetrieve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)
if[member[.optimisticLockEnabled]] begin[{]
call[fields.put, parameter[member[.OPTIMISTIC_LOCK_VERSION_FIELD], literal[1]]]
else begin[{]
None
end[}]
if[binary_operation[member[.accessControlContextProvider], !=, literal[null]]] begin[{]
call[fields.put, parameter[member[.ACCESS_CONTROL_FIELD], literal[1]]]
else begin[{]
None
end[}]
if[call[fields.containsField, parameter[literal["id"]]]] begin[{]
call[fields.remove, parameter[literal["id"]]]
else begin[{]
call[fields.put, parameter[member[.ID_FIELD], literal[0]]]
end[}]
return[member[.fields]]
end[}]
END[}] | Keyword[private] identifier[BasicDBObject] identifier[identifyFieldsToRetrieve] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[entityClass] , identifier[String] identifier[viewOfClassName] operator[SEP] {
Keyword[if] operator[SEP] identifier[viewOfClassName] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[BasicDBObject] identifier[fields] operator[=] Keyword[new] identifier[BasicDBObject] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[determineFieldsToRetrieve] operator[SEP] identifier[entityClass] , identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[viewOfClassName] operator[SEP] , literal[String] , identifier[fields] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[optimisticLockEnabled] operator[SEP] {
identifier[fields] operator[SEP] identifier[put] operator[SEP] identifier[OPTIMISTIC_LOCK_VERSION_FIELD] , Other[1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[accessControlContextProvider] operator[!=] Other[null] operator[SEP] {
identifier[fields] operator[SEP] identifier[put] operator[SEP] identifier[ACCESS_CONTROL_FIELD] , Other[1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[fields] operator[SEP] identifier[containsField] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[fields] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[fields] operator[SEP] identifier[put] operator[SEP] identifier[ID_FIELD] , Other[0] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fields] operator[SEP]
}
|
public final <U, V> Flux<T> timeout(Publisher<U> firstTimeout,
Function<? super T, ? extends Publisher<V>> nextTimeoutFactory, Publisher<? extends T>
fallback) {
return onAssembly(new FluxTimeout<>(this, firstTimeout, nextTimeoutFactory,
fallback));
} | class class_name[name] begin[{]
method[timeout, return_type[type[Flux]], modifier[final public], parameter[firstTimeout, nextTimeoutFactory, fallback]] begin[{]
return[call[.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=firstTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nextTimeoutFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=FluxTimeout, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[final] operator[<] identifier[U] , identifier[V] operator[>] identifier[Flux] operator[<] identifier[T] operator[>] identifier[timeout] operator[SEP] identifier[Publisher] operator[<] identifier[U] operator[>] identifier[firstTimeout] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[Publisher] operator[<] identifier[V] operator[>] operator[>] identifier[nextTimeoutFactory] , identifier[Publisher] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[fallback] operator[SEP] {
Keyword[return] identifier[onAssembly] operator[SEP] Keyword[new] identifier[FluxTimeout] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[firstTimeout] , identifier[nextTimeoutFactory] , identifier[fallback] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Enumeration<URL> getResources(String name) throws IOException {
return bundleClassLoader.getResources(name);
} | class class_name[name] begin[{]
method[getResources, return_type[type[Enumeration]], modifier[public], parameter[name]] begin[{]
return[call[bundleClassLoader.getResources, parameter[member[.name]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Enumeration] operator[<] identifier[URL] operator[>] identifier[getResources] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[bundleClassLoader] operator[SEP] identifier[getResources] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
|
public GetContextKeysForCustomPolicyRequest withPolicyInputList(String... policyInputList) {
if (this.policyInputList == null) {
setPolicyInputList(new com.amazonaws.internal.SdkInternalList<String>(policyInputList.length));
}
for (String ele : policyInputList) {
this.policyInputList.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withPolicyInputList, return_type[type[GetContextKeysForCustomPolicyRequest]], modifier[public], parameter[policyInputList]] begin[{]
if[binary_operation[THIS[member[None.policyInputList]], ==, literal[null]]] begin[{]
call[.setPolicyInputList, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=policyInputList, 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=String, 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=policyInputList, 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=policyInputList, 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=String, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[GetContextKeysForCustomPolicyRequest] identifier[withPolicyInputList] operator[SEP] identifier[String] operator[...] identifier[policyInputList] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[policyInputList] operator[==] Other[null] operator[SEP] {
identifier[setPolicyInputList] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[policyInputList] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[policyInputList] operator[SEP] {
Keyword[this] operator[SEP] identifier[policyInputList] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static int assignKeyToParallelOperator(Object key, int maxParallelism, int parallelism) {
return computeOperatorIndexForKeyGroup(maxParallelism, parallelism, assignToKeyGroup(key, maxParallelism));
} | class class_name[name] begin[{]
method[assignKeyToParallelOperator, return_type[type[int]], modifier[public static], parameter[key, maxParallelism, parallelism]] begin[{]
return[call[.computeOperatorIndexForKeyGroup, parameter[member[.maxParallelism], member[.parallelism], call[.assignToKeyGroup, parameter[member[.key], member[.maxParallelism]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[assignKeyToParallelOperator] operator[SEP] identifier[Object] identifier[key] , Keyword[int] identifier[maxParallelism] , Keyword[int] identifier[parallelism] operator[SEP] {
Keyword[return] identifier[computeOperatorIndexForKeyGroup] operator[SEP] identifier[maxParallelism] , identifier[parallelism] , identifier[assignToKeyGroup] operator[SEP] identifier[key] , identifier[maxParallelism] operator[SEP] operator[SEP] operator[SEP]
}
|
Boolean getColIsIdentity(int i) {
return table.getColumn(i).isIdentity() ? Boolean.TRUE
: Boolean.FALSE;
} | class class_name[name] begin[{]
method[getColIsIdentity, return_type[type[Boolean]], modifier[default], parameter[i]] begin[{]
return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[MethodInvocation(arguments=[], member=isIdentity, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_false=MemberReference(member=FALSE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[]), if_true=MemberReference(member=TRUE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[]))]
end[}]
END[}] | identifier[Boolean] identifier[getColIsIdentity] operator[SEP] Keyword[int] identifier[i] operator[SEP] {
Keyword[return] identifier[table] operator[SEP] identifier[getColumn] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isIdentity] operator[SEP] operator[SEP] operator[?] identifier[Boolean] operator[SEP] identifier[TRUE] operator[:] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP]
}
|
private Object getX500Name(String name, boolean getIssuer)
throws IOException {
if (name.equalsIgnoreCase(X509CertInfo.DN_NAME)) {
return getIssuer ? issuer : subject;
} else if (name.equalsIgnoreCase("x500principal")) {
return getIssuer ? issuer.asX500Principal()
: subject.asX500Principal();
} else {
throw new IOException("Attribute name not recognized.");
}
} | class class_name[name] begin[{]
method[getX500Name, return_type[type[Object]], modifier[private], parameter[name, getIssuer]] begin[{]
if[call[name.equalsIgnoreCase, parameter[member[X509CertInfo.DN_NAME]]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=getIssuer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=subject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=issuer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
if[call[name.equalsIgnoreCase, parameter[literal["x500principal"]]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=getIssuer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=asX500Principal, postfix_operators=[], prefix_operators=[], qualifier=subject, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=asX500Principal, postfix_operators=[], prefix_operators=[], qualifier=issuer, selectors=[], type_arguments=None))]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attribute name not recognized.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
END[}] | Keyword[private] identifier[Object] identifier[getX500Name] operator[SEP] identifier[String] identifier[name] , Keyword[boolean] identifier[getIssuer] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[X509CertInfo] operator[SEP] identifier[DN_NAME] operator[SEP] operator[SEP] {
Keyword[return] identifier[getIssuer] operator[?] identifier[issuer] operator[:] identifier[subject] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[getIssuer] operator[?] identifier[issuer] operator[SEP] identifier[asX500Principal] operator[SEP] operator[SEP] operator[:] identifier[subject] operator[SEP] identifier[asX500Principal] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public void marshall(PolicyTypeSummary policyTypeSummary, ProtocolMarshaller protocolMarshaller) {
if (policyTypeSummary == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(policyTypeSummary.getType(), TYPE_BINDING);
protocolMarshaller.marshall(policyTypeSummary.getStatus(), STATUS_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[policyTypeSummary, protocolMarshaller]] begin[{]
if[binary_operation[member[.policyTypeSummary], ==, 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=getType, postfix_operators=[], prefix_operators=[], qualifier=policyTypeSummary, selectors=[], type_arguments=None), MemberReference(member=TYPE_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=getStatus, postfix_operators=[], prefix_operators=[], qualifier=policyTypeSummary, selectors=[], type_arguments=None), MemberReference(member=STATUS_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[PolicyTypeSummary] identifier[policyTypeSummary] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[policyTypeSummary] 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[policyTypeSummary] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[TYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[policyTypeSummary] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_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]
}
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.BPG__PAGE_NAME:
return getPageName();
case AfplibPackage.BPG__TRIPLETS:
return getTriplets();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BPG__PAGE_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getPageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=BPG__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BPG__PAGE_NAME] operator[:] Keyword[return] identifier[getPageName] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BPG__TRIPLETS] operator[:] Keyword[return] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
protected void sendTransferMessageToLocalUser(Mtp3TransferPrimitive msg, int seqControl) {
if (this.isStarted) {
MsgTransferDeliveryHandler hdl = new MsgTransferDeliveryHandler(msg);
seqControl = seqControl & slsFilter;
this.msgDeliveryExecutors[this.slsTable[seqControl]].execute(hdl);
} else {
logger.error(String.format(
"Received Mtp3TransferPrimitive=%s but Mtp3UserPart is not started. Message will be dropped", msg));
}
} | class class_name[name] begin[{]
method[sendTransferMessageToLocalUser, return_type[void], modifier[protected], parameter[msg, seqControl]] begin[{]
if[THIS[member[None.isStarted]]] begin[{]
local_variable[type[MsgTransferDeliveryHandler], hdl]
assign[member[.seqControl], binary_operation[member[.seqControl], &, member[.slsFilter]]]
THIS[member[None.msgDeliveryExecutors]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=slsTable, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=seqControl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))call[None.execute, parameter[member[.hdl]]]]
else begin[{]
call[logger.error, parameter[call[String.format, parameter[literal["Received Mtp3TransferPrimitive=%s but Mtp3UserPart is not started. Message will be dropped"], member[.msg]]]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[sendTransferMessageToLocalUser] operator[SEP] identifier[Mtp3TransferPrimitive] identifier[msg] , Keyword[int] identifier[seqControl] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isStarted] operator[SEP] {
identifier[MsgTransferDeliveryHandler] identifier[hdl] operator[=] Keyword[new] identifier[MsgTransferDeliveryHandler] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[seqControl] operator[=] identifier[seqControl] operator[&] identifier[slsFilter] operator[SEP] Keyword[this] operator[SEP] identifier[msgDeliveryExecutors] operator[SEP] Keyword[this] operator[SEP] identifier[slsTable] operator[SEP] identifier[seqControl] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[hdl] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[msg] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected void nowReconnectedAsync() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Reconnected async for " + this);
}
// reset the data buffers first
if (!resetWriteBuffers()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Resetting buffers (async) failed");
}
// otherwise pass the error along to the channel above us, or close
// the connection if nobody is above
IOException ioe = new IOException("Failed reconnect");
if (null != getAppWriteCallback()) {
getAppWriteCallback().error(getVC(), ioe);
} else {
// nobody above us, just close the connection
getLink().getDeviceLink().close(getVC(), ioe);
}
return;
}
// now that we've reconnected, we should reset the "broken" flag. First
// we set it to the default and then recheck the request msg
setPersistent(true);
updatePersistence(getRequestImpl());
// in case we previously read any partial data, clean out the response
resetRead();
// attempt to write the data
VirtualConnection rc = getTSC().getWriteInterface().write(TCPWriteRequestContext.WRITE_ALL_DATA, HttpOSCWriteCallback.getRef(), isForceAsync(), getWriteTimeout());
if (null != rc) {
// if we've finished writing part of a request, let the channel
// above know that it can write more, otherwise start the read
// for the response
if (!isMessageSent()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Calling callback.complete of app channel.");
}
getAppWriteCallback().complete(getLink().getVirtualConnection());
} else {
if (isReadAheadEnabled()) {
// after a reconnect, there is no more read-ahead active
this.bReadAheadEnabled = false;
}
// force an async read for the response now. Avoid trying to
// re-use any existing read buffer to skip complexity with
// adjusting for partial reads before the reconnect.
setupJITRead(getHttpConfig().getIncomingHdrBufferSize());
getTSC().getReadInterface().read(1, HttpOSCReadCallback.getRef(), true, getReadTimeout());
}
}
} | class class_name[name] begin[{]
method[nowReconnectedAsync, return_type[void], modifier[protected], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[literal["Reconnected async for "], +, THIS[]]]]
else begin[{]
None
end[}]
if[call[.resetWriteBuffers, parameter[]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["Resetting buffers (async) failed"]]]
else begin[{]
None
end[}]
local_variable[type[IOException], ioe]
if[binary_operation[literal[null], !=, call[.getAppWriteCallback, parameter[]]]] begin[{]
call[.getAppWriteCallback, parameter[]]
else begin[{]
call[.getLink, parameter[]]
end[}]
return[None]
else begin[{]
None
end[}]
call[.setPersistent, parameter[literal[true]]]
call[.updatePersistence, parameter[call[.getRequestImpl, parameter[]]]]
call[.resetRead, parameter[]]
local_variable[type[VirtualConnection], rc]
if[binary_operation[literal[null], !=, member[.rc]]] begin[{]
if[call[.isMessageSent, parameter[]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["Calling callback.complete of app channel."]]]
else begin[{]
None
end[}]
call[.getAppWriteCallback, parameter[]]
else begin[{]
if[call[.isReadAheadEnabled, parameter[]]] begin[{]
assign[THIS[member[None.bReadAheadEnabled]], literal[false]]
else begin[{]
None
end[}]
call[.setupJITRead, parameter[call[.getHttpConfig, parameter[]]]]
call[.getTSC, parameter[]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[nowReconnectedAsync] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] Keyword[this] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[resetWriteBuffers] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
identifier[IOException] identifier[ioe] operator[=] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[getAppWriteCallback] operator[SEP] operator[SEP] operator[SEP] {
identifier[getAppWriteCallback] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[getVC] operator[SEP] operator[SEP] , identifier[ioe] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[getLink] operator[SEP] operator[SEP] operator[SEP] identifier[getDeviceLink] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] identifier[getVC] operator[SEP] operator[SEP] , identifier[ioe] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP]
}
identifier[setPersistent] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[updatePersistence] operator[SEP] identifier[getRequestImpl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resetRead] operator[SEP] operator[SEP] operator[SEP] identifier[VirtualConnection] identifier[rc] operator[=] identifier[getTSC] operator[SEP] operator[SEP] operator[SEP] identifier[getWriteInterface] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[TCPWriteRequestContext] operator[SEP] identifier[WRITE_ALL_DATA] , identifier[HttpOSCWriteCallback] operator[SEP] identifier[getRef] operator[SEP] operator[SEP] , identifier[isForceAsync] operator[SEP] operator[SEP] , identifier[getWriteTimeout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[rc] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isMessageSent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
identifier[getAppWriteCallback] operator[SEP] operator[SEP] operator[SEP] identifier[complete] operator[SEP] identifier[getLink] operator[SEP] operator[SEP] operator[SEP] identifier[getVirtualConnection] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[isReadAheadEnabled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[bReadAheadEnabled] operator[=] literal[boolean] operator[SEP]
}
identifier[setupJITRead] operator[SEP] identifier[getHttpConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getIncomingHdrBufferSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTSC] operator[SEP] operator[SEP] operator[SEP] identifier[getReadInterface] operator[SEP] operator[SEP] operator[SEP] identifier[read] operator[SEP] Other[1] , identifier[HttpOSCReadCallback] operator[SEP] identifier[getRef] operator[SEP] operator[SEP] , literal[boolean] , identifier[getReadTimeout] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Override
public void compute() {
Spliterator<P_IN> rs = spliterator, ls;
long sizeEstimate = rs.estimateSize();
long sizeThreshold = getTargetSize(sizeEstimate);
boolean forkRight = false;
@SuppressWarnings("unchecked") K task = (K) this;
AtomicReference<R> sr = sharedResult;
R result;
while ((result = sr.get()) == null) {
if (task.taskCanceled()) {
result = task.getEmptyResult();
break;
}
if (sizeEstimate <= sizeThreshold || (ls = rs.trySplit()) == null) {
result = task.doLeaf();
break;
}
K leftChild, rightChild, taskToFork;
task.leftChild = leftChild = task.makeChild(ls);
task.rightChild = rightChild = task.makeChild(rs);
task.setPendingCount(1);
if (forkRight) {
forkRight = false;
rs = ls;
task = leftChild;
taskToFork = rightChild;
}
else {
forkRight = true;
task = rightChild;
taskToFork = leftChild;
}
taskToFork.fork();
sizeEstimate = rs.estimateSize();
}
task.setLocalResult(result);
task.tryComplete();
} | class class_name[name] begin[{]
method[compute, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Spliterator], rs]
local_variable[type[long], sizeEstimate]
local_variable[type[long], sizeThreshold]
local_variable[type[boolean], forkRight]
local_variable[type[K], task]
local_variable[type[AtomicReference], sr]
local_variable[type[R], result]
while[binary_operation[assign[member[.result], call[sr.get, parameter[]]], ==, literal[null]]] begin[{]
if[call[task.taskCanceled, parameter[]]] begin[{]
assign[member[.result], call[task.getEmptyResult, parameter[]]]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.sizeEstimate], <=, member[.sizeThreshold]], ||, binary_operation[assign[member[.ls], call[rs.trySplit, parameter[]]], ==, literal[null]]]] begin[{]
assign[member[.result], call[task.doLeaf, parameter[]]]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
local_variable[type[K], leftChild]
assign[member[task.leftChild], assign[member[.leftChild], call[task.makeChild, parameter[member[.ls]]]]]
assign[member[task.rightChild], assign[member[.rightChild], call[task.makeChild, parameter[member[.rs]]]]]
call[task.setPendingCount, parameter[literal[1]]]
if[member[.forkRight]] begin[{]
assign[member[.forkRight], literal[false]]
assign[member[.rs], member[.ls]]
assign[member[.task], member[.leftChild]]
assign[member[.taskToFork], member[.rightChild]]
else begin[{]
assign[member[.forkRight], literal[true]]
assign[member[.task], member[.rightChild]]
assign[member[.taskToFork], member[.leftChild]]
end[}]
call[taskToFork.fork, parameter[]]
assign[member[.sizeEstimate], call[rs.estimateSize, parameter[]]]
end[}]
call[task.setLocalResult, parameter[member[.result]]]
call[task.tryComplete, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[compute] operator[SEP] operator[SEP] {
identifier[Spliterator] operator[<] identifier[P_IN] operator[>] identifier[rs] operator[=] identifier[spliterator] , identifier[ls] operator[SEP] Keyword[long] identifier[sizeEstimate] operator[=] identifier[rs] operator[SEP] identifier[estimateSize] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[sizeThreshold] operator[=] identifier[getTargetSize] operator[SEP] identifier[sizeEstimate] operator[SEP] operator[SEP] Keyword[boolean] identifier[forkRight] operator[=] literal[boolean] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[K] identifier[task] operator[=] operator[SEP] identifier[K] operator[SEP] Keyword[this] operator[SEP] identifier[AtomicReference] operator[<] identifier[R] operator[>] identifier[sr] operator[=] identifier[sharedResult] operator[SEP] identifier[R] identifier[result] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[sr] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[taskCanceled] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[=] identifier[task] operator[SEP] identifier[getEmptyResult] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sizeEstimate] operator[<=] identifier[sizeThreshold] operator[||] operator[SEP] identifier[ls] operator[=] identifier[rs] operator[SEP] identifier[trySplit] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[result] operator[=] identifier[task] operator[SEP] identifier[doLeaf] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
identifier[K] identifier[leftChild] , identifier[rightChild] , identifier[taskToFork] operator[SEP] identifier[task] operator[SEP] identifier[leftChild] operator[=] identifier[leftChild] operator[=] identifier[task] operator[SEP] identifier[makeChild] operator[SEP] identifier[ls] operator[SEP] operator[SEP] identifier[task] operator[SEP] identifier[rightChild] operator[=] identifier[rightChild] operator[=] identifier[task] operator[SEP] identifier[makeChild] operator[SEP] identifier[rs] operator[SEP] operator[SEP] identifier[task] operator[SEP] identifier[setPendingCount] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[forkRight] operator[SEP] {
identifier[forkRight] operator[=] literal[boolean] operator[SEP] identifier[rs] operator[=] identifier[ls] operator[SEP] identifier[task] operator[=] identifier[leftChild] operator[SEP] identifier[taskToFork] operator[=] identifier[rightChild] operator[SEP]
}
Keyword[else] {
identifier[forkRight] operator[=] literal[boolean] operator[SEP] identifier[task] operator[=] identifier[rightChild] operator[SEP] identifier[taskToFork] operator[=] identifier[leftChild] operator[SEP]
}
identifier[taskToFork] operator[SEP] identifier[fork] operator[SEP] operator[SEP] operator[SEP] identifier[sizeEstimate] operator[=] identifier[rs] operator[SEP] identifier[estimateSize] operator[SEP] operator[SEP] operator[SEP]
}
identifier[task] operator[SEP] identifier[setLocalResult] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[task] operator[SEP] identifier[tryComplete] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void sessionWillPassivate(HttpSessionEvent event) {
if (!instanceEnabled) {
return;
}
// pour getSessionCount
SESSION_COUNT.decrementAndGet();
// pour invalidateAllSession
removeSession(event.getSession());
} | class class_name[name] begin[{]
method[sessionWillPassivate, return_type[void], modifier[public], parameter[event]] begin[{]
if[member[.instanceEnabled]] begin[{]
return[None]
else begin[{]
None
end[}]
call[SESSION_COUNT.decrementAndGet, parameter[]]
call[.removeSession, parameter[call[event.getSession, parameter[]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[sessionWillPassivate] operator[SEP] identifier[HttpSessionEvent] identifier[event] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[instanceEnabled] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[SESSION_COUNT] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP] identifier[removeSession] operator[SEP] identifier[event] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static AuthConfigFactory getFactory()
{
//Validate the caller permission
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPermission(getFactorySecurityPermission);
if (_factory == null)
{
if (sm != null)
sm.checkPermission(setFactorySecurityPermission);
String factoryName = null;
Class clazz = null;
try
{
LoadAction action = new LoadAction();
try
{
clazz = (Class) AccessController.doPrivileged(action);
factoryName = action.getName();
}
catch (PrivilegedActionException ex)
{
factoryName = action.getName();
Exception e = ex.getException();
if (e instanceof ClassNotFoundException)
throw (ClassNotFoundException) e;
else
throw new IllegalStateException("Failure during load of class: " + action.getName() + e);
}
_factory = (AuthConfigFactory) clazz.newInstance();
}
catch (ClassNotFoundException e)
{
String msg = "Failed to find AuthConfigFactory : " + factoryName;
IllegalStateException ise = new IllegalStateException(msg);
ise.initCause(e);
throw ise;
}
catch (IllegalAccessException e)
{
String msg = "Unable to access class : " + factoryName;
IllegalStateException ise = new IllegalStateException(msg);
ise.initCause(e);
throw ise;
}
catch (InstantiationException e)
{
String msg = "Failed to create instance of: " + factoryName;
IllegalStateException ise = new IllegalStateException(msg);
ise.initCause(e);
throw ise;
}
catch (ClassCastException e)
{
StringBuffer msg = new StringBuffer(factoryName + " Is not a AuthConfigFactory, ");
msg.append("ACF.class.CL: "+ AuthConfigFactory.class.getClassLoader());
msg.append("\nACF.class.CS: " + AuthConfigFactory.class.getProtectionDomain().getCodeSource());
msg.append("\nACF.class.hash: "+System.identityHashCode(AuthConfigFactory.class));
msg.append("\nclazz.CL: "+clazz.getClassLoader());
msg.append("\nclazz.CS: "+clazz.getProtectionDomain().getCodeSource());
msg.append("\nclazz.super.CL: "+clazz.getSuperclass().getClassLoader());
msg.append("\nclazz.super.CS: "+clazz.getSuperclass().getProtectionDomain().getCodeSource());
msg.append("\nclazz.super.hash: "+System.identityHashCode(clazz.getSuperclass()));
ClassCastException cce = new ClassCastException(msg.toString());
cce.initCause(e);
throw cce;
}
}
return _factory;
} | class class_name[name] begin[{]
method[getFactory, return_type[type[AuthConfigFactory]], modifier[public static], parameter[]] begin[{]
local_variable[type[SecurityManager], sm]
if[binary_operation[member[.sm], !=, literal[null]]] begin[{]
call[sm.checkPermission, parameter[member[.getFactorySecurityPermission]]]
else begin[{]
None
end[}]
if[binary_operation[member[._factory], ==, literal[null]]] begin[{]
if[binary_operation[member[.sm], !=, literal[null]]] begin[{]
call[sm.checkPermission, parameter[member[.setFactorySecurityPermission]]]
else begin[{]
None
end[}]
local_variable[type[String], factoryName]
local_variable[type[Class], clazz]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LoadAction, sub_type=None)), name=action)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LoadAction, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doPrivileged, postfix_operators=[], prefix_operators=[], qualifier=AccessController, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=factoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=factoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getException, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Exception, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ClassNotFoundException, sub_type=None), operator=instanceof), else_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure during load of class: "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None), operator=+), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None), label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ClassNotFoundException, sub_type=None)), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['PrivilegedActionException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_factory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AuthConfigFactory, sub_type=None))), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to find AuthConfigFactory : "), operandr=MemberReference(member=factoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), name=ise)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IllegalStateException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=ise, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ise, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to access class : "), operandr=MemberReference(member=factoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), name=ise)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IllegalStateException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=ise, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ise, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to create instance of: "), operandr=MemberReference(member=factoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), name=ise)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IllegalStateException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=ise, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ise, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstantiationException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=factoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Is not a AuthConfigFactory, "), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None)), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ACF.class.CL: "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AuthConfigFactory, sub_type=None)), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nACF.class.CS: "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getProtectionDomain, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCodeSource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AuthConfigFactory, sub_type=None)), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nACF.class.hash: "), operandr=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthConfigFactory, sub_type=None))], member=identityHashCode, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nclazz.CL: "), operandr=MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nclazz.CS: "), operandr=MethodInvocation(arguments=[], member=getProtectionDomain, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[MethodInvocation(arguments=[], member=getCodeSource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nclazz.super.CL: "), operandr=MethodInvocation(arguments=[], member=getSuperclass, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nclazz.super.CS: "), operandr=MethodInvocation(arguments=[], member=getSuperclass, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[MethodInvocation(arguments=[], member=getProtectionDomain, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCodeSource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nclazz.super.hash: "), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSuperclass, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None)], member=identityHashCode, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassCastException, sub_type=None)), name=cce)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassCastException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=cce, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=cce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[._factory]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[AuthConfigFactory] identifier[getFactory] operator[SEP] operator[SEP] {
identifier[SecurityManager] identifier[sm] operator[=] identifier[System] operator[SEP] identifier[getSecurityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sm] operator[!=] Other[null] operator[SEP] identifier[sm] operator[SEP] identifier[checkPermission] operator[SEP] identifier[getFactorySecurityPermission] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_factory] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[sm] operator[!=] Other[null] operator[SEP] identifier[sm] operator[SEP] identifier[checkPermission] operator[SEP] identifier[setFactorySecurityPermission] operator[SEP] operator[SEP] identifier[String] identifier[factoryName] operator[=] Other[null] operator[SEP] identifier[Class] identifier[clazz] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[LoadAction] identifier[action] operator[=] Keyword[new] identifier[LoadAction] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[clazz] operator[=] operator[SEP] identifier[Class] operator[SEP] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[factoryName] operator[=] identifier[action] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[PrivilegedActionException] identifier[ex] operator[SEP] {
identifier[factoryName] operator[=] identifier[action] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[Exception] identifier[e] operator[=] identifier[ex] operator[SEP] identifier[getException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[ClassNotFoundException] operator[SEP] Keyword[throw] operator[SEP] identifier[ClassNotFoundException] operator[SEP] identifier[e] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[action] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[e] operator[SEP] operator[SEP]
}
identifier[_factory] operator[=] operator[SEP] identifier[AuthConfigFactory] operator[SEP] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[factoryName] operator[SEP] identifier[IllegalStateException] identifier[ise] operator[=] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[ise] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[ise] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[factoryName] operator[SEP] identifier[IllegalStateException] identifier[ise] operator[=] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[ise] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[ise] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[factoryName] operator[SEP] identifier[IllegalStateException] identifier[ise] operator[=] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[ise] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[ise] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
identifier[StringBuffer] identifier[msg] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[factoryName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[AuthConfigFactory] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[AuthConfigFactory] operator[SEP] Keyword[class] operator[SEP] identifier[getProtectionDomain] operator[SEP] operator[SEP] operator[SEP] identifier[getCodeSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[identityHashCode] operator[SEP] identifier[AuthConfigFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getProtectionDomain] operator[SEP] operator[SEP] operator[SEP] identifier[getCodeSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] identifier[getProtectionDomain] operator[SEP] operator[SEP] operator[SEP] identifier[getCodeSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[identityHashCode] operator[SEP] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ClassCastException] identifier[cce] operator[=] Keyword[new] identifier[ClassCastException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cce] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[cce] operator[SEP]
}
}
Keyword[return] identifier[_factory] operator[SEP]
}
|
protected void processContextEntry(ServiceReference<JAASLoginContextEntry> ref) {
String id = (String) ref.getProperty(KEY_ID);
String[] modulePids = (String[]) ref.getProperty(JAASLoginContextEntryImpl.CFG_KEY_LOGIN_MODULE_REF);
boolean changedEntryContext = false;
if (modulePids == null || modulePids.length == 0) {
Tr.error(tc, "JAAS_LOGIN_CONTEXT_ENTRY_HAS_NO_LOGIN_MODULE", id);
changedEntryContext |= jaasLoginContextEntries.removeReference(id, ref);
} else {
if (haveAllModules(modulePids)) {
jaasLoginContextEntries.putReference(id, ref);
changedEntryContext = true;
} else {
// make sure it was not previously registered, as it now has a missing module
changedEntryContext |= jaasLoginContextEntries.removeReference(id, ref);
synchronized (pendingContextEntryRefs) {
pendingContextEntryRefs.add(ref);
}
}
}
if (changedEntryContext) {
modified(properties);
}
} | class class_name[name] begin[{]
method[processContextEntry, return_type[void], modifier[protected], parameter[ref]] begin[{]
local_variable[type[String], id]
local_variable[type[String], modulePids]
local_variable[type[boolean], changedEntryContext]
if[binary_operation[binary_operation[member[.modulePids], ==, literal[null]], ||, binary_operation[member[modulePids.length], ==, literal[0]]]] begin[{]
call[Tr.error, parameter[member[.tc], literal["JAAS_LOGIN_CONTEXT_ENTRY_HAS_NO_LOGIN_MODULE"], member[.id]]]
assign[member[.changedEntryContext], call[jaasLoginContextEntries.removeReference, parameter[member[.id], member[.ref]]]]
else begin[{]
if[call[.haveAllModules, parameter[member[.modulePids]]]] begin[{]
call[jaasLoginContextEntries.putReference, parameter[member[.id], member[.ref]]]
assign[member[.changedEntryContext], literal[true]]
else begin[{]
assign[member[.changedEntryContext], call[jaasLoginContextEntries.removeReference, parameter[member[.id], member[.ref]]]]
SYNCHRONIZED[member[.pendingContextEntryRefs]] BEGIN[{]
call[pendingContextEntryRefs.add, parameter[member[.ref]]]
END[}]
end[}]
end[}]
if[member[.changedEntryContext]] begin[{]
call[.modified, parameter[member[.properties]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[processContextEntry] operator[SEP] identifier[ServiceReference] operator[<] identifier[JAASLoginContextEntry] operator[>] identifier[ref] operator[SEP] {
identifier[String] identifier[id] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[ref] operator[SEP] identifier[getProperty] operator[SEP] identifier[KEY_ID] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[modulePids] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] identifier[ref] operator[SEP] identifier[getProperty] operator[SEP] identifier[JAASLoginContextEntryImpl] operator[SEP] identifier[CFG_KEY_LOGIN_MODULE_REF] operator[SEP] operator[SEP] Keyword[boolean] identifier[changedEntryContext] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[modulePids] operator[==] Other[null] operator[||] identifier[modulePids] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , identifier[id] operator[SEP] operator[SEP] identifier[changedEntryContext] operator[|=] identifier[jaasLoginContextEntries] operator[SEP] identifier[removeReference] operator[SEP] identifier[id] , identifier[ref] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[haveAllModules] operator[SEP] identifier[modulePids] operator[SEP] operator[SEP] {
identifier[jaasLoginContextEntries] operator[SEP] identifier[putReference] operator[SEP] identifier[id] , identifier[ref] operator[SEP] operator[SEP] identifier[changedEntryContext] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[changedEntryContext] operator[|=] identifier[jaasLoginContextEntries] operator[SEP] identifier[removeReference] operator[SEP] identifier[id] , identifier[ref] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[pendingContextEntryRefs] operator[SEP] {
identifier[pendingContextEntryRefs] operator[SEP] identifier[add] operator[SEP] identifier[ref] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[changedEntryContext] operator[SEP] {
identifier[modified] operator[SEP] identifier[properties] operator[SEP] operator[SEP]
}
}
|
public static PactDslJsonBody arrayMaxLike(int maxSize, int numberExamples) {
if (numberExamples > maxSize) {
throw new IllegalArgumentException(String.format("Number of example %d is more than the maximum size of %d",
numberExamples, maxSize));
}
PactDslJsonArray parent = new PactDslJsonArray("", "", null, true);
parent.setNumberExamples(numberExamples);
parent.matchers.addRule("", parent.matchMax(maxSize));
return new PactDslJsonBody(".", "", parent);
} | class class_name[name] begin[{]
method[arrayMaxLike, return_type[type[PactDslJsonBody]], modifier[public static], parameter[maxSize, numberExamples]] begin[{]
if[binary_operation[member[.numberExamples], >, member[.maxSize]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Number of example %d is more than the maximum size of %d"), MemberReference(member=numberExamples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[PactDslJsonArray], parent]
call[parent.setNumberExamples, parameter[member[.numberExamples]]]
call[parent.matchers.addRule, parameter[literal[""], call[parent.matchMax, parameter[member[.maxSize]]]]]
return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=parent, 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=PactDslJsonBody, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PactDslJsonBody] identifier[arrayMaxLike] operator[SEP] Keyword[int] identifier[maxSize] , Keyword[int] identifier[numberExamples] operator[SEP] {
Keyword[if] operator[SEP] identifier[numberExamples] operator[>] identifier[maxSize] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[numberExamples] , identifier[maxSize] operator[SEP] operator[SEP] operator[SEP]
}
identifier[PactDslJsonArray] identifier[parent] operator[=] Keyword[new] identifier[PactDslJsonArray] operator[SEP] literal[String] , literal[String] , Other[null] , literal[boolean] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[setNumberExamples] operator[SEP] identifier[numberExamples] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[matchers] operator[SEP] identifier[addRule] operator[SEP] literal[String] , identifier[parent] operator[SEP] identifier[matchMax] operator[SEP] identifier[maxSize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[PactDslJsonBody] operator[SEP] literal[String] , literal[String] , identifier[parent] operator[SEP] operator[SEP]
}
|
public void setSystemMessageSourceUuid(SIBUuid8 value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setSystemMessageSourceUuid", value);
// Clear the cached MessageHandle
cachedMessageHandle = null;
// Set the value into the message itself
if (value != null) {
jmo.setField(JsHdrAccess.SYSTEMMESSAGESOURCEUUID, value.toByteArray());
}
else {
jmo.setField(JsHdrAccess.SYSTEMMESSAGESOURCEUUID, null);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setSystemMessageSourceUuid");
} | class class_name[name] begin[{]
method[setSystemMessageSourceUuid, return_type[void], modifier[public], parameter[value]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["setSystemMessageSourceUuid"], member[.value]]]
else begin[{]
None
end[}]
assign[member[.cachedMessageHandle], literal[null]]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
call[jmo.setField, parameter[member[JsHdrAccess.SYSTEMMESSAGESOURCEUUID], call[value.toByteArray, parameter[]]]]
else begin[{]
call[jmo.setField, parameter[member[JsHdrAccess.SYSTEMMESSAGESOURCEUUID], literal[null]]]
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["setSystemMessageSourceUuid"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSystemMessageSourceUuid] operator[SEP] identifier[SIBUuid8] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[value] operator[SEP] operator[SEP] identifier[cachedMessageHandle] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[jmo] operator[SEP] identifier[setField] operator[SEP] identifier[JsHdrAccess] operator[SEP] identifier[SYSTEMMESSAGESOURCEUUID] , identifier[value] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[jmo] operator[SEP] identifier[setField] operator[SEP] identifier[JsHdrAccess] operator[SEP] identifier[SYSTEMMESSAGESOURCEUUID] , Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public void waitAndRetry() {
ContinueToSendToBatchSenderAsstManager continueToSendToBatchSenderAsstManager = new ContinueToSendToBatchSenderAsstManager(
processedWorkerCount);
logger.debug("NOW WAIT Another " + asstManagerRetryIntervalMillis
+ " MS. at " + PcDateUtils.getNowDateTimeStrStandard());
getContext()
.system()
.scheduler()
.scheduleOnce(
Duration.create(asstManagerRetryIntervalMillis,
TimeUnit.MILLISECONDS), getSelf(),
continueToSendToBatchSenderAsstManager,
getContext().system().dispatcher(), getSelf());
return;
} | class class_name[name] begin[{]
method[waitAndRetry, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[ContinueToSendToBatchSenderAsstManager], continueToSendToBatchSenderAsstManager]
call[logger.debug, parameter[binary_operation[binary_operation[binary_operation[literal["NOW WAIT Another "], +, member[.asstManagerRetryIntervalMillis]], +, literal[" MS. at "]], +, call[PcDateUtils.getNowDateTimeStrStandard, parameter[]]]]]
call[.getContext, parameter[]]
return[None]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[waitAndRetry] operator[SEP] operator[SEP] {
identifier[ContinueToSendToBatchSenderAsstManager] identifier[continueToSendToBatchSenderAsstManager] operator[=] Keyword[new] identifier[ContinueToSendToBatchSenderAsstManager] operator[SEP] identifier[processedWorkerCount] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[asstManagerRetryIntervalMillis] operator[+] literal[String] operator[+] identifier[PcDateUtils] operator[SEP] identifier[getNowDateTimeStrStandard] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[system] operator[SEP] operator[SEP] operator[SEP] identifier[scheduler] operator[SEP] operator[SEP] operator[SEP] identifier[scheduleOnce] operator[SEP] identifier[Duration] operator[SEP] identifier[create] operator[SEP] identifier[asstManagerRetryIntervalMillis] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] , identifier[getSelf] operator[SEP] operator[SEP] , identifier[continueToSendToBatchSenderAsstManager] , identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[system] operator[SEP] operator[SEP] operator[SEP] identifier[dispatcher] operator[SEP] operator[SEP] , identifier[getSelf] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
|
public static Map<TypeVariable, Type> matchVariables(final Type template, final Type real) {
final MatchVariablesVisitor visitor = new MatchVariablesVisitor();
TypesWalker.walk(template, real, visitor);
if (visitor.isHierarchyError()) {
throw new IllegalArgumentException(String.format(
"Type %s variables can't be matched from type %s because they "
+ "are not compatible",
TypeToStringUtils.toStringTypeIgnoringVariables(template),
TypeToStringUtils.toStringTypeIgnoringVariables(real)));
}
final Map<TypeVariable, Type> res = visitor.getMatched();
// to be sure that right type does not contain variables
for (Map.Entry<TypeVariable, Type> entry : res.entrySet()) {
entry.setValue(resolveAllTypeVariables(entry.getValue(), visitor.getMatchedMap()));
}
return res;
} | class class_name[name] begin[{]
method[matchVariables, return_type[type[Map]], modifier[public static], parameter[template, real]] begin[{]
local_variable[type[MatchVariablesVisitor], visitor]
call[TypesWalker.walk, parameter[member[.template], member[.real], member[.visitor]]]
if[call[visitor.isHierarchyError, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Type %s variables can't be matched from type %s because they "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="are not compatible"), operator=+), MethodInvocation(arguments=[MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toStringTypeIgnoringVariables, postfix_operators=[], prefix_operators=[], qualifier=TypeToStringUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toStringTypeIgnoringVariables, postfix_operators=[], prefix_operators=[], qualifier=TypeToStringUtils, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Map], res]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMatchedMap, postfix_operators=[], prefix_operators=[], qualifier=visitor, selectors=[], type_arguments=None)], member=resolveAllTypeVariables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TypeVariable, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[member[.res]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[TypeVariable] , identifier[Type] operator[>] identifier[matchVariables] operator[SEP] Keyword[final] identifier[Type] identifier[template] , Keyword[final] identifier[Type] identifier[real] operator[SEP] {
Keyword[final] identifier[MatchVariablesVisitor] identifier[visitor] operator[=] Keyword[new] identifier[MatchVariablesVisitor] operator[SEP] operator[SEP] operator[SEP] identifier[TypesWalker] operator[SEP] identifier[walk] operator[SEP] identifier[template] , identifier[real] , identifier[visitor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[visitor] operator[SEP] identifier[isHierarchyError] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , identifier[TypeToStringUtils] operator[SEP] identifier[toStringTypeIgnoringVariables] operator[SEP] identifier[template] operator[SEP] , identifier[TypeToStringUtils] operator[SEP] identifier[toStringTypeIgnoringVariables] operator[SEP] identifier[real] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[Map] operator[<] identifier[TypeVariable] , identifier[Type] operator[>] identifier[res] operator[=] identifier[visitor] operator[SEP] identifier[getMatched] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[TypeVariable] , identifier[Type] operator[>] identifier[entry] operator[:] identifier[res] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[entry] operator[SEP] identifier[setValue] operator[SEP] identifier[resolveAllTypeVariables] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[visitor] operator[SEP] identifier[getMatchedMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[res] operator[SEP]
}
|
public static JSONArray toJSONArray(XMLTokener x) throws JSONException {
return (JSONArray) parse(x, true, null);
} | class class_name[name] begin[{]
method[toJSONArray, return_type[type[JSONArray]], modifier[public static], parameter[x]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=parse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[JSONArray] identifier[toJSONArray] operator[SEP] identifier[XMLTokener] identifier[x] operator[SEP] Keyword[throws] identifier[JSONException] {
Keyword[return] operator[SEP] identifier[JSONArray] operator[SEP] identifier[parse] operator[SEP] identifier[x] , literal[boolean] , Other[null] operator[SEP] operator[SEP]
}
|
public static String formatProcedureName(String s) {
StringBuilder res = new StringBuilder();
boolean one = true;
for(String s1 : s.split(" ")) {
if (one) {
one = false;
res.append(s1);
}
else {
res.append(firstUpperCase(s1));
}
}
return res.toString();
} | class class_name[name] begin[{]
method[formatProcedureName, return_type[type[String]], modifier[public static], parameter[s]] begin[{]
local_variable[type[StringBuilder], res]
local_variable[type[boolean], one]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=one, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=s1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstUpperCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=one, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=split, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[call[res.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[formatProcedureName] operator[SEP] identifier[String] identifier[s] operator[SEP] {
identifier[StringBuilder] identifier[res] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[one] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s1] operator[:] identifier[s] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[one] operator[SEP] {
identifier[one] operator[=] literal[boolean] operator[SEP] identifier[res] operator[SEP] identifier[append] operator[SEP] identifier[s1] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[res] operator[SEP] identifier[append] operator[SEP] identifier[firstUpperCase] operator[SEP] identifier[s1] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[res] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public Pager<Project> getProjects(int itemsPerPage) throws GitLabApiException {
return (new Pager<Project>(this, Project.class, itemsPerPage, null, "projects"));
} | class class_name[name] begin[{]
method[getProjects, return_type[type[Pager]], modifier[public], parameter[itemsPerPage]] begin[{]
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=Project, sub_type=None)), MemberReference(member=itemsPerPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="projects")], 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=Project, sub_type=None))], dimensions=None, name=Pager, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Pager] operator[<] identifier[Project] operator[>] identifier[getProjects] operator[SEP] Keyword[int] identifier[itemsPerPage] operator[SEP] Keyword[throws] identifier[GitLabApiException] {
Keyword[return] operator[SEP] Keyword[new] identifier[Pager] operator[<] identifier[Project] operator[>] operator[SEP] Keyword[this] , identifier[Project] operator[SEP] Keyword[class] , identifier[itemsPerPage] , Other[null] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized boolean registerWithFFDCService()
{
boolean result = true;
boolean abort = false;
int retCode = 0;
int packageIndex = 0;
// Don't register more than once.
if (ivRegisteredWithFFDC)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "InjectionDiagnosticModule already registered");
result = false;
abort = true;
}
// Don't register with FFDC Service if not initialized properly.
if (ivInjectionEngine == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "InjectionDiagnosticModule not initialized: " +
"registration with FFDC Service not performed");
result = false;
abort = true;
}
// Register this class with the FFDC service under the various
// package/class names required.
while ((abort == false) && (packageIndex < ivPackageList.length))
{
retCode = FFDC.registerDiagnosticModule(this,
ivPackageList[packageIndex]);
switch (retCode)
{
case 0:
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "InjectionDiagnosticModule successfully " +
"registered for package " + ivPackageList[packageIndex]);
break;
case 1:
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Unable to register InjectionDiagnosticModule " +
"as another diagnostic module has already been " +
"registered with the package " +
ivPackageList[packageIndex]);
result = false;
break;
case 2:
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Unable to register InjectionDiagnosticModule " +
"as it does not support the minimum diagnostic module " +
"interface.");
result = false;
abort = true;
break;
case 3:
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Unable to register InjectionDiagnosticModule " +
"due to an unknown failure.");
result = false;
abort = true;
break;
default:
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "InjectionDiagnosticModule registration with " +
ivPackageList[packageIndex] + " resulted in an " +
"unexpected return code: " + retCode);
result = false;
abort = true;
break;
}
packageIndex++;
}
return result;
} | class class_name[name] begin[{]
method[registerWithFFDCService, return_type[type[boolean]], modifier[synchronized public], parameter[]] begin[{]
local_variable[type[boolean], result]
local_variable[type[boolean], abort]
local_variable[type[int], retCode]
local_variable[type[int], packageIndex]
if[member[.ivRegisteredWithFFDC]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{]
call[Tr.event, parameter[member[.tc], literal["InjectionDiagnosticModule already registered"]]]
else begin[{]
None
end[}]
assign[member[.result], literal[false]]
assign[member[.abort], literal[true]]
else begin[{]
None
end[}]
if[binary_operation[member[.ivInjectionEngine], ==, literal[null]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{]
call[Tr.event, parameter[member[.tc], binary_operation[literal["InjectionDiagnosticModule not initialized: "], +, literal["registration with FFDC Service not performed"]]]]
else begin[{]
None
end[}]
assign[member[.result], literal[false]]
assign[member[.abort], literal[true]]
else begin[{]
None
end[}]
while[binary_operation[binary_operation[member[.abort], ==, literal[false]], &&, binary_operation[member[.packageIndex], <, member[ivPackageList.length]]]] begin[{]
assign[member[.retCode], call[FFDC.registerDiagnosticModule, parameter[THIS[], member[.ivPackageList]]]]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InjectionDiagnosticModule successfully "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="registered for package "), operator=+), operandr=MemberReference(member=ivPackageList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=packageIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to register InjectionDiagnosticModule "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="as another diagnostic module has already been "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="registered with the package "), operator=+), operandr=MemberReference(member=ivPackageList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=packageIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to register InjectionDiagnosticModule "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="as it does not support the minimum diagnostic module "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="interface."), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=abort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to register InjectionDiagnosticModule "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="due to an unknown failure."), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=abort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InjectionDiagnosticModule registration with "), operandr=MemberReference(member=ivPackageList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=packageIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" resulted in an "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unexpected return code: "), operator=+), operandr=MemberReference(member=retCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=abort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=retCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
member[.packageIndex]
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[registerWithFFDCService] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[abort] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[retCode] operator[=] Other[0] operator[SEP] Keyword[int] identifier[packageIndex] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[ivRegisteredWithFFDC] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP] identifier[abort] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ivInjectionEngine] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP] identifier[abort] operator[=] literal[boolean] operator[SEP]
}
Keyword[while] operator[SEP] operator[SEP] identifier[abort] operator[==] literal[boolean] operator[SEP] operator[&&] operator[SEP] identifier[packageIndex] operator[<] identifier[ivPackageList] operator[SEP] identifier[length] operator[SEP] operator[SEP] {
identifier[retCode] operator[=] identifier[FFDC] operator[SEP] identifier[registerDiagnosticModule] operator[SEP] Keyword[this] , identifier[ivPackageList] operator[SEP] identifier[packageIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[retCode] operator[SEP] {
Keyword[case] Other[0] operator[:] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] identifier[ivPackageList] operator[SEP] identifier[packageIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[1] operator[:] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[ivPackageList] operator[SEP] identifier[packageIndex] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP] identifier[abort] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP] identifier[abort] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[ivPackageList] operator[SEP] identifier[packageIndex] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[retCode] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP] identifier[abort] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
identifier[packageIndex] operator[++] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
protected Content getProfile(String profileName) {
Content profileLinkContent;
Content profileLabel;
profileLabel = new StringContent(profileName);
profileLinkContent = getHyperLink(DocPaths.profileFrame(profileName), profileLabel, "",
"packageListFrame");
Content li = HtmlTree.LI(profileLinkContent);
return li;
} | class class_name[name] begin[{]
method[getProfile, return_type[type[Content]], modifier[protected], parameter[profileName]] begin[{]
local_variable[type[Content], profileLinkContent]
local_variable[type[Content], profileLabel]
assign[member[.profileLabel], ClassCreator(arguments=[MemberReference(member=profileName, 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=StringContent, sub_type=None))]
assign[member[.profileLinkContent], call[.getHyperLink, parameter[call[DocPaths.profileFrame, parameter[member[.profileName]]], member[.profileLabel], literal[""], literal["packageListFrame"]]]]
local_variable[type[Content], li]
return[member[.li]]
end[}]
END[}] | Keyword[protected] identifier[Content] identifier[getProfile] operator[SEP] identifier[String] identifier[profileName] operator[SEP] {
identifier[Content] identifier[profileLinkContent] operator[SEP] identifier[Content] identifier[profileLabel] operator[SEP] identifier[profileLabel] operator[=] Keyword[new] identifier[StringContent] operator[SEP] identifier[profileName] operator[SEP] operator[SEP] identifier[profileLinkContent] operator[=] identifier[getHyperLink] operator[SEP] identifier[DocPaths] operator[SEP] identifier[profileFrame] operator[SEP] identifier[profileName] operator[SEP] , identifier[profileLabel] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Content] identifier[li] operator[=] identifier[HtmlTree] operator[SEP] identifier[LI] operator[SEP] identifier[profileLinkContent] operator[SEP] operator[SEP] Keyword[return] identifier[li] operator[SEP]
}
|
public void validateName(final String name) {
Validate.validState(
TENANT_NAME_VALIDATOR_PATTERN.matcher(name).matches(),
"Invalid tenant name '%s' -- names must match %s .",
name,
TENANT_NAME_VALIDATOR_REGEX);
} | class class_name[name] begin[{]
method[validateName, return_type[void], modifier[public], parameter[name]] begin[{]
call[Validate.validState, parameter[call[TENANT_NAME_VALIDATOR_PATTERN.matcher, parameter[member[.name]]], literal["Invalid tenant name '%s' -- names must match %s ."], member[.name], member[.TENANT_NAME_VALIDATOR_REGEX]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[validateName] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] {
identifier[Validate] operator[SEP] identifier[validState] operator[SEP] identifier[TENANT_NAME_VALIDATOR_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] , literal[String] , identifier[name] , identifier[TENANT_NAME_VALIDATOR_REGEX] operator[SEP] operator[SEP]
}
|
public final void reset(boolean resetChunkSize) {
markBufferChanged();
firstChunk = null;
lastChunk = null;
totalCharsInList = 0;
totalCharsInDynamicChunks = -1;
sizeAtLeast = -1;
if (resetChunkSize) {
chunkSize = firstChunkSize;
totalChunkSize = 0;
}
if (allocBuffer == null) {
allocBuffer = new AllocatedBuffer(chunkSize);
} else {
allocBuffer.clear();
}
if (dynamicChunkMap == null) {
dynamicChunkMap = new HashMap<StreamCharBufferKey, StreamCharBufferSubChunk>();
} else {
dynamicChunkMap.clear();
}
} | class class_name[name] begin[{]
method[reset, return_type[void], modifier[final public], parameter[resetChunkSize]] begin[{]
call[.markBufferChanged, parameter[]]
assign[member[.firstChunk], literal[null]]
assign[member[.lastChunk], literal[null]]
assign[member[.totalCharsInList], literal[0]]
assign[member[.totalCharsInDynamicChunks], literal[1]]
assign[member[.sizeAtLeast], literal[1]]
if[member[.resetChunkSize]] begin[{]
assign[member[.chunkSize], member[.firstChunkSize]]
assign[member[.totalChunkSize], literal[0]]
else begin[{]
None
end[}]
if[binary_operation[member[.allocBuffer], ==, literal[null]]] begin[{]
assign[member[.allocBuffer], ClassCreator(arguments=[MemberReference(member=chunkSize, 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=AllocatedBuffer, sub_type=None))]
else begin[{]
call[allocBuffer.clear, parameter[]]
end[}]
if[binary_operation[member[.dynamicChunkMap], ==, literal[null]]] begin[{]
assign[member[.dynamicChunkMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StreamCharBufferKey, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StreamCharBufferSubChunk, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
else begin[{]
call[dynamicChunkMap.clear, parameter[]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[reset] operator[SEP] Keyword[boolean] identifier[resetChunkSize] operator[SEP] {
identifier[markBufferChanged] operator[SEP] operator[SEP] operator[SEP] identifier[firstChunk] operator[=] Other[null] operator[SEP] identifier[lastChunk] operator[=] Other[null] operator[SEP] identifier[totalCharsInList] operator[=] Other[0] operator[SEP] identifier[totalCharsInDynamicChunks] operator[=] operator[-] Other[1] operator[SEP] identifier[sizeAtLeast] operator[=] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[resetChunkSize] operator[SEP] {
identifier[chunkSize] operator[=] identifier[firstChunkSize] operator[SEP] identifier[totalChunkSize] operator[=] Other[0] operator[SEP]
}
Keyword[if] operator[SEP] identifier[allocBuffer] operator[==] Other[null] operator[SEP] {
identifier[allocBuffer] operator[=] Keyword[new] identifier[AllocatedBuffer] operator[SEP] identifier[chunkSize] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[allocBuffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dynamicChunkMap] operator[==] Other[null] operator[SEP] {
identifier[dynamicChunkMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[StreamCharBufferKey] , identifier[StreamCharBufferSubChunk] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[dynamicChunkMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void setGenericKeywords(java.util.Collection<String> genericKeywords) {
if (genericKeywords == null) {
this.genericKeywords = null;
return;
}
this.genericKeywords = new java.util.ArrayList<String>(genericKeywords);
} | class class_name[name] begin[{]
method[setGenericKeywords, return_type[void], modifier[public], parameter[genericKeywords]] begin[{]
if[binary_operation[member[.genericKeywords], ==, literal[null]]] begin[{]
assign[THIS[member[None.genericKeywords]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.genericKeywords]], ClassCreator(arguments=[MemberReference(member=genericKeywords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setGenericKeywords] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[genericKeywords] operator[SEP] {
Keyword[if] operator[SEP] identifier[genericKeywords] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[genericKeywords] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[genericKeywords] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[genericKeywords] operator[SEP] operator[SEP]
}
|
static String resolveDuplicateName(String name){
if(name.matches("^copy\\d+\\..*$")){ // If true - means bean name already contain copy prefix
// Parsing copy number from prefix to increase it
// Copy number contains in the prefix end -
// StringBuilder is required to reverse string
StringBuilder copyPrefix =
new StringBuilder(
name.substring(0, name.indexOf('.'))
);
// Collects copy number digits
StringBuilder copyNumber = new StringBuilder();
// Reverting copy prefix and collecting digits
for(Character prefixChar : copyPrefix.reverse().toString().toCharArray())
if(Character.isDigit(prefixChar))
copyNumber.append(prefixChar);
else break; // loop reach end of 'copy' word. No copy number digits left
return "copy" +
// Parsing copy number to integer and increase it
String.valueOf(
Integer.parseInt(
// Digits are collected in reverse order, reverse it again
copyNumber.reverse().toString()
) + 1
) + "." +
name.substring(name.indexOf('.') + 1); // Remove old prefix
}
else
return "copy1." + name;
} | class class_name[name] begin[{]
method[resolveDuplicateName, return_type[type[String]], modifier[static], parameter[name]] begin[{]
if[call[name.matches, parameter[literal["^copy\\d+\\..*$"]]]] begin[{]
local_variable[type[StringBuilder], copyPrefix]
local_variable[type[StringBuilder], copyNumber]
ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=prefixChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDigit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=BreakStatement(goto=None, label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefixChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=copyNumber, selectors=[], type_arguments=None), label=None)), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=reverse, postfix_operators=[], prefix_operators=[], qualifier=copyPrefix, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toCharArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prefixChar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Character, sub_type=None))), label=None)
return[binary_operation[binary_operation[binary_operation[literal["copy"], +, call[String.valueOf, parameter[binary_operation[call[Integer.parseInt, parameter[call[copyNumber.reverse, parameter[]]]], +, literal[1]]]]], +, literal["."]], +, call[name.substring, parameter[binary_operation[call[name.indexOf, parameter[literal['.']]], +, literal[1]]]]]]
else begin[{]
return[binary_operation[literal["copy1."], +, member[.name]]]
end[}]
end[}]
END[}] | Keyword[static] identifier[String] identifier[resolveDuplicateName] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[copyPrefix] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[name] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[copyNumber] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Character] identifier[prefixChar] operator[:] identifier[copyPrefix] operator[SEP] identifier[reverse] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isDigit] operator[SEP] identifier[prefixChar] operator[SEP] operator[SEP] identifier[copyNumber] operator[SEP] identifier[append] operator[SEP] identifier[prefixChar] operator[SEP] operator[SEP] Keyword[else] Keyword[break] operator[SEP] Keyword[return] literal[String] operator[+] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[copyNumber] operator[SEP] identifier[reverse] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[+] identifier[name] operator[SEP] identifier[substring] operator[SEP] identifier[name] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[return] literal[String] operator[+] identifier[name] operator[SEP]
}
|
public void disableAutoCompaction()
{
for (String ksname : Schema.instance.getNonSystemKeyspaces())
{
for (ColumnFamilyStore cfs : Keyspace.open(ksname).getColumnFamilyStores())
cfs.disableAutoCompaction();
}
} | class class_name[name] begin[{]
method[disableAutoCompaction, return_type[void], modifier[public], parameter[]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[], member=disableAutoCompaction, postfix_operators=[], prefix_operators=[], qualifier=cfs, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=ksname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=open, postfix_operators=[], prefix_operators=[], qualifier=Keyspace, selectors=[MethodInvocation(arguments=[], member=getColumnFamilyStores, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cfs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnFamilyStore, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getNonSystemKeyspaces, postfix_operators=[], prefix_operators=[], qualifier=Schema.instance, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ksname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[disableAutoCompaction] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[ksname] operator[:] identifier[Schema] operator[SEP] identifier[instance] operator[SEP] identifier[getNonSystemKeyspaces] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[ColumnFamilyStore] identifier[cfs] operator[:] identifier[Keyspace] operator[SEP] identifier[open] operator[SEP] identifier[ksname] operator[SEP] operator[SEP] identifier[getColumnFamilyStores] operator[SEP] operator[SEP] operator[SEP] identifier[cfs] operator[SEP] identifier[disableAutoCompaction] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static Throwable unwrap(@Nullable Throwable t) {
if (t instanceof UncheckedException || t instanceof java.util.concurrent.ExecutionException
|| t instanceof java.lang.reflect.InvocationTargetException
|| t instanceof UndeclaredThrowableException) {
return t.getCause();
}
return t;
} | class class_name[name] begin[{]
method[unwrap, return_type[type[Throwable]], modifier[public static], parameter[t]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.t], instanceof, type[UncheckedException]], ||, binary_operation[member[.t], instanceof, type[java]]], ||, binary_operation[member[.t], instanceof, type[java]]], ||, binary_operation[member[.t], instanceof, type[UndeclaredThrowableException]]]] begin[{]
return[call[t.getCause, parameter[]]]
else begin[{]
None
end[}]
return[member[.t]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Throwable] identifier[unwrap] operator[SEP] annotation[@] identifier[Nullable] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[UncheckedException] operator[||] identifier[t] Keyword[instanceof] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[concurrent] operator[SEP] identifier[ExecutionException] operator[||] identifier[t] Keyword[instanceof] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[InvocationTargetException] operator[||] identifier[t] Keyword[instanceof] identifier[UndeclaredThrowableException] operator[SEP] {
Keyword[return] identifier[t] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[t] operator[SEP]
}
|
public void marshall(KeyUsage keyUsage, ProtocolMarshaller protocolMarshaller) {
if (keyUsage == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(keyUsage.getName(), NAME_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[keyUsage, protocolMarshaller]] begin[{]
if[binary_operation[member[.keyUsage], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=keyUsage, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], 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[KeyUsage] identifier[keyUsage] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[keyUsage] 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[keyUsage] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_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 <E extends Comparable<E>> void sortDescending(List<E> list) {
Quicksort.sort(list, 0, list.size() - 1, true);
} | class class_name[name] begin[{]
method[sortDescending, return_type[void], modifier[public static], parameter[list]] begin[{]
call[Quicksort.sort, parameter[member[.list], literal[0], binary_operation[call[list.size, parameter[]], -, literal[1]], literal[true]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[Comparable] operator[<] identifier[E] operator[>] operator[>] Keyword[void] identifier[sortDescending] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] identifier[list] operator[SEP] {
identifier[Quicksort] operator[SEP] identifier[sort] operator[SEP] identifier[list] , Other[0] , identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] , literal[boolean] operator[SEP] operator[SEP]
}
|
private int getUniqueGeneReference(Collection<KamNode> nodes) {
//count all protienAbundance reference
Set<String> uniqueLabels = new HashSet<String>();
for (KamNode node : nodes) {
if (node.getFunctionType() == FunctionEnum.PROTEIN_ABUNDANCE
&& StringUtils.countMatches(node.getLabel(), "(") == 1
&& StringUtils.countMatches(node.getLabel(), ")") == 1) {
uniqueLabels.add(node.getLabel());
}
}
return uniqueLabels.size();
} | class class_name[name] begin[{]
method[getUniqueGeneReference, return_type[type[int]], modifier[private], parameter[nodes]] begin[{]
local_variable[type[Set], uniqueLabels]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFunctionType, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operandr=MemberReference(member=PROTEIN_ABUNDANCE, postfix_operators=[], prefix_operators=[], qualifier=FunctionEnum, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(")], member=countMatches, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=countMatches, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=uniqueLabels, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KamNode, sub_type=None))), label=None)
return[call[uniqueLabels.size, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[getUniqueGeneReference] operator[SEP] identifier[Collection] operator[<] identifier[KamNode] operator[>] identifier[nodes] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[uniqueLabels] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[KamNode] identifier[node] operator[:] identifier[nodes] operator[SEP] {
Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[getFunctionType] operator[SEP] operator[SEP] operator[==] identifier[FunctionEnum] operator[SEP] identifier[PROTEIN_ABUNDANCE] operator[&&] identifier[StringUtils] operator[SEP] identifier[countMatches] operator[SEP] identifier[node] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[==] Other[1] operator[&&] identifier[StringUtils] operator[SEP] identifier[countMatches] operator[SEP] identifier[node] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[uniqueLabels] operator[SEP] identifier[add] operator[SEP] identifier[node] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[uniqueLabels] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void configureWriteCache(long initDelay, long delayCache, long cacheSize){
client.initTimer(initDelay, delayCache,cacheSize);
} | class class_name[name] begin[{]
method[configureWriteCache, return_type[void], modifier[public], parameter[initDelay, delayCache, cacheSize]] begin[{]
call[client.initTimer, parameter[member[.initDelay], member[.delayCache], member[.cacheSize]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[configureWriteCache] operator[SEP] Keyword[long] identifier[initDelay] , Keyword[long] identifier[delayCache] , Keyword[long] identifier[cacheSize] operator[SEP] {
identifier[client] operator[SEP] identifier[initTimer] operator[SEP] identifier[initDelay] , identifier[delayCache] , identifier[cacheSize] operator[SEP] operator[SEP]
}
|
protected void init(ConfigurationValueProvider[] configurationValueProviders) {
Object containerValue = null;
for (ConfigurationValueProvider container : configurationValueProviders) {
containerValue = container.getValue(namespace, name);
for (String alias : aliases) {
if (containerValue != null) {
break;
}
containerValue = container.getValue(namespace, alias);
}
}
if (containerValue == null) {
value = defaultValue;
} else {
try {
value = valueOf(containerValue);
wasOverridden = true;
} catch (NumberFormatException e) {
throw new UnexpectedLiquibaseException("Error parsing "+containerValue+" as a "+type.getSimpleName());
}
}
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[protected], parameter[configurationValueProviders]] begin[{]
local_variable[type[Object], containerValue]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=containerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=containerValue, 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=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=containerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=aliases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=alias)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=configurationValueProviders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=container)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationValueProvider, sub_type=None))), label=None)
if[binary_operation[member[.containerValue], ==, literal[null]]] begin[{]
assign[member[.value], member[.defaultValue]]
else begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=containerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=wasOverridden, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error parsing "), operandr=MemberReference(member=containerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" as a "), operator=+), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnexpectedLiquibaseException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[init] operator[SEP] identifier[ConfigurationValueProvider] operator[SEP] operator[SEP] identifier[configurationValueProviders] operator[SEP] {
identifier[Object] identifier[containerValue] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[ConfigurationValueProvider] identifier[container] operator[:] identifier[configurationValueProviders] operator[SEP] {
identifier[containerValue] operator[=] identifier[container] operator[SEP] identifier[getValue] operator[SEP] identifier[namespace] , identifier[name] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[alias] operator[:] identifier[aliases] operator[SEP] {
Keyword[if] operator[SEP] identifier[containerValue] operator[!=] Other[null] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[containerValue] operator[=] identifier[container] operator[SEP] identifier[getValue] operator[SEP] identifier[namespace] , identifier[alias] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[containerValue] operator[==] Other[null] operator[SEP] {
identifier[value] operator[=] identifier[defaultValue] operator[SEP]
}
Keyword[else] {
Keyword[try] {
identifier[value] operator[=] identifier[valueOf] operator[SEP] identifier[containerValue] operator[SEP] operator[SEP] identifier[wasOverridden] operator[=] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnexpectedLiquibaseException] operator[SEP] literal[String] operator[+] identifier[containerValue] operator[+] literal[String] operator[+] identifier[type] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Deprecated
public static DateTimePatternGenerator getFrozenInstance(ULocale uLocale) {
String localeKey = uLocale.toString();
DateTimePatternGenerator result = DTPNG_CACHE.get(localeKey);
if (result != null) {
return result;
}
result = new DateTimePatternGenerator();
result.initData(uLocale);
// freeze and cache
result.freeze();
DTPNG_CACHE.put(localeKey, result);
return result;
} | class class_name[name] begin[{]
method[getFrozenInstance, return_type[type[DateTimePatternGenerator]], modifier[public static], parameter[uLocale]] begin[{]
local_variable[type[String], localeKey]
local_variable[type[DateTimePatternGenerator], result]
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
return[member[.result]]
else begin[{]
None
end[}]
assign[member[.result], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimePatternGenerator, sub_type=None))]
call[result.initData, parameter[member[.uLocale]]]
call[result.freeze, parameter[]]
call[DTPNG_CACHE.put, parameter[member[.localeKey], member[.result]]]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[DateTimePatternGenerator] identifier[getFrozenInstance] operator[SEP] identifier[ULocale] identifier[uLocale] operator[SEP] {
identifier[String] identifier[localeKey] operator[=] identifier[uLocale] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[DateTimePatternGenerator] identifier[result] operator[=] identifier[DTPNG_CACHE] operator[SEP] identifier[get] operator[SEP] identifier[localeKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[result] operator[SEP]
}
identifier[result] operator[=] Keyword[new] identifier[DateTimePatternGenerator] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[initData] operator[SEP] identifier[uLocale] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[freeze] operator[SEP] operator[SEP] operator[SEP] identifier[DTPNG_CACHE] operator[SEP] identifier[put] operator[SEP] identifier[localeKey] , identifier[result] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
private void appendOptionalElementIDFromHint(StringBuilder sb) {
String elementID = (String) this.hints.get(SVGHints.KEY_ELEMENT_ID);
if (elementID != null) {
this.hints.put(SVGHints.KEY_ELEMENT_ID, null); // clear it
if (this.elementIDs.contains(elementID)) {
throw new IllegalStateException("The element id "
+ elementID + " is already used.");
} else {
this.elementIDs.add(elementID);
}
this.sb.append("id=\"").append(elementID).append("\" ");
}
} | class class_name[name] begin[{]
method[appendOptionalElementIDFromHint, return_type[void], modifier[private], parameter[sb]] begin[{]
local_variable[type[String], elementID]
if[binary_operation[member[.elementID], !=, literal[null]]] begin[{]
THIS[member[None.hints]call[None.put, parameter[member[SVGHints.KEY_ELEMENT_ID], literal[null]]]]
if[THIS[member[None.elementIDs]call[None.contains, parameter[member[.elementID]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The element id "), operandr=MemberReference(member=elementID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is already used."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
THIS[member[None.elementIDs]call[None.add, parameter[member[.elementID]]]]
end[}]
THIS[member[None.sb]call[None.append, parameter[literal["id=\""]]]call[None.append, parameter[member[.elementID]]]call[None.append, parameter[literal["\" "]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[appendOptionalElementIDFromHint] operator[SEP] identifier[StringBuilder] identifier[sb] operator[SEP] {
identifier[String] identifier[elementID] operator[=] operator[SEP] identifier[String] operator[SEP] Keyword[this] operator[SEP] identifier[hints] operator[SEP] identifier[get] operator[SEP] identifier[SVGHints] operator[SEP] identifier[KEY_ELEMENT_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elementID] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[hints] operator[SEP] identifier[put] operator[SEP] identifier[SVGHints] operator[SEP] identifier[KEY_ELEMENT_ID] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[elementIDs] operator[SEP] identifier[contains] operator[SEP] identifier[elementID] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[elementID] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[elementIDs] operator[SEP] identifier[add] operator[SEP] identifier[elementID] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[elementID] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public Subscription subscribe(String jid, SubscribeForm subForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
request.addExtension(new FormNode(FormNodeType.OPTIONS, subForm));
PubSub reply = sendPubsubPacket(request);
return reply.getExtension(PubSubElementType.SUBSCRIPTION);
} | class class_name[name] begin[{]
method[subscribe, return_type[type[Subscription]], modifier[public], parameter[jid, subForm]] begin[{]
local_variable[type[PubSub], request]
call[request.addExtension, parameter[ClassCreator(arguments=[MemberReference(member=OPTIONS, postfix_operators=[], prefix_operators=[], qualifier=FormNodeType, selectors=[]), MemberReference(member=subForm, 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=FormNode, sub_type=None))]]
local_variable[type[PubSub], reply]
return[call[reply.getExtension, parameter[member[PubSubElementType.SUBSCRIPTION]]]]
end[}]
END[}] | Keyword[public] identifier[Subscription] identifier[subscribe] operator[SEP] identifier[String] identifier[jid] , identifier[SubscribeForm] identifier[subForm] operator[SEP] Keyword[throws] identifier[NoResponseException] , identifier[XMPPErrorException] , identifier[NotConnectedException] , identifier[InterruptedException] {
identifier[PubSub] identifier[request] operator[=] identifier[createPubsubPacket] operator[SEP] identifier[Type] operator[SEP] identifier[set] , Keyword[new] identifier[SubscribeExtension] operator[SEP] identifier[jid] , identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[addExtension] operator[SEP] Keyword[new] identifier[FormNode] operator[SEP] identifier[FormNodeType] operator[SEP] identifier[OPTIONS] , identifier[subForm] operator[SEP] operator[SEP] operator[SEP] identifier[PubSub] identifier[reply] operator[=] identifier[sendPubsubPacket] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[reply] operator[SEP] identifier[getExtension] operator[SEP] identifier[PubSubElementType] operator[SEP] identifier[SUBSCRIPTION] operator[SEP] operator[SEP]
}
|
private static EvictionListener<StatementMethod, StatementHolder> getListener() {
return new EvictionListener<StatementMethod, StatementHolder>() {
@Override
public void onEviction(StatementMethod statementMethod, StatementHolder statementHolder) {
if (statementHolder.state().getAndSet(EVICTED) == AVAILABLE) {
quietClose(statementHolder.rawStatement());
}
if (logger.isTraceEnabled()) {
logger.trace("Evicted {}", statementHolder.rawStatement());
}
}
};
} | class class_name[name] begin[{]
method[getListener, return_type[type[EvictionListener]], modifier[private static], parameter[]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=state, postfix_operators=[], prefix_operators=[], qualifier=statementHolder, selectors=[MethodInvocation(arguments=[MemberReference(member=EVICTED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAndSet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=AVAILABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rawStatement, postfix_operators=[], prefix_operators=[], qualifier=statementHolder, selectors=[], type_arguments=None)], member=quietClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, 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="Evicted {}"), MethodInvocation(arguments=[], member=rawStatement, postfix_operators=[], prefix_operators=[], qualifier=statementHolder, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=onEviction, parameters=[FormalParameter(annotations=[], modifiers=set(), name=statementMethod, type=ReferenceType(arguments=None, dimensions=[], name=StatementMethod, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=statementHolder, type=ReferenceType(arguments=None, dimensions=[], name=StatementHolder, 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=StatementMethod, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StatementHolder, sub_type=None))], dimensions=None, name=EvictionListener, sub_type=None))]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[EvictionListener] operator[<] identifier[StatementMethod] , identifier[StatementHolder] operator[>] identifier[getListener] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[EvictionListener] operator[<] identifier[StatementMethod] , identifier[StatementHolder] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onEviction] operator[SEP] identifier[StatementMethod] identifier[statementMethod] , identifier[StatementHolder] identifier[statementHolder] operator[SEP] {
Keyword[if] operator[SEP] identifier[statementHolder] operator[SEP] identifier[state] operator[SEP] operator[SEP] operator[SEP] identifier[getAndSet] operator[SEP] identifier[EVICTED] operator[SEP] operator[==] identifier[AVAILABLE] operator[SEP] {
identifier[quietClose] operator[SEP] identifier[statementHolder] operator[SEP] identifier[rawStatement] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[statementHolder] operator[SEP] identifier[rawStatement] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
} operator[SEP]
}
|
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
currentRequest.set(req);
try {
// check to OpenCms runlevel
int runlevel = OpenCmsCore.getInstance().getRunLevel();
// write OpenCms server identification in the response header
res.setHeader(CmsRequestUtil.HEADER_SERVER, OpenCmsCore.getInstance().getSystemInfo().getVersion());
if (runlevel != OpenCms.RUNLEVEL_4_SERVLET_ACCESS) {
// not the "normal" servlet runlevel
if (runlevel == OpenCms.RUNLEVEL_3_SHELL_ACCESS) {
// we have shell runlevel only, upgrade to servlet runlevel (required after setup wizard)
init(getServletConfig());
} else {
// illegal runlevel, we can't process requests
// sending status code 403, indicating the server understood the request but refused to fulfill it
res.sendError(HttpServletResponse.SC_FORBIDDEN);
// goodbye
return;
}
}
String path = OpenCmsCore.getInstance().getPathInfo(req);
if (path.startsWith(HANDLE_PATH)) {
// this is a request to an OpenCms handler URI
invokeHandler(req, res);
} else if (path.endsWith(HANDLE_GWT)) {
// handle GWT rpc services
String serviceName = CmsResource.getName(path);
serviceName = serviceName.substring(0, serviceName.length() - HANDLE_GWT.length());
OpenCmsCore.getInstance().invokeGwtService(serviceName, req, res, getServletConfig());
} else {
// standard request to a URI in the OpenCms VFS
OpenCmsCore.getInstance().showResource(req, res);
}
} finally {
currentRequest.remove();
}
} | class class_name[name] begin[{]
method[doGet, return_type[void], modifier[public], parameter[req, res]] begin[{]
call[currentRequest.set, parameter[member[.req]]]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsCore, selectors=[MethodInvocation(arguments=[], member=getRunLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=runlevel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=HEADER_SERVER, postfix_operators=[], prefix_operators=[], qualifier=CmsRequestUtil, selectors=[]), MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsCore, selectors=[MethodInvocation(arguments=[], member=getSystemInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getVersion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=runlevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=RUNLEVEL_4_SERVLET_ACCESS, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=runlevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=RUNLEVEL_3_SHELL_ACCESS, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SC_FORBIDDEN, postfix_operators=[], prefix_operators=[], qualifier=HttpServletResponse, selectors=[])], member=sendError, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServletConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=init, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsCore, selectors=[MethodInvocation(arguments=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPathInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=HANDLE_PATH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=HANDLE_GWT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsCore, selectors=[MethodInvocation(arguments=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=showResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getName, postfix_operators=[], prefix_operators=[], qualifier=CmsResource, selectors=[], type_arguments=None), name=serviceName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=serviceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=serviceName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=HANDLE_GWT, selectors=[], type_arguments=None), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=serviceName, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsCore, selectors=[MethodInvocation(arguments=[MemberReference(member=serviceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getServletConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=invokeGwtService, 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=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=currentRequest, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doGet] operator[SEP] identifier[HttpServletRequest] identifier[req] , identifier[HttpServletResponse] identifier[res] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] {
identifier[currentRequest] operator[SEP] identifier[set] operator[SEP] identifier[req] operator[SEP] operator[SEP] Keyword[try] {
Keyword[int] identifier[runlevel] operator[=] identifier[OpenCmsCore] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getRunLevel] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setHeader] operator[SEP] identifier[CmsRequestUtil] operator[SEP] identifier[HEADER_SERVER] , identifier[OpenCmsCore] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getSystemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[runlevel] operator[!=] identifier[OpenCms] operator[SEP] identifier[RUNLEVEL_4_SERVLET_ACCESS] operator[SEP] {
Keyword[if] operator[SEP] identifier[runlevel] operator[==] identifier[OpenCms] operator[SEP] identifier[RUNLEVEL_3_SHELL_ACCESS] operator[SEP] {
identifier[init] operator[SEP] identifier[getServletConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[res] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_FORBIDDEN] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
identifier[String] identifier[path] operator[=] identifier[OpenCmsCore] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getPathInfo] operator[SEP] identifier[req] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] identifier[HANDLE_PATH] operator[SEP] operator[SEP] {
identifier[invokeHandler] operator[SEP] identifier[req] , identifier[res] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[endsWith] operator[SEP] identifier[HANDLE_GWT] operator[SEP] operator[SEP] {
identifier[String] identifier[serviceName] operator[=] identifier[CmsResource] operator[SEP] identifier[getName] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[serviceName] operator[=] identifier[serviceName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[serviceName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[HANDLE_GWT] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[OpenCmsCore] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[invokeGwtService] operator[SEP] identifier[serviceName] , identifier[req] , identifier[res] , identifier[getServletConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[OpenCmsCore] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[showResource] operator[SEP] identifier[req] , identifier[res] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[currentRequest] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected void record( final SingleVariableDeclaration variable,
final Node parentNode ) throws Exception {
final String name = variable.getName().getFullyQualifiedName();
final Node paramNode = parentNode.addNode(name, ClassFileSequencerLexicon.PARAMETER);
paramNode.setProperty(ClassFileSequencerLexicon.NAME, name);
paramNode.setProperty(ClassFileSequencerLexicon.FINAL, (variable.getModifiers() & Modifier.FINAL) != 0);
paramNode.setProperty(ClassFileSequencerLexicon.VARARGS, variable.isVarargs());
{ // type
final Type type = variable.getType();
final String typeName = getTypeName(type);
paramNode.setProperty(ClassFileSequencerLexicon.TYPE_CLASS_NAME, typeName);
record(type, ClassFileSequencerLexicon.TYPE, paramNode);
}
{ // initializer
final Expression initializer = variable.getInitializer();
if (initializer != null) {
recordExpression(initializer, ClassFileSequencerLexicon.INITIALIZER, paramNode);
}
}
{ // annotations
@SuppressWarnings( "unchecked" )
final List<IExtendedModifier> modifiers = variable.modifiers();
recordAnnotations(modifiers, paramNode);
}
recordSourceReference(variable, paramNode);
} | class class_name[name] begin[{]
method[record, return_type[void], modifier[protected], parameter[variable, parentNode]] begin[{]
local_variable[type[String], name]
local_variable[type[Node], paramNode]
call[paramNode.setProperty, parameter[member[ClassFileSequencerLexicon.NAME], member[.name]]]
call[paramNode.setProperty, parameter[member[ClassFileSequencerLexicon.FINAL], binary_operation[binary_operation[call[variable.getModifiers, parameter[]], &, member[Modifier.FINAL]], !=, literal[0]]]]
call[paramNode.setProperty, parameter[member[ClassFileSequencerLexicon.VARARGS], call[variable.isVarargs, parameter[]]]]
local_variable[type[Type], type]
local_variable[type[String], typeName]
call[paramNode.setProperty, parameter[member[ClassFileSequencerLexicon.TYPE_CLASS_NAME], member[.typeName]]]
call[.record, parameter[member[.type], member[ClassFileSequencerLexicon.TYPE], member[.paramNode]]]
local_variable[type[Expression], initializer]
if[binary_operation[member[.initializer], !=, literal[null]]] begin[{]
call[.recordExpression, parameter[member[.initializer], member[ClassFileSequencerLexicon.INITIALIZER], member[.paramNode]]]
else begin[{]
None
end[}]
local_variable[type[List], modifiers]
call[.recordAnnotations, parameter[member[.modifiers], member[.paramNode]]]
call[.recordSourceReference, parameter[member[.variable], member[.paramNode]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[record] operator[SEP] Keyword[final] identifier[SingleVariableDeclaration] identifier[variable] , Keyword[final] identifier[Node] identifier[parentNode] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[final] identifier[String] identifier[name] operator[=] identifier[variable] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Node] identifier[paramNode] operator[=] identifier[parentNode] operator[SEP] identifier[addNode] operator[SEP] identifier[name] , identifier[ClassFileSequencerLexicon] operator[SEP] identifier[PARAMETER] operator[SEP] operator[SEP] identifier[paramNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[NAME] , identifier[name] operator[SEP] operator[SEP] identifier[paramNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[FINAL] , operator[SEP] identifier[variable] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[&] identifier[Modifier] operator[SEP] identifier[FINAL] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] identifier[paramNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[VARARGS] , identifier[variable] operator[SEP] identifier[isVarargs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[Type] identifier[type] operator[=] identifier[variable] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[typeName] operator[=] identifier[getTypeName] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[paramNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[TYPE_CLASS_NAME] , identifier[typeName] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[type] , identifier[ClassFileSequencerLexicon] operator[SEP] identifier[TYPE] , identifier[paramNode] operator[SEP] operator[SEP]
} {
Keyword[final] identifier[Expression] identifier[initializer] operator[=] identifier[variable] operator[SEP] identifier[getInitializer] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[initializer] operator[!=] Other[null] operator[SEP] {
identifier[recordExpression] operator[SEP] identifier[initializer] , identifier[ClassFileSequencerLexicon] operator[SEP] identifier[INITIALIZER] , identifier[paramNode] operator[SEP] operator[SEP]
}
} {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[IExtendedModifier] operator[>] identifier[modifiers] operator[=] identifier[variable] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] operator[SEP] identifier[recordAnnotations] operator[SEP] identifier[modifiers] , identifier[paramNode] operator[SEP] operator[SEP]
}
identifier[recordSourceReference] operator[SEP] identifier[variable] , identifier[paramNode] operator[SEP] operator[SEP]
}
|
public static List<Object> extract(Iterable<?> collection, Editor<Object> editor, boolean ignoreNull) {
final List<Object> fieldValueList = new ArrayList<>();
Object value;
for (Object bean : collection) {
value = editor.edit(bean);
if (null == value && ignoreNull) {
continue;
}
fieldValueList.add(value);
}
return fieldValueList;
} | class class_name[name] begin[{]
method[extract, return_type[type[List]], modifier[public static], parameter[collection, editor, ignoreNull]] begin[{]
local_variable[type[List], fieldValueList]
local_variable[type[Object], value]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=edit, postfix_operators=[], prefix_operators=[], qualifier=editor, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=MemberReference(member=ignoreNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fieldValueList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=collection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[member[.fieldValueList]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Object] operator[>] identifier[extract] operator[SEP] identifier[Iterable] operator[<] operator[?] operator[>] identifier[collection] , identifier[Editor] operator[<] identifier[Object] operator[>] identifier[editor] , Keyword[boolean] identifier[ignoreNull] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[fieldValueList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[bean] operator[:] identifier[collection] operator[SEP] {
identifier[value] operator[=] identifier[editor] operator[SEP] identifier[edit] operator[SEP] identifier[bean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[value] operator[&&] identifier[ignoreNull] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[fieldValueList] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fieldValueList] operator[SEP]
}
|
public SIMPIterator getLocalSubscriptions() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getLocalSubscriptions");
SIMPIterator iterator = null;
try {
iterator = this.getTopicSpace().getLocalSubscriptionIterator();
} catch (SIMPException e) {
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.runtime.LocalTopicSpaceControl",
"1:409:1.34", this);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] {
"com.ibm.ws.sib.processor.runtime.LocalTopicSpaceControl",
"1:414:1.34", SIMPUtils.getStackTrace(e) });
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getLocalSubscriptions", iterator);
return iterator;
} | class class_name[name] begin[{]
method[getLocalSubscriptions, return_type[type[SIMPIterator]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["getLocalSubscriptions"]]]
else begin[{]
None
end[}]
local_variable[type[SIMPIterator], iterator]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getTopicSpace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getLocalSubscriptionIterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.runtime.LocalTopicSpaceControl"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:409:1.34"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_MESSAGING_ERROR_CWSIP0002"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.runtime.LocalTopicSpaceControl"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:414:1.34"), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=SIMPUtils, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=error, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIMPException']))], finally_block=None, label=None, resources=None)
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["getLocalSubscriptions"], member[.iterator]]]
else begin[{]
None
end[}]
return[member[.iterator]]
end[}]
END[}] | Keyword[public] identifier[SIMPIterator] identifier[getLocalSubscriptions] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[SIMPIterator] identifier[iterator] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[iterator] operator[=] Keyword[this] operator[SEP] identifier[getTopicSpace] operator[SEP] operator[SEP] operator[SEP] identifier[getLocalSubscriptionIterator] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SIMPException] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , literal[String] , identifier[SIMPUtils] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[e] operator[SEP]
} operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[iterator] operator[SEP] operator[SEP] Keyword[return] identifier[iterator] operator[SEP]
}
|
private static void deleteHiddenColumnsInRow(final Row row) {
deleteCellFromRow(row,
TieConstants.HIDDEN_SAVE_OBJECTS_COLUMN);
deleteCellFromRow(row,
TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN);
deleteCellFromRow(row,
TieConstants.HIDDEN_FULL_NAME_COLUMN);
} | class class_name[name] begin[{]
method[deleteHiddenColumnsInRow, return_type[void], modifier[private static], parameter[row]] begin[{]
call[.deleteCellFromRow, parameter[member[.row], member[TieConstants.HIDDEN_SAVE_OBJECTS_COLUMN]]]
call[.deleteCellFromRow, parameter[member[.row], member[TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN]]]
call[.deleteCellFromRow, parameter[member[.row], member[TieConstants.HIDDEN_FULL_NAME_COLUMN]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[deleteHiddenColumnsInRow] operator[SEP] Keyword[final] identifier[Row] identifier[row] operator[SEP] {
identifier[deleteCellFromRow] operator[SEP] identifier[row] , identifier[TieConstants] operator[SEP] identifier[HIDDEN_SAVE_OBJECTS_COLUMN] operator[SEP] operator[SEP] identifier[deleteCellFromRow] operator[SEP] identifier[row] , identifier[TieConstants] operator[SEP] identifier[HIDDEN_ORIGIN_ROW_NUMBER_COLUMN] operator[SEP] operator[SEP] identifier[deleteCellFromRow] operator[SEP] identifier[row] , identifier[TieConstants] operator[SEP] identifier[HIDDEN_FULL_NAME_COLUMN] operator[SEP] operator[SEP]
}
|
public double[] update( double w, double c1, double rand1, double c2, double rand2, double[] globalBest ) {
for( int i = 0; i < locations.length; i++ ) {
particleVelocities[i] = w * particleVelocities[i] + //
c1 * rand1 * (particleLocalBests[i] - locations[i]) + //
c2 * rand2 * (globalBest[i] - locations[i]);
double tmpLocation = locations[i] + particleVelocities[i];
/*
* if the location falls outside the ranges, it should
* not be moved.
*/
tmpLocations[i] = tmpLocation;
}
if (!PSEngine.parametersInRange(tmpLocations, ranges)) {
// System.out.println("PRE-TMPLOCATIONS: " + Arrays.toString(tmpLocations));
// System.out.println("LOCATIONS: " + Arrays.toString(locations));
/*
* mirror the value back
*/
for( int i = 0; i < tmpLocations.length; i++ ) {
double min = ranges[i][0];
double max = ranges[i][1];
if (tmpLocations[i] > max) {
double tmp = max - (tmpLocations[i] - max);
if (tmp < min) {
tmp = max;
}
locations[i] = tmp;
} else if (tmpLocations[i] < min) {
double tmp = min + (min - tmpLocations[i]);
if (tmp > max) {
tmp = min;
}
locations[i] = tmp;
} else {
locations[i] = tmpLocations[i];
}
}
// System.out.println("POST-LOCATIONS: " + Arrays.toString(locations));
// System.out.println("VELOCITIES: " + Arrays.toString(particleVelocities));
return null;
} else {
for( int i = 0; i < locations.length; i++ ) {
locations[i] = tmpLocations[i];
}
return locations;
}
} | class class_name[name] begin[{]
method[update, return_type[type[double]], modifier[public], parameter[w, c1, rand1, c2, rand2, globalBest]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=particleVelocities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=particleVelocities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rand1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=particleLocalBests, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=locations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-), operator=*), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rand2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=globalBest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=locations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-), operator=*), operator=+)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=locations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=particleVelocities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), name=tmpLocation)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmpLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=tmpLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=locations, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[call[PSEngine.parametersInRange, parameter[member[.tmpLocations], member[.ranges]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ranges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), name=min)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ranges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), name=max)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tmpLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tmpLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=locations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=tmpLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tmpLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-), operator=+), name=tmp)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=locations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=tmpLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=-), name=tmp)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=locations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tmpLocations, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[null]]
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=locations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=tmpLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=locations, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.locations]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[update] operator[SEP] Keyword[double] identifier[w] , Keyword[double] identifier[c1] , Keyword[double] identifier[rand1] , Keyword[double] identifier[c2] , Keyword[double] identifier[rand2] , Keyword[double] operator[SEP] operator[SEP] identifier[globalBest] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[locations] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[particleVelocities] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[w] operator[*] identifier[particleVelocities] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[c1] operator[*] identifier[rand1] operator[*] operator[SEP] identifier[particleLocalBests] operator[SEP] identifier[i] operator[SEP] operator[-] identifier[locations] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[+] identifier[c2] operator[*] identifier[rand2] operator[*] operator[SEP] identifier[globalBest] operator[SEP] identifier[i] operator[SEP] operator[-] identifier[locations] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[tmpLocation] operator[=] identifier[locations] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[particleVelocities] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[tmpLocations] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[tmpLocation] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[PSEngine] operator[SEP] identifier[parametersInRange] operator[SEP] identifier[tmpLocations] , identifier[ranges] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tmpLocations] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[double] identifier[min] operator[=] identifier[ranges] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[double] identifier[max] operator[=] identifier[ranges] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmpLocations] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[max] operator[SEP] {
Keyword[double] identifier[tmp] operator[=] identifier[max] operator[-] operator[SEP] identifier[tmpLocations] operator[SEP] identifier[i] operator[SEP] operator[-] identifier[max] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[<] identifier[min] operator[SEP] {
identifier[tmp] operator[=] identifier[max] operator[SEP]
}
identifier[locations] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[tmp] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[tmpLocations] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[min] operator[SEP] {
Keyword[double] identifier[tmp] operator[=] identifier[min] operator[+] operator[SEP] identifier[min] operator[-] identifier[tmpLocations] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[>] identifier[max] operator[SEP] {
identifier[tmp] operator[=] identifier[min] operator[SEP]
}
identifier[locations] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[tmp] operator[SEP]
}
Keyword[else] {
identifier[locations] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[tmpLocations] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[locations] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[locations] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[tmpLocations] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[return] identifier[locations] operator[SEP]
}
}
|
public void registerTaskConfig(String taskName, TedProcessorFactory tedProcessorFactory) {
registerTaskConfig(taskName, tedProcessorFactory, null, null, null);
} | class class_name[name] begin[{]
method[registerTaskConfig, return_type[void], modifier[public], parameter[taskName, tedProcessorFactory]] begin[{]
call[.registerTaskConfig, parameter[member[.taskName], member[.tedProcessorFactory], literal[null], literal[null], literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[registerTaskConfig] operator[SEP] identifier[String] identifier[taskName] , identifier[TedProcessorFactory] identifier[tedProcessorFactory] operator[SEP] {
identifier[registerTaskConfig] operator[SEP] identifier[taskName] , identifier[tedProcessorFactory] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
public void marshall(ImageBuilderStateChangeReason imageBuilderStateChangeReason, ProtocolMarshaller protocolMarshaller) {
if (imageBuilderStateChangeReason == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(imageBuilderStateChangeReason.getCode(), CODE_BINDING);
protocolMarshaller.marshall(imageBuilderStateChangeReason.getMessage(), MESSAGE_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[imageBuilderStateChangeReason, protocolMarshaller]] begin[{]
if[binary_operation[member[.imageBuilderStateChangeReason], ==, 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=getCode, postfix_operators=[], prefix_operators=[], qualifier=imageBuilderStateChangeReason, selectors=[], type_arguments=None), MemberReference(member=CODE_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=getMessage, postfix_operators=[], prefix_operators=[], qualifier=imageBuilderStateChangeReason, selectors=[], type_arguments=None), MemberReference(member=MESSAGE_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[ImageBuilderStateChangeReason] identifier[imageBuilderStateChangeReason] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[imageBuilderStateChangeReason] 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[imageBuilderStateChangeReason] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] , identifier[CODE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[imageBuilderStateChangeReason] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[MESSAGE_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void setAttribute(String name, String value, String facet)
throws JspException
{
if (name != null) {
if (name.equals(TYPE)) {
String s = Bundle.getString("Tags_AttributeMayNotBeSet", new Object[]{name});
registerTagError(s, null);
}
else if (name.equals(READONLY)) {
_state.readonly = Boolean.valueOf(value).booleanValue();
return;
}
}
super.setAttribute(name, value, facet);
} | class class_name[name] begin[{]
method[setAttribute, return_type[void], modifier[public], parameter[name, value, facet]] begin[{]
if[binary_operation[member[.name], !=, literal[null]]] begin[{]
if[call[name.equals, parameter[member[.TYPE]]]] begin[{]
local_variable[type[String], s]
call[.registerTagError, parameter[member[.s], literal[null]]]
else begin[{]
if[call[name.equals, parameter[member[.READONLY]]]] begin[{]
assign[member[_state.readonly], call[Boolean.valueOf, parameter[member[.value]]]]
return[None]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=facet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setAttribute] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] , identifier[String] identifier[facet] operator[SEP] Keyword[throws] identifier[JspException] {
Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] {
identifier[String] identifier[s] operator[=] identifier[Bundle] operator[SEP] identifier[getString] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[name]
} operator[SEP] operator[SEP] identifier[registerTagError] operator[SEP] identifier[s] , Other[null] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[READONLY] operator[SEP] operator[SEP] {
identifier[_state] operator[SEP] identifier[readonly] operator[=] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
Keyword[super] operator[SEP] identifier[setAttribute] operator[SEP] identifier[name] , identifier[value] , identifier[facet] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public static <T extends ExtensionPoint<?>> T getExtensionPoint(Class<T> clazz) {
synchronized (points) {
for (ExtensionPoint<?> ep : points)
if (clazz.isAssignableFrom(ep.getClass()))
return (T)ep;
}
return null;
} | class class_name[name] begin[{]
method[getExtensionPoint, return_type[type[T]], modifier[public static], parameter[clazz]] begin[{]
SYNCHRONIZED[member[.points]] BEGIN[{]
ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=ep, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Cast(expression=MemberReference(member=ep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)), control=EnhancedForControl(iterable=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ep)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ExtensionPoint, sub_type=None))), label=None)
END[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ExtensionPoint] operator[<] operator[?] operator[>] operator[>] identifier[T] identifier[getExtensionPoint] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[points] operator[SEP] {
Keyword[for] operator[SEP] identifier[ExtensionPoint] operator[<] operator[?] operator[>] identifier[ep] operator[:] identifier[points] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[ep] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[ep] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@Override
public boolean contains(ILonePair lonePair) {
for (int i = 0; i < getLonePairCount(); i++) {
if (lonePair == lonePairs[i]) return true;
}
return false;
} | class class_name[name] begin[{]
method[contains, return_type[type[boolean]], modifier[public], parameter[lonePair]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lonePair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lonePairs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), else_statement=None, label=None, then_statement=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=getLonePairCount, postfix_operators=[], prefix_operators=[], qualifier=, 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[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[contains] operator[SEP] identifier[ILonePair] identifier[lonePair] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getLonePairCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[lonePair] operator[==] identifier[lonePairs] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) throws javax.servlet.ServletException, java.io.IOException{
if (req != null) {
doRequest((SipServletRequest) req);
} else {
SipServletResponse response = (SipServletResponse)resp;
if(response.isBranchResponse()) {
doBranchResponse(response);
} else {
doResponse(response);
}
}
} | class class_name[name] begin[{]
method[service, return_type[void], modifier[public], parameter[req, resp]] begin[{]
if[binary_operation[member[.req], !=, literal[null]]] begin[{]
call[.doRequest, parameter[Cast(expression=MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SipServletRequest, sub_type=None))]]
else begin[{]
local_variable[type[SipServletResponse], response]
if[call[response.isBranchResponse, parameter[]]] begin[{]
call[.doBranchResponse, parameter[member[.response]]]
else begin[{]
call[.doResponse, parameter[member[.response]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[service] operator[SEP] identifier[javax] operator[SEP] identifier[servlet] operator[SEP] identifier[ServletRequest] identifier[req] , identifier[javax] operator[SEP] identifier[servlet] operator[SEP] identifier[ServletResponse] identifier[resp] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[servlet] operator[SEP] identifier[ServletException] , identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[IOException] {
Keyword[if] operator[SEP] identifier[req] operator[!=] Other[null] operator[SEP] {
identifier[doRequest] operator[SEP] operator[SEP] identifier[SipServletRequest] operator[SEP] identifier[req] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[SipServletResponse] identifier[response] operator[=] operator[SEP] identifier[SipServletResponse] operator[SEP] identifier[resp] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[isBranchResponse] operator[SEP] operator[SEP] operator[SEP] {
identifier[doBranchResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[doResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP]
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.