code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public OvhOrder cdn_dedicated_serviceName_cacheRule_duration_POST(String serviceName, String duration, OvhOrderCacheRuleEnum cacheRule) throws IOException {
String qPath = "/order/cdn/dedicated/{serviceName}/cacheRule/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "cacheRule", cacheRule);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhOrder.class);
} | class class_name[name] begin[{]
method[cdn_dedicated_serviceName_cacheRule_duration_POST, return_type[type[OvhOrder]], modifier[public], parameter[serviceName, duration, cacheRule]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
local_variable[type[HashMap], o]
call[.addBody, parameter[member[.o], literal["cacheRule"], member[.cacheRule]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOrder, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhOrder] identifier[cdn_dedicated_serviceName_cacheRule_duration_POST] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[duration] , identifier[OvhOrderCacheRuleEnum] identifier[cacheRule] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[duration] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[cacheRule] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhOrder] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public boolean remove() {
try {
if(!isBinary)return getJedisCommands(groupName).del(key) == 1;
if(isCluster(groupName)){
return getBinaryJedisClusterCommands(groupName).del(keyBytes) == 1;
}
return getBinaryJedisCommands(groupName).del(keyBytes) == 1;
} finally {
getJedisProvider(groupName).release();
}
} | class class_name[name] begin[{]
method[remove, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
TryStatement(block=[IfStatement(condition=MemberReference(member=isBinary, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJedisCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=del, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isCluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBinaryJedisClusterCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=keyBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=del, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), label=None)])), ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBinaryJedisCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=keyBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=del, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJedisProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=release, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[remove] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] operator[!] identifier[isBinary] operator[SEP] Keyword[return] identifier[getJedisCommands] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[del] operator[SEP] identifier[key] operator[SEP] operator[==] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[isCluster] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] {
Keyword[return] identifier[getBinaryJedisClusterCommands] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[del] operator[SEP] identifier[keyBytes] operator[SEP] operator[==] Other[1] operator[SEP]
}
Keyword[return] identifier[getBinaryJedisCommands] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[del] operator[SEP] identifier[keyBytes] operator[SEP] operator[==] Other[1] operator[SEP]
}
Keyword[finally] {
identifier[getJedisProvider] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static aaagroup_tmsessionpolicy_binding[] get(nitro_service service, String groupname) throws Exception{
aaagroup_tmsessionpolicy_binding obj = new aaagroup_tmsessionpolicy_binding();
obj.set_groupname(groupname);
aaagroup_tmsessionpolicy_binding response[] = (aaagroup_tmsessionpolicy_binding[]) obj.get_resources(service);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[aaagroup_tmsessionpolicy_binding]], modifier[public static], parameter[service, groupname]] begin[{]
local_variable[type[aaagroup_tmsessionpolicy_binding], obj]
call[obj.set_groupname, parameter[member[.groupname]]]
local_variable[type[aaagroup_tmsessionpolicy_binding], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[aaagroup_tmsessionpolicy_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[groupname] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[aaagroup_tmsessionpolicy_binding] identifier[obj] operator[=] Keyword[new] identifier[aaagroup_tmsessionpolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_groupname] operator[SEP] identifier[groupname] operator[SEP] operator[SEP] identifier[aaagroup_tmsessionpolicy_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[aaagroup_tmsessionpolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
public void addDirectedRoute(final LocalTrustGraphNode from, final LocalTrustGraphNode to) {
from.getRoutingTable().addNeighbor(to.getId());
} | class class_name[name] begin[{]
method[addDirectedRoute, return_type[void], modifier[public], parameter[from, to]] begin[{]
call[from.getRoutingTable, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addDirectedRoute] operator[SEP] Keyword[final] identifier[LocalTrustGraphNode] identifier[from] , Keyword[final] identifier[LocalTrustGraphNode] identifier[to] operator[SEP] {
identifier[from] operator[SEP] identifier[getRoutingTable] operator[SEP] operator[SEP] operator[SEP] identifier[addNeighbor] operator[SEP] identifier[to] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected Set<String> getCellularLocations(Match m, String memLabel, String comLabel)
{
PhysicalEntityChain chain = getChain(m, memLabel, comLabel);
return chain.getCellularLocations();
} | class class_name[name] begin[{]
method[getCellularLocations, return_type[type[Set]], modifier[protected], parameter[m, memLabel, comLabel]] begin[{]
local_variable[type[PhysicalEntityChain], chain]
return[call[chain.getCellularLocations, parameter[]]]
end[}]
END[}] | Keyword[protected] identifier[Set] operator[<] identifier[String] operator[>] identifier[getCellularLocations] operator[SEP] identifier[Match] identifier[m] , identifier[String] identifier[memLabel] , identifier[String] identifier[comLabel] operator[SEP] {
identifier[PhysicalEntityChain] identifier[chain] operator[=] identifier[getChain] operator[SEP] identifier[m] , identifier[memLabel] , identifier[comLabel] operator[SEP] operator[SEP] Keyword[return] identifier[chain] operator[SEP] identifier[getCellularLocations] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setConfigItem(final String name, final String type, final String value) {
this.configEntry.add(new ConfigItem(name, type, value));
} | class class_name[name] begin[{]
method[setConfigItem, return_type[void], modifier[public], parameter[name, type, value]] begin[{]
THIS[member[None.configEntry]call[None.add, parameter[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigItem, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setConfigItem] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[type] , Keyword[final] identifier[String] identifier[value] operator[SEP] {
Keyword[this] operator[SEP] identifier[configEntry] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ConfigItem] operator[SEP] identifier[name] , identifier[type] , identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setElementId(int v) {
if (DocumentElement_Type.featOkTst && ((DocumentElement_Type)jcasType).casFeat_ElementId == null)
jcasType.jcas.throwFeatMissing("ElementId", "ch.epfl.bbp.uima.types.DocumentElement");
jcasType.ll_cas.ll_setIntValue(addr, ((DocumentElement_Type)jcasType).casFeatCode_ElementId, v);} | class class_name[name] begin[{]
method[setElementId, return_type[void], modifier[public], parameter[v]] begin[{]
if[binary_operation[member[DocumentElement_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DocumentElement_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["ElementId"], literal["ch.epfl.bbp.uima.types.DocumentElement"]]]
else begin[{]
None
end[}]
call[jcasType.ll_cas.ll_setIntValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DocumentElement_Type, sub_type=None)), member[.v]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setElementId] operator[SEP] Keyword[int] identifier[v] operator[SEP] {
Keyword[if] operator[SEP] identifier[DocumentElement_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[DocumentElement_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_ElementId] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setIntValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[DocumentElement_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_ElementId] , identifier[v] operator[SEP] operator[SEP]
}
|
public static String getMimeType(byte[] barr, String defaultValue) {
PrintStream out = System.out;
try {
Tika tika = new Tika();
return tika.detect(barr);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
return defaultValue;
}
} | class class_name[name] begin[{]
method[getMimeType, return_type[type[String]], modifier[public static], parameter[barr, defaultValue]] begin[{]
local_variable[type[PrintStream], out]
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=Tika, sub_type=None)), name=tika)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Tika, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=barr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=detect, postfix_operators=[], prefix_operators=[], qualifier=tika, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rethrowIfNecessary, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtil, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getMimeType] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[barr] , identifier[String] identifier[defaultValue] operator[SEP] {
identifier[PrintStream] identifier[out] operator[=] identifier[System] operator[SEP] identifier[out] operator[SEP] Keyword[try] {
identifier[Tika] identifier[tika] operator[=] Keyword[new] identifier[Tika] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[tika] operator[SEP] identifier[detect] operator[SEP] identifier[barr] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[ExceptionUtil] operator[SEP] identifier[rethrowIfNecessary] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[return] identifier[defaultValue] operator[SEP]
}
}
|
static void mkdirp(ZooKeeper zookeeper, String znode) throws KeeperException, InterruptedException {
boolean createPath = false;
for (String path : pathParts(znode)) {
if (!createPath) {
Stat stat = zookeeper.exists(path, false);
if (stat == null) {
createPath = true;
}
}
if (createPath) {
create(zookeeper, path);
}
}
} | class class_name[name] begin[{]
method[mkdirp, return_type[void], modifier[static], parameter[zookeeper, znode]] begin[{]
local_variable[type[boolean], createPath]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=createPath, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=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=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=exists, postfix_operators=[], prefix_operators=[], qualifier=zookeeper, selectors=[], type_arguments=None), name=stat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Stat, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=stat, 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=createPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))])), IfStatement(condition=MemberReference(member=createPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zookeeper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=znode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pathParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), 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)
end[}]
END[}] | Keyword[static] Keyword[void] identifier[mkdirp] operator[SEP] identifier[ZooKeeper] identifier[zookeeper] , identifier[String] identifier[znode] operator[SEP] Keyword[throws] identifier[KeeperException] , identifier[InterruptedException] {
Keyword[boolean] identifier[createPath] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[pathParts] operator[SEP] identifier[znode] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[createPath] operator[SEP] {
identifier[Stat] identifier[stat] operator[=] identifier[zookeeper] operator[SEP] identifier[exists] operator[SEP] identifier[path] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stat] operator[==] Other[null] operator[SEP] {
identifier[createPath] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[createPath] operator[SEP] {
identifier[create] operator[SEP] identifier[zookeeper] , identifier[path] operator[SEP] operator[SEP]
}
}
}
|
public void setSearchResultsCount(Long searchResultsCount){
if (searchResultsCount != null && getSearchQuery() == null){
throw new IllegalStateException("SearchQuery must be set before SearchResultsCount can be set.");
}
setParameter(SEARCH_RESULTS_COUNT, searchResultsCount);
} | class class_name[name] begin[{]
method[setSearchResultsCount, return_type[void], modifier[public], parameter[searchResultsCount]] begin[{]
if[binary_operation[binary_operation[member[.searchResultsCount], !=, literal[null]], &&, binary_operation[call[.getSearchQuery, parameter[]], ==, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SearchQuery must be set before SearchResultsCount can be set.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.setParameter, parameter[member[.SEARCH_RESULTS_COUNT], member[.searchResultsCount]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSearchResultsCount] operator[SEP] identifier[Long] identifier[searchResultsCount] operator[SEP] {
Keyword[if] operator[SEP] identifier[searchResultsCount] operator[!=] Other[null] operator[&&] identifier[getSearchQuery] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[setParameter] operator[SEP] identifier[SEARCH_RESULTS_COUNT] , identifier[searchResultsCount] operator[SEP] operator[SEP]
}
|
public ServiceFuture<StorageAccountInformationInner> getAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback<StorageAccountInformationInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName), serviceCallback);
} | class class_name[name] begin[{]
method[getAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, accountName, storageAccountName, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.storageAccountName]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[StorageAccountInformationInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[storageAccountName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[StorageAccountInformationInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[storageAccountName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public final double getConf05(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic conf05 = new Percentile(5.0);
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return conf05.evaluate(doubleColl.toArray(), 0, doubleColl.toArray().length);
} | class class_name[name] begin[{]
method[getConf05, return_type[type[double]], modifier[final public], parameter[meter]] begin[{]
call[.checkIfMeterExists, parameter[member[.meter]]]
local_variable[type[AbstractUnivariateStatistic], conf05]
local_variable[type[CollectionDoubleCollection], doubleColl]
return[call[conf05.evaluate, parameter[call[doubleColl.toArray, parameter[]], literal[0], call[doubleColl.toArray, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[double] identifier[getConf05] operator[SEP] Keyword[final] identifier[AbstractMeter] identifier[meter] operator[SEP] {
identifier[checkIfMeterExists] operator[SEP] identifier[meter] operator[SEP] operator[SEP] Keyword[final] identifier[AbstractUnivariateStatistic] identifier[conf05] operator[=] Keyword[new] identifier[Percentile] operator[SEP] literal[Float] operator[SEP] operator[SEP] Keyword[final] identifier[CollectionDoubleCollection] identifier[doubleColl] operator[=] Keyword[new] identifier[CollectionDoubleCollection] operator[SEP] Keyword[this] operator[SEP] identifier[meterResults] operator[SEP] identifier[get] operator[SEP] identifier[meter] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[conf05] operator[SEP] identifier[evaluate] operator[SEP] identifier[doubleColl] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] , Other[0] , identifier[doubleColl] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
|
public static Object convertArray(Connection conn, Object[] array) throws SQLException {
Object result = null;
result = createArrayOf(conn, convertJavaClassToSqlType(array.getClass().getComponentType().getSimpleName()), array);
return result;
} | class class_name[name] begin[{]
method[convertArray, return_type[type[Object]], modifier[public static], parameter[conn, array]] begin[{]
local_variable[type[Object], result]
assign[member[.result], call[.createArrayOf, parameter[member[.conn], call[.convertJavaClassToSqlType, parameter[call[array.getClass, parameter[]]]], member[.array]]]]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[convertArray] operator[SEP] identifier[Connection] identifier[conn] , identifier[Object] operator[SEP] operator[SEP] identifier[array] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] identifier[result] operator[=] identifier[createArrayOf] operator[SEP] identifier[conn] , identifier[convertJavaClassToSqlType] operator[SEP] identifier[array] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] , identifier[array] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public final ExampleData getSelectedExampleData() {
Set<String> allSelectedItems = getSelectedRows();
if (allSelectedItems == null || allSelectedItems.isEmpty()) {
return null;
}
for (String selectedItem : allSelectedItems) {
// Only interested in the first selected item as it is a single select list.
List<Integer> rowIndex = TreeItemUtil.rowIndexStringToList(selectedItem);
return getTreeModel().getExampleData(rowIndex);
}
return null;
} | class class_name[name] begin[{]
method[getSelectedExampleData, return_type[type[ExampleData]], modifier[final public], parameter[]] begin[{]
local_variable[type[Set], allSelectedItems]
if[binary_operation[binary_operation[member[.allSelectedItems], ==, literal[null]], ||, call[allSelectedItems.isEmpty, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=selectedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rowIndexStringToList, postfix_operators=[], prefix_operators=[], qualifier=TreeItemUtil, selectors=[], type_arguments=None), name=rowIndex)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=getTreeModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getExampleData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=allSelectedItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=selectedItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[ExampleData] identifier[getSelectedExampleData] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[allSelectedItems] operator[=] identifier[getSelectedRows] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[allSelectedItems] operator[==] Other[null] operator[||] identifier[allSelectedItems] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[selectedItem] operator[:] identifier[allSelectedItems] operator[SEP] {
identifier[List] operator[<] identifier[Integer] operator[>] identifier[rowIndex] operator[=] identifier[TreeItemUtil] operator[SEP] identifier[rowIndexStringToList] operator[SEP] identifier[selectedItem] operator[SEP] operator[SEP] Keyword[return] identifier[getTreeModel] operator[SEP] operator[SEP] operator[SEP] identifier[getExampleData] operator[SEP] identifier[rowIndex] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public boolean shouldEncodeWith(Encoder encoderToApply, CharSequence string) {
if(isNoneEncoder(encoderToApply)) return false;
EncodingState encodingState = getEncodingStateFor(string);
return shouldEncodeWith(encoderToApply, encodingState);
} | class class_name[name] begin[{]
method[shouldEncodeWith, return_type[type[boolean]], modifier[public], parameter[encoderToApply, string]] begin[{]
if[call[.isNoneEncoder, parameter[member[.encoderToApply]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[EncodingState], encodingState]
return[call[.shouldEncodeWith, parameter[member[.encoderToApply], member[.encodingState]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[shouldEncodeWith] operator[SEP] identifier[Encoder] identifier[encoderToApply] , identifier[CharSequence] identifier[string] operator[SEP] {
Keyword[if] operator[SEP] identifier[isNoneEncoder] operator[SEP] identifier[encoderToApply] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[EncodingState] identifier[encodingState] operator[=] identifier[getEncodingStateFor] operator[SEP] identifier[string] operator[SEP] operator[SEP] Keyword[return] identifier[shouldEncodeWith] operator[SEP] identifier[encoderToApply] , identifier[encodingState] operator[SEP] operator[SEP]
}
|
@Override
public void setSubscriptionDurability(final String subscriptionDurability) {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
SibTr.debug(this, TRACE, "setSubscriptionDurability",
subscriptionDurability);
}
_subscriptionDurability = subscriptionDurability;
} | class class_name[name] begin[{]
method[setSubscriptionDurability, return_type[void], modifier[public], parameter[subscriptionDurability]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[THIS[], member[.TRACE], literal["setSubscriptionDurability"], member[.subscriptionDurability]]]
else begin[{]
None
end[}]
assign[member[._subscriptionDurability], member[.subscriptionDurability]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setSubscriptionDurability] operator[SEP] Keyword[final] identifier[String] identifier[subscriptionDurability] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[TRACE] , literal[String] , identifier[subscriptionDurability] operator[SEP] operator[SEP]
}
identifier[_subscriptionDurability] operator[=] identifier[subscriptionDurability] operator[SEP]
}
|
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleResourceInner>>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<SharedAccessAuthorizationRuleResourceInner>>, Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleResourceInner>>>>() {
@Override
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleResourceInner>>> call(ServiceResponse<Page<SharedAccessAuthorizationRuleResourceInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink));
}
});
} | class class_name[name] begin[{]
method[listAuthorizationRulesNextWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{]
return[call[.listAuthorizationRulesNextSinglePageAsync, parameter[member[.nextPageLink]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SharedAccessAuthorizationRuleResourceInner] operator[>] operator[>] operator[>] identifier[listAuthorizationRulesNextWithServiceResponseAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] {
Keyword[return] identifier[listAuthorizationRulesNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[concatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SharedAccessAuthorizationRuleResourceInner] operator[>] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SharedAccessAuthorizationRuleResourceInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SharedAccessAuthorizationRuleResourceInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SharedAccessAuthorizationRuleResourceInner] operator[>] operator[>] identifier[page] operator[SEP] {
identifier[String] identifier[nextPageLink] operator[=] identifier[page] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextPageLink] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[concatWith] operator[SEP] identifier[listAuthorizationRulesNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
private PersistableDownload captureDownloadState(
final GetObjectRequest getObjectRequest, final File file) {
if (getObjectRequest.getSSECustomerKey() == null) {
return new PersistableDownload(
getObjectRequest.getBucketName(), getObjectRequest.getKey(),
getObjectRequest.getVersionId(), getObjectRequest.getRange(),
getObjectRequest.getResponseHeaders(), getObjectRequest.isRequesterPays(),
file.getAbsolutePath(), getLastFullyDownloadedPartNumber(),
getObjectMetadata().getLastModified().getTime(),
getLastFullyDownloadedFilePosition());
}
return null;
} | class class_name[name] begin[{]
method[captureDownloadState, return_type[type[PersistableDownload]], modifier[private], parameter[getObjectRequest, file]] begin[{]
if[binary_operation[call[getObjectRequest.getSSECustomerKey, parameter[]], ==, literal[null]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBucketName, postfix_operators=[], prefix_operators=[], qualifier=getObjectRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=getObjectRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getVersionId, postfix_operators=[], prefix_operators=[], qualifier=getObjectRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getRange, postfix_operators=[], prefix_operators=[], qualifier=getObjectRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getResponseHeaders, postfix_operators=[], prefix_operators=[], qualifier=getObjectRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isRequesterPays, postfix_operators=[], prefix_operators=[], qualifier=getObjectRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLastFullyDownloadedPartNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getObjectMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getLastModified, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getLastFullyDownloadedFilePosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PersistableDownload, sub_type=None))]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[PersistableDownload] identifier[captureDownloadState] operator[SEP] Keyword[final] identifier[GetObjectRequest] identifier[getObjectRequest] , Keyword[final] identifier[File] identifier[file] operator[SEP] {
Keyword[if] operator[SEP] identifier[getObjectRequest] operator[SEP] identifier[getSSECustomerKey] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[PersistableDownload] operator[SEP] identifier[getObjectRequest] operator[SEP] identifier[getBucketName] operator[SEP] operator[SEP] , identifier[getObjectRequest] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[getObjectRequest] operator[SEP] identifier[getVersionId] operator[SEP] operator[SEP] , identifier[getObjectRequest] operator[SEP] identifier[getRange] operator[SEP] operator[SEP] , identifier[getObjectRequest] operator[SEP] identifier[getResponseHeaders] operator[SEP] operator[SEP] , identifier[getObjectRequest] operator[SEP] identifier[isRequesterPays] operator[SEP] operator[SEP] , identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[getLastFullyDownloadedPartNumber] operator[SEP] operator[SEP] , identifier[getObjectMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getLastModified] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] , identifier[getLastFullyDownloadedFilePosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@SuppressWarnings( "unchecked" )
private void registerRepositoryInfoType( NodeTypeManager typeManager ) throws RepositoryException {
// create node type template
NodeTypeTemplate type = typeManager.createNodeTypeTemplate();
// convert CMIS type's attributes to node type template we have just created
type.setName("cmis:repository");
type.setAbstract(false);
type.setMixin(false);
type.setOrderableChildNodes(true);
type.setQueryable(true);
type.setDeclaredSuperTypeNames(new String[] {JcrConstants.NT_FOLDER});
PropertyDefinitionTemplate vendorName = typeManager.createPropertyDefinitionTemplate();
vendorName.setAutoCreated(false);
vendorName.setName("cmis:vendorName");
vendorName.setMandatory(false);
type.getPropertyDefinitionTemplates().add(vendorName);
PropertyDefinitionTemplate productName = typeManager.createPropertyDefinitionTemplate();
productName.setAutoCreated(false);
productName.setName("cmis:productName");
productName.setMandatory(false);
type.getPropertyDefinitionTemplates().add(productName);
PropertyDefinitionTemplate productVersion = typeManager.createPropertyDefinitionTemplate();
productVersion.setAutoCreated(false);
productVersion.setName("cmis:productVersion");
productVersion.setMandatory(false);
type.getPropertyDefinitionTemplates().add(productVersion);
// register type
NodeTypeDefinition[] nodeDefs = new NodeTypeDefinition[] {type};
typeManager.registerNodeTypes(nodeDefs, true);
} | class class_name[name] begin[{]
method[registerRepositoryInfoType, return_type[void], modifier[private], parameter[typeManager]] begin[{]
local_variable[type[NodeTypeTemplate], type]
call[type.setName, parameter[literal["cmis:repository"]]]
call[type.setAbstract, parameter[literal[false]]]
call[type.setMixin, parameter[literal[false]]]
call[type.setOrderableChildNodes, parameter[literal[true]]]
call[type.setQueryable, parameter[literal[true]]]
call[type.setDeclaredSuperTypeNames, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=NT_FOLDER, postfix_operators=[], prefix_operators=[], qualifier=JcrConstants, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
local_variable[type[PropertyDefinitionTemplate], vendorName]
call[vendorName.setAutoCreated, parameter[literal[false]]]
call[vendorName.setName, parameter[literal["cmis:vendorName"]]]
call[vendorName.setMandatory, parameter[literal[false]]]
call[type.getPropertyDefinitionTemplates, parameter[]]
local_variable[type[PropertyDefinitionTemplate], productName]
call[productName.setAutoCreated, parameter[literal[false]]]
call[productName.setName, parameter[literal["cmis:productName"]]]
call[productName.setMandatory, parameter[literal[false]]]
call[type.getPropertyDefinitionTemplates, parameter[]]
local_variable[type[PropertyDefinitionTemplate], productVersion]
call[productVersion.setAutoCreated, parameter[literal[false]]]
call[productVersion.setName, parameter[literal["cmis:productVersion"]]]
call[productVersion.setMandatory, parameter[literal[false]]]
call[type.getPropertyDefinitionTemplates, parameter[]]
local_variable[type[NodeTypeDefinition], nodeDefs]
call[typeManager.registerNodeTypes, parameter[member[.nodeDefs], literal[true]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[registerRepositoryInfoType] operator[SEP] identifier[NodeTypeManager] identifier[typeManager] operator[SEP] Keyword[throws] identifier[RepositoryException] {
identifier[NodeTypeTemplate] identifier[type] operator[=] identifier[typeManager] operator[SEP] identifier[createNodeTypeTemplate] operator[SEP] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[setAbstract] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[setMixin] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[setOrderableChildNodes] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[setQueryable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[setDeclaredSuperTypeNames] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[JcrConstants] operator[SEP] identifier[NT_FOLDER]
} operator[SEP] operator[SEP] identifier[PropertyDefinitionTemplate] identifier[vendorName] operator[=] identifier[typeManager] operator[SEP] identifier[createPropertyDefinitionTemplate] operator[SEP] operator[SEP] operator[SEP] identifier[vendorName] operator[SEP] identifier[setAutoCreated] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[vendorName] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[vendorName] operator[SEP] identifier[setMandatory] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[getPropertyDefinitionTemplates] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[vendorName] operator[SEP] operator[SEP] identifier[PropertyDefinitionTemplate] identifier[productName] operator[=] identifier[typeManager] operator[SEP] identifier[createPropertyDefinitionTemplate] operator[SEP] operator[SEP] operator[SEP] identifier[productName] operator[SEP] identifier[setAutoCreated] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[productName] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[productName] operator[SEP] identifier[setMandatory] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[getPropertyDefinitionTemplates] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[productName] operator[SEP] operator[SEP] identifier[PropertyDefinitionTemplate] identifier[productVersion] operator[=] identifier[typeManager] operator[SEP] identifier[createPropertyDefinitionTemplate] operator[SEP] operator[SEP] operator[SEP] identifier[productVersion] operator[SEP] identifier[setAutoCreated] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[productVersion] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[productVersion] operator[SEP] identifier[setMandatory] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[getPropertyDefinitionTemplates] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[productVersion] operator[SEP] operator[SEP] identifier[NodeTypeDefinition] operator[SEP] operator[SEP] identifier[nodeDefs] operator[=] Keyword[new] identifier[NodeTypeDefinition] operator[SEP] operator[SEP] {
identifier[type]
} operator[SEP] identifier[typeManager] operator[SEP] identifier[registerNodeTypes] operator[SEP] identifier[nodeDefs] , literal[boolean] operator[SEP] operator[SEP]
}
|
private Message messageFromBuffer(ByteBuffer request) throws InternalException {
if (request != null) {
Message m;
try {
m = parser.createMessage(request);
return m;
}
catch (AvpDataException e) {
throw new InternalException("Failed to decode message.", e);
}
}
return null;
} | class class_name[name] begin[{]
method[messageFromBuffer, return_type[type[Message]], modifier[private], parameter[request]] begin[{]
if[binary_operation[member[.request], !=, literal[null]]] begin[{]
local_variable[type[Message], m]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createMessage, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to decode message."), 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=InternalException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AvpDataException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[Message] identifier[messageFromBuffer] operator[SEP] identifier[ByteBuffer] identifier[request] operator[SEP] Keyword[throws] identifier[InternalException] {
Keyword[if] operator[SEP] identifier[request] operator[!=] Other[null] operator[SEP] {
identifier[Message] identifier[m] operator[SEP] Keyword[try] {
identifier[m] operator[=] identifier[parser] operator[SEP] identifier[createMessage] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[m] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[AvpDataException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InternalException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
@Override
public CommerceAddressRestriction findByC_C_First(long classNameId,
long classPK,
OrderByComparator<CommerceAddressRestriction> orderByComparator)
throws NoSuchAddressRestrictionException {
CommerceAddressRestriction commerceAddressRestriction = fetchByC_C_First(classNameId,
classPK, orderByComparator);
if (commerceAddressRestriction != null) {
return commerceAddressRestriction;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("classNameId=");
msg.append(classNameId);
msg.append(", classPK=");
msg.append(classPK);
msg.append("}");
throw new NoSuchAddressRestrictionException(msg.toString());
} | class class_name[name] begin[{]
method[findByC_C_First, return_type[type[CommerceAddressRestriction]], modifier[public], parameter[classNameId, classPK, orderByComparator]] begin[{]
local_variable[type[CommerceAddressRestriction], commerceAddressRestriction]
if[binary_operation[member[.commerceAddressRestriction], !=, literal[null]]] begin[{]
return[member[.commerceAddressRestriction]]
else begin[{]
None
end[}]
local_variable[type[StringBundler], msg]
call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]]
call[msg.append, parameter[literal["classNameId="]]]
call[msg.append, parameter[member[.classNameId]]]
call[msg.append, parameter[literal[", classPK="]]]
call[msg.append, parameter[member[.classPK]]]
call[msg.append, parameter[literal["}"]]]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchAddressRestrictionException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CommerceAddressRestriction] identifier[findByC_C_First] operator[SEP] Keyword[long] identifier[classNameId] , Keyword[long] identifier[classPK] , identifier[OrderByComparator] operator[<] identifier[CommerceAddressRestriction] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchAddressRestrictionException] {
identifier[CommerceAddressRestriction] identifier[commerceAddressRestriction] operator[=] identifier[fetchByC_C_First] operator[SEP] identifier[classNameId] , identifier[classPK] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceAddressRestriction] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[commerceAddressRestriction] operator[SEP]
}
identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[6] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[classNameId] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[classPK] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchAddressRestrictionException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public final hqlParser.optionalFromTokenFromClause2_return optionalFromTokenFromClause2() throws RecognitionException {
hqlParser.optionalFromTokenFromClause2_return retval = new hqlParser.optionalFromTokenFromClause2_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token FROM26=null;
CommonTree FROM26_tree=null;
try {
// hql.g:205:2: ( ( FROM )? )
// hql.g:205:4: ( FROM )?
{
root_0 = (CommonTree)adaptor.nil();
// hql.g:205:4: ( FROM )?
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==FROM) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// hql.g:205:4: FROM
{
FROM26=(Token)match(input,FROM,FOLLOW_FROM_in_optionalFromTokenFromClause2788);
FROM26_tree = (CommonTree)adaptor.create(FROM26);
adaptor.addChild(root_0, FROM26_tree);
}
break;
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
} | class class_name[name] begin[{]
method[optionalFromTokenFromClause2, return_type[type[hqlParser]], modifier[final public], parameter[]] begin[{]
local_variable[type[hqlParser], retval]
assign[member[retval.start], call[input.LT, parameter[literal[1]]]]
local_variable[type[CommonTree], root_0]
local_variable[type[Token], FROM26]
local_variable[type[CommonTree], FROM26_tree]
TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt7)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA7_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA7_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FROM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt7, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=FROM26, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FROM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_FROM_in_optionalFromTokenFromClause2788, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=FROM26_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=FROM26, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FROM26_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt7, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rulePostProcessing, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[])], member=setTokenBoundaries, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorNode, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.retval]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[hqlParser] operator[SEP] identifier[optionalFromTokenFromClause2_return] identifier[optionalFromTokenFromClause2] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[hqlParser] operator[SEP] identifier[optionalFromTokenFromClause2_return] identifier[retval] operator[=] Keyword[new] identifier[hqlParser] operator[SEP] identifier[optionalFromTokenFromClause2_return] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[start] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[CommonTree] identifier[root_0] operator[=] Other[null] operator[SEP] identifier[Token] identifier[FROM26] operator[=] Other[null] operator[SEP] identifier[CommonTree] identifier[FROM26_tree] operator[=] Other[null] operator[SEP] Keyword[try] {
{
identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[alt7] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA7_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA7_0] operator[==] identifier[FROM] operator[SEP] operator[SEP] {
identifier[alt7] operator[=] Other[1] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt7] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[FROM26] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[FROM] , identifier[FOLLOW_FROM_in_optionalFromTokenFromClause2788] operator[SEP] operator[SEP] identifier[FROM26_tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[FROM26] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[FROM26_tree] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
}
identifier[retval] operator[SEP] identifier[stop] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[rulePostProcessing] operator[SEP] identifier[root_0] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[setTokenBoundaries] operator[SEP] identifier[retval] operator[SEP] identifier[tree] , identifier[retval] operator[SEP] identifier[start] , identifier[retval] operator[SEP] identifier[stop] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[errorNode] operator[SEP] identifier[input] , identifier[retval] operator[SEP] identifier[start] , identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[re] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[retval] operator[SEP]
}
|
public boolean shouldScanPackage(String pkg)
{
// assume an empty string if it wasn't specified
if (pkg == null)
{
pkg = "";
}
WindupJavaConfigurationModel configuration = getJavaConfigurationModel(getGraphContext());
for (PackageModel pkgModel : configuration.getExcludeJavaPackages())
{
String excludePkg = pkgModel.getPackageName();
if (pkg.startsWith(excludePkg))
{
return false;
}
}
// if the list is empty, assume it is intended to just accept all packages
if (!configuration.getScanJavaPackages().iterator().hasNext())
{
return true;
}
for (PackageModel pkgModel : configuration.getScanJavaPackages())
{
String includePkg = pkgModel.getPackageName();
if (pkg.startsWith(includePkg))
{
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[shouldScanPackage, return_type[type[boolean]], modifier[public], parameter[pkg]] begin[{]
if[binary_operation[member[.pkg], ==, literal[null]]] begin[{]
assign[member[.pkg], literal[""]]
else begin[{]
None
end[}]
local_variable[type[WindupJavaConfigurationModel], configuration]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=pkgModel, selectors=[], type_arguments=None), name=excludePkg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=excludePkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=pkg, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getExcludeJavaPackages, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pkgModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PackageModel, sub_type=None))), label=None)
if[call[configuration.getScanJavaPackages, parameter[]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=pkgModel, selectors=[], type_arguments=None), name=includePkg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=includePkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=pkg, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getScanJavaPackages, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pkgModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PackageModel, sub_type=None))), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[shouldScanPackage] operator[SEP] identifier[String] identifier[pkg] operator[SEP] {
Keyword[if] operator[SEP] identifier[pkg] operator[==] Other[null] operator[SEP] {
identifier[pkg] operator[=] literal[String] operator[SEP]
}
identifier[WindupJavaConfigurationModel] identifier[configuration] operator[=] identifier[getJavaConfigurationModel] operator[SEP] identifier[getGraphContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PackageModel] identifier[pkgModel] operator[:] identifier[configuration] operator[SEP] identifier[getExcludeJavaPackages] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[excludePkg] operator[=] identifier[pkgModel] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pkg] operator[SEP] identifier[startsWith] operator[SEP] identifier[excludePkg] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[configuration] operator[SEP] identifier[getScanJavaPackages] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[for] operator[SEP] identifier[PackageModel] identifier[pkgModel] operator[:] identifier[configuration] operator[SEP] identifier[getScanJavaPackages] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[includePkg] operator[=] identifier[pkgModel] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pkg] operator[SEP] identifier[startsWith] operator[SEP] identifier[includePkg] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Nonnull
public byte [] getEncodedForPageContentStream (@Nonnull final String sText) throws IOException
{
// Minimum is 1*string length
// Maximum is 4*string length
try (final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream (sText.length () * 2))
{
int nCPOfs = 0;
while (nCPOfs < sText.length ())
{
final int nCP = sText.codePointAt (nCPOfs);
nCPOfs += Character.charCount (nCP);
final EncodedCodePoint aECP = _getEncodedCodePoint (nCP);
if (m_bFontWillBeSubset)
m_aFont.addToSubset (aECP.getCodePoint ());
aECP.writeEncodedBytes (aBAOS);
}
return aBAOS.toByteArray ();
}
} | class class_name[name] begin[{]
method[getEncodedForPageContentStream, return_type[type[byte]], modifier[public], parameter[sText]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=nCPOfs)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nCPOfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=codePointAt, postfix_operators=[], prefix_operators=[], qualifier=sText, selectors=[], type_arguments=None), name=nCP)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nCPOfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=nCP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charCount, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nCP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=_getEncodedCodePoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=aECP)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=EncodedCodePoint, sub_type=None)), IfStatement(condition=MemberReference(member=m_bFontWillBeSubset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCodePoint, postfix_operators=[], prefix_operators=[], qualifier=aECP, selectors=[], type_arguments=None)], member=addToSubset, postfix_operators=[], prefix_operators=[], qualifier=m_aFont, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aBAOS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeEncodedBytes, postfix_operators=[], prefix_operators=[], qualifier=aECP, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=nCPOfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sText, selectors=[], type_arguments=None), operator=<), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=aBAOS, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=aBAOS, type=ReferenceType(arguments=None, dimensions=[], name=NonBlockingByteArrayOutputStream, sub_type=None), value=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sText, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonBlockingByteArrayOutputStream, sub_type=None)))])
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getEncodedForPageContentStream] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[String] identifier[sText] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[try] operator[SEP] Keyword[final] identifier[NonBlockingByteArrayOutputStream] identifier[aBAOS] operator[=] Keyword[new] identifier[NonBlockingByteArrayOutputStream] operator[SEP] identifier[sText] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] {
Keyword[int] identifier[nCPOfs] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[nCPOfs] operator[<] identifier[sText] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[nCP] operator[=] identifier[sText] operator[SEP] identifier[codePointAt] operator[SEP] identifier[nCPOfs] operator[SEP] operator[SEP] identifier[nCPOfs] operator[+=] identifier[Character] operator[SEP] identifier[charCount] operator[SEP] identifier[nCP] operator[SEP] operator[SEP] Keyword[final] identifier[EncodedCodePoint] identifier[aECP] operator[=] identifier[_getEncodedCodePoint] operator[SEP] identifier[nCP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_bFontWillBeSubset] operator[SEP] identifier[m_aFont] operator[SEP] identifier[addToSubset] operator[SEP] identifier[aECP] operator[SEP] identifier[getCodePoint] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[aECP] operator[SEP] identifier[writeEncodedBytes] operator[SEP] identifier[aBAOS] operator[SEP] operator[SEP]
}
Keyword[return] identifier[aBAOS] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public int setState(boolean bState, boolean bDisplayOption, int iMoveMode)
{
if (m_strTargetValue != null)
{
String fieldString = this.getString();
if (m_boolMaskValue.booleanValue())
{
int index = fieldString.indexOf(m_strTargetValue);
if (bState == m_bTrueIfMatch)
{ // Add target string to field!
if (index == -1) // Is the target value in the field string?
{ // No, Add it!
fieldString = m_strTargetValue + fieldString; // Add the field to the string
}
}
else
{ // Take target field out of field
if (index != -1) // Is the target value in the field string
{ // Yes, Take it out!
fieldString = fieldString.substring(0, index) + fieldString.substring(index+1); // Strip the field to the string
}
}
}
else
fieldString = m_strTargetValue; // Set to the value
return this.setString(fieldString, bDisplayOption, iMoveMode);
}
else if (m_fldTargetValue != null)
{
if (bState == m_bTrueIfMatch)
return ((BaseField)this.getField()).moveFieldToThis(m_fldTargetValue, bDisplayOption, iMoveMode);
else
return ((BaseField)this.getField()).setString(null); // Unchecked = clear it.
}
else // Target = null
{
if (bState == m_bTrueIfMatch)
return ((BaseField)this.getField()).setString(null);
else
return DBConstants.NORMAL_RETURN; //?
}
} | class class_name[name] begin[{]
method[setState, return_type[type[int]], modifier[public], parameter[bState, bDisplayOption, iMoveMode]] begin[{]
if[binary_operation[member[.m_strTargetValue], !=, literal[null]]] begin[{]
local_variable[type[String], fieldString]
if[call[m_boolMaskValue.booleanValue, parameter[]]] begin[{]
local_variable[type[int], index]
if[binary_operation[member[.bState], ==, member[.m_bTrueIfMatch]]] begin[{]
if[binary_operation[member[.index], ==, literal[1]]] begin[{]
assign[member[.fieldString], binary_operation[member[.m_strTargetValue], +, member[.fieldString]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[.index], !=, literal[1]]] begin[{]
assign[member[.fieldString], binary_operation[call[fieldString.substring, parameter[literal[0], member[.index]]], +, call[fieldString.substring, parameter[binary_operation[member[.index], +, literal[1]]]]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
assign[member[.fieldString], member[.m_strTargetValue]]
end[}]
return[THIS[call[None.setString, parameter[member[.fieldString], member[.bDisplayOption], member[.iMoveMode]]]]]
else begin[{]
if[binary_operation[member[.m_fldTargetValue], !=, literal[null]]] begin[{]
if[binary_operation[member[.bState], ==, member[.m_bTrueIfMatch]]] begin[{]
return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=BaseField, sub_type=None))]
else begin[{]
return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=BaseField, sub_type=None))]
end[}]
else begin[{]
if[binary_operation[member[.bState], ==, member[.m_bTrueIfMatch]]] begin[{]
return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=BaseField, sub_type=None))]
else begin[{]
return[member[DBConstants.NORMAL_RETURN]]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[setState] operator[SEP] Keyword[boolean] identifier[bState] , Keyword[boolean] identifier[bDisplayOption] , Keyword[int] identifier[iMoveMode] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_strTargetValue] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[fieldString] operator[=] Keyword[this] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_boolMaskValue] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[index] operator[=] identifier[fieldString] operator[SEP] identifier[indexOf] operator[SEP] identifier[m_strTargetValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bState] operator[==] identifier[m_bTrueIfMatch] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] {
identifier[fieldString] operator[=] identifier[m_strTargetValue] operator[+] identifier[fieldString] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[fieldString] operator[=] identifier[fieldString] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[+] identifier[fieldString] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
}
Keyword[else] identifier[fieldString] operator[=] identifier[m_strTargetValue] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[setString] operator[SEP] identifier[fieldString] , identifier[bDisplayOption] , identifier[iMoveMode] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[m_fldTargetValue] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[bState] operator[==] identifier[m_bTrueIfMatch] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[BaseField] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[moveFieldToThis] operator[SEP] identifier[m_fldTargetValue] , identifier[bDisplayOption] , identifier[iMoveMode] operator[SEP] operator[SEP] Keyword[else] Keyword[return] operator[SEP] operator[SEP] identifier[BaseField] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setString] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[bState] operator[==] identifier[m_bTrueIfMatch] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[BaseField] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setString] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[DBConstants] operator[SEP] identifier[NORMAL_RETURN] operator[SEP]
}
}
|
public static Map<String, List<TraceEvent>> tocConnectionListeners(List<TraceEvent> data) throws Exception
{
Map<String, List<TraceEvent>> result = new TreeMap<String, List<TraceEvent>>();
for (TraceEvent te : data)
{
if (te.getType() == TraceEvent.GET_CONNECTION_LISTENER ||
te.getType() == TraceEvent.GET_CONNECTION_LISTENER_NEW ||
te.getType() == TraceEvent.GET_INTERLEAVING_CONNECTION_LISTENER ||
te.getType() == TraceEvent.GET_INTERLEAVING_CONNECTION_LISTENER_NEW)
{
List<TraceEvent> l = result.get(te.getConnectionListener());
if (l == null)
l = new ArrayList<TraceEvent>();
l.add(te);
result.put(te.getConnectionListener(), l);
}
}
return result;
} | class class_name[name] begin[{]
method[tocConnectionListeners, return_type[type[Map]], modifier[public static], parameter[data]] begin[{]
local_variable[type[Map], result]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None), operandr=MemberReference(member=GET_CONNECTION_LISTENER, postfix_operators=[], prefix_operators=[], qualifier=TraceEvent, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None), operandr=MemberReference(member=GET_CONNECTION_LISTENER_NEW, postfix_operators=[], prefix_operators=[], qualifier=TraceEvent, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None), operandr=MemberReference(member=GET_INTERLEAVING_CONNECTION_LISTENER, postfix_operators=[], prefix_operators=[], qualifier=TraceEvent, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None), operandr=MemberReference(member=GET_INTERLEAVING_CONNECTION_LISTENER_NEW, postfix_operators=[], prefix_operators=[], qualifier=TraceEvent, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConnectionListener, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=l)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TraceEvent, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=l, 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=Assignment(expressionl=MemberReference(member=l, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TraceEvent, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=te, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConnectionListener, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None), MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], 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=te)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TraceEvent, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[TraceEvent] operator[>] operator[>] identifier[tocConnectionListeners] operator[SEP] identifier[List] operator[<] identifier[TraceEvent] operator[>] identifier[data] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[TraceEvent] operator[>] operator[>] identifier[result] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[String] , identifier[List] operator[<] identifier[TraceEvent] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TraceEvent] identifier[te] operator[:] identifier[data] operator[SEP] {
Keyword[if] operator[SEP] identifier[te] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TraceEvent] operator[SEP] identifier[GET_CONNECTION_LISTENER] operator[||] identifier[te] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TraceEvent] operator[SEP] identifier[GET_CONNECTION_LISTENER_NEW] operator[||] identifier[te] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TraceEvent] operator[SEP] identifier[GET_INTERLEAVING_CONNECTION_LISTENER] operator[||] identifier[te] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TraceEvent] operator[SEP] identifier[GET_INTERLEAVING_CONNECTION_LISTENER_NEW] operator[SEP] {
identifier[List] operator[<] identifier[TraceEvent] operator[>] identifier[l] operator[=] identifier[result] operator[SEP] identifier[get] operator[SEP] identifier[te] operator[SEP] identifier[getConnectionListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[==] Other[null] operator[SEP] identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[TraceEvent] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[te] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[te] operator[SEP] identifier[getConnectionListener] operator[SEP] operator[SEP] , identifier[l] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
@BetaApi
public final HealthCheck getHealthCheck(String healthCheck) {
GetHealthCheckHttpRequest request =
GetHealthCheckHttpRequest.newBuilder().setHealthCheck(healthCheck).build();
return getHealthCheck(request);
} | class class_name[name] begin[{]
method[getHealthCheck, return_type[type[HealthCheck]], modifier[final public], parameter[healthCheck]] begin[{]
local_variable[type[GetHealthCheckHttpRequest], request]
return[call[.getHealthCheck, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[HealthCheck] identifier[getHealthCheck] operator[SEP] identifier[String] identifier[healthCheck] operator[SEP] {
identifier[GetHealthCheckHttpRequest] identifier[request] operator[=] identifier[GetHealthCheckHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setHealthCheck] operator[SEP] identifier[healthCheck] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getHealthCheck] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
@Override
public CreateRealtimeEndpointResult createRealtimeEndpoint(CreateRealtimeEndpointRequest request) {
request = beforeClientExecution(request);
return executeCreateRealtimeEndpoint(request);
} | class class_name[name] begin[{]
method[createRealtimeEndpoint, return_type[type[CreateRealtimeEndpointResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeCreateRealtimeEndpoint, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CreateRealtimeEndpointResult] identifier[createRealtimeEndpoint] operator[SEP] identifier[CreateRealtimeEndpointRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeCreateRealtimeEndpoint] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
protected I fixIndex(I idx) {
//return idx;
if (idx.size() < 2) {
return idx;
}
NavigableMap<Integer, E> map = idx.getMapByNum();
Iterator<? extends Map.Entry<Integer, E>> it = map.entrySet().iterator();
// we have at least 2 elements in the iterator
Map.Entry<Integer, E> curr = it.next();
while (it.hasNext()) {
Map.Entry<Integer, E> next = it.next();
OffsetLength currOfflen = curr.getValue().getOffsetLength();
OffsetLength nextOfflen = next.getValue().getOffsetLength();
curr.getValue().setOffsetLength(
new OffsetLength(currOfflen.offset, (int) (nextOfflen.offset - currOfflen.offset)));
curr = next;
}
return idx;
} | class class_name[name] begin[{]
method[fixIndex, return_type[type[I]], modifier[protected], parameter[idx]] begin[{]
if[binary_operation[call[idx.size, parameter[]], <, literal[2]]] begin[{]
return[member[.idx]]
else begin[{]
None
end[}]
local_variable[type[NavigableMap], map]
local_variable[type[Iterator], it]
local_variable[type[Map], curr]
while[call[it.hasNext, parameter[]]] begin[{]
local_variable[type[Map], next]
local_variable[type[OffsetLength], currOfflen]
local_variable[type[OffsetLength], nextOfflen]
call[curr.getValue, parameter[]]
assign[member[.curr], member[.next]]
end[}]
return[member[.idx]]
end[}]
END[}] | Keyword[protected] identifier[I] identifier[fixIndex] operator[SEP] identifier[I] identifier[idx] operator[SEP] {
Keyword[if] operator[SEP] identifier[idx] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] {
Keyword[return] identifier[idx] operator[SEP]
}
identifier[NavigableMap] operator[<] identifier[Integer] , identifier[E] operator[>] identifier[map] operator[=] identifier[idx] operator[SEP] identifier[getMapByNum] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[E] operator[>] operator[>] identifier[it] operator[=] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[E] operator[>] identifier[curr] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[E] operator[>] identifier[next] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[OffsetLength] identifier[currOfflen] operator[=] identifier[curr] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getOffsetLength] operator[SEP] operator[SEP] operator[SEP] identifier[OffsetLength] identifier[nextOfflen] operator[=] identifier[next] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getOffsetLength] operator[SEP] operator[SEP] operator[SEP] identifier[curr] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[setOffsetLength] operator[SEP] Keyword[new] identifier[OffsetLength] operator[SEP] identifier[currOfflen] operator[SEP] identifier[offset] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[nextOfflen] operator[SEP] identifier[offset] operator[-] identifier[currOfflen] operator[SEP] identifier[offset] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[curr] operator[=] identifier[next] operator[SEP]
}
Keyword[return] identifier[idx] operator[SEP]
}
|
@Override
protected InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException {
if( name.equals(networkInterface.getName()) )
return address;
return null;
} | class class_name[name] begin[{]
method[isAcceptable, return_type[type[InetAddress]], modifier[protected], parameter[networkInterface, address]] begin[{]
if[call[name.equals, parameter[call[networkInterface.getName, parameter[]]]]] begin[{]
return[member[.address]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[InetAddress] identifier[isAcceptable] operator[SEP] identifier[NetworkInterface] identifier[networkInterface] , identifier[InetAddress] identifier[address] operator[SEP] Keyword[throws] identifier[SocketException] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[networkInterface] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[address] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public void dumpTemplate(String templatePath) throws IOException
{
BufferedWriter bw = IOUtil.newBufferedWriter(templatePath);
String template = getTemplate();
bw.write(template);
bw.close();
} | class class_name[name] begin[{]
method[dumpTemplate, return_type[void], modifier[public], parameter[templatePath]] begin[{]
local_variable[type[BufferedWriter], bw]
local_variable[type[String], template]
call[bw.write, parameter[member[.template]]]
call[bw.close, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[dumpTemplate] operator[SEP] identifier[String] identifier[templatePath] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[BufferedWriter] identifier[bw] operator[=] identifier[IOUtil] operator[SEP] identifier[newBufferedWriter] operator[SEP] identifier[templatePath] operator[SEP] operator[SEP] identifier[String] identifier[template] operator[=] identifier[getTemplate] operator[SEP] operator[SEP] operator[SEP] identifier[bw] operator[SEP] identifier[write] operator[SEP] identifier[template] operator[SEP] operator[SEP] identifier[bw] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
|
public int getMinBroadcastConnections() {
lock.lock();
try {
if (minBroadcastConnections == 0) {
int max = getMaxConnections();
if (max <= 1)
return max;
else
return (int) Math.round(getMaxConnections() * 0.8);
}
return minBroadcastConnections;
} finally {
lock.unlock();
}
} | class class_name[name] begin[{]
method[getMinBroadcastConnections, return_type[type[int]], modifier[public], parameter[]] begin[{]
call[lock.lock, parameter[]]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=minBroadcastConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMaxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=max)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<=), else_statement=ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMaxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.8), operator=*)], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), label=None), label=None, then_statement=ReturnStatement(expression=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))])), ReturnStatement(expression=MemberReference(member=minBroadcastConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getMinBroadcastConnections] operator[SEP] operator[SEP] {
identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[minBroadcastConnections] operator[==] Other[0] operator[SEP] {
Keyword[int] identifier[max] operator[=] identifier[getMaxConnections] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[max] operator[<=] Other[1] operator[SEP] Keyword[return] identifier[max] operator[SEP] Keyword[else] Keyword[return] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[getMaxConnections] operator[SEP] operator[SEP] operator[*] literal[Float] operator[SEP] operator[SEP]
}
Keyword[return] identifier[minBroadcastConnections] operator[SEP]
}
Keyword[finally] {
identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Nonnull
@ReturnsMutableCopy
public static ICommonsList <IHCElement <?>> recursiveGetAllChildrenWithTagName (@Nonnull final IHCNode aOwner,
@Nonnull @Nonempty final EHTMLElement... aElements)
{
ValueEnforcer.notNull (aOwner, "Owner");
ValueEnforcer.notEmpty (aElements, "Elements");
final ICommonsList <IHCElement <?>> ret = new CommonsArrayList <> ();
HCHelper.iterateChildrenNonBreakable (aOwner, (aParentNode, aChildNode) -> {
if (aChildNode instanceof IHCElement <?>)
{
final IHCElement <?> aCurrentElement = (IHCElement <?>) aChildNode;
final String sCurrentTagName = aCurrentElement.getTagName ();
for (final EHTMLElement aElement : aElements)
if (sCurrentTagName.equalsIgnoreCase (aElement.getElementName ()))
{
ret.add (aCurrentElement);
break;
}
}
});
return ret;
} | class class_name[name] begin[{]
method[recursiveGetAllChildrenWithTagName, return_type[type[ICommonsList]], modifier[public static], parameter[aOwner, aElements]] begin[{]
call[ValueEnforcer.notNull, parameter[member[.aOwner], literal["Owner"]]]
call[ValueEnforcer.notEmpty, parameter[member[.aElements], literal["Elements"]]]
local_variable[type[ICommonsList], ret]
call[HCHelper.iterateChildrenNonBreakable, parameter[member[.aOwner], LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aChildNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=IHCElement, 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=aChildNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=IHCElement, sub_type=None)), name=aCurrentElement)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=IHCElement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTagName, postfix_operators=[], prefix_operators=[], qualifier=aCurrentElement, selectors=[], type_arguments=None), name=sCurrentTagName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getElementName, postfix_operators=[], prefix_operators=[], qualifier=aElement, selectors=[], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=sCurrentTagName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aCurrentElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), control=EnhancedForControl(iterable=MemberReference(member=aElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aElement)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=EHTMLElement, sub_type=None))), label=None)]))], parameters=[InferredFormalParameter(name=aParentNode), InferredFormalParameter(name=aChildNode)])]]
return[member[.ret]]
end[}]
END[}] | annotation[@] identifier[Nonnull] annotation[@] identifier[ReturnsMutableCopy] Keyword[public] Keyword[static] identifier[ICommonsList] operator[<] identifier[IHCElement] operator[<] operator[?] operator[>] operator[>] identifier[recursiveGetAllChildrenWithTagName] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[IHCNode] identifier[aOwner] , annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[EHTMLElement] operator[...] identifier[aElements] operator[SEP] {
identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aOwner] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notEmpty] operator[SEP] identifier[aElements] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[ICommonsList] operator[<] identifier[IHCElement] operator[<] operator[?] operator[>] operator[>] identifier[ret] operator[=] Keyword[new] identifier[CommonsArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[HCHelper] operator[SEP] identifier[iterateChildrenNonBreakable] operator[SEP] identifier[aOwner] , operator[SEP] identifier[aParentNode] , identifier[aChildNode] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[aChildNode] Keyword[instanceof] identifier[IHCElement] operator[<] operator[?] operator[>] operator[SEP] {
Keyword[final] identifier[IHCElement] operator[<] operator[?] operator[>] identifier[aCurrentElement] operator[=] operator[SEP] identifier[IHCElement] operator[<] operator[?] operator[>] operator[SEP] identifier[aChildNode] operator[SEP] Keyword[final] identifier[String] identifier[sCurrentTagName] operator[=] identifier[aCurrentElement] operator[SEP] identifier[getTagName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[EHTMLElement] identifier[aElement] operator[:] identifier[aElements] operator[SEP] Keyword[if] operator[SEP] identifier[sCurrentTagName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[aElement] operator[SEP] identifier[getElementName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[aCurrentElement] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
} operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
@Nullable
public Module findLoadedModule(ModuleIdentifier revisionId) {
Objects.requireNonNull(revisionId, "revisionId");
return findLoadedModuleLocal(revisionId);
} | class class_name[name] begin[{]
method[findLoadedModule, return_type[type[Module]], modifier[public], parameter[revisionId]] begin[{]
call[Objects.requireNonNull, parameter[member[.revisionId], literal["revisionId"]]]
return[call[.findLoadedModuleLocal, parameter[member[.revisionId]]]]
end[}]
END[}] | annotation[@] identifier[Nullable] Keyword[public] identifier[Module] identifier[findLoadedModule] operator[SEP] identifier[ModuleIdentifier] identifier[revisionId] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[revisionId] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[findLoadedModuleLocal] operator[SEP] identifier[revisionId] operator[SEP] operator[SEP]
}
|
public void addWord(String word) {
if (!vocabulary.containsKey(word)) {
VocabularyWord vw = new VocabularyWord(word);
/*
TODO: this should be done in different way, since this implementation causes minWordFrequency ultimate ignoral if markAsSpecial set to TRUE
Probably the best way to solve it, is remove markAsSpecial option here, and let this issue be regulated with minWordFrequency
*/
// vw.setSpecial(markAsSpecial);
// initialize frequencyShift only if hugeModelExpected. It's useless otherwise :)
if (hugeModelExpected)
vw.setFrequencyShift(new byte[retentionDelay]);
vocabulary.put(word, vw);
if (hugeModelExpected && minWordFrequency > 1
&& hiddenWordsCounter.incrementAndGet() % scavengerThreshold == 0)
activateScavenger();
return;
}
} | class class_name[name] begin[{]
method[addWord, return_type[void], modifier[public], parameter[word]] begin[{]
if[call[vocabulary.containsKey, parameter[member[.word]]]] begin[{]
local_variable[type[VocabularyWord], vw]
if[member[.hugeModelExpected]] begin[{]
call[vw.setFrequencyShift, parameter[ArrayCreator(dimensions=[MemberReference(member=retentionDelay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))]]
else begin[{]
None
end[}]
call[vocabulary.put, parameter[member[.word], member[.vw]]]
if[binary_operation[binary_operation[member[.hugeModelExpected], &&, binary_operation[member[.minWordFrequency], >, literal[1]]], &&, binary_operation[binary_operation[call[hiddenWordsCounter.incrementAndGet, parameter[]], %, member[.scavengerThreshold]], ==, literal[0]]]] begin[{]
call[.activateScavenger, parameter[]]
else begin[{]
None
end[}]
return[None]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addWord] operator[SEP] identifier[String] identifier[word] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[vocabulary] operator[SEP] identifier[containsKey] operator[SEP] identifier[word] operator[SEP] operator[SEP] {
identifier[VocabularyWord] identifier[vw] operator[=] Keyword[new] identifier[VocabularyWord] operator[SEP] identifier[word] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hugeModelExpected] operator[SEP] identifier[vw] operator[SEP] identifier[setFrequencyShift] operator[SEP] Keyword[new] Keyword[byte] operator[SEP] identifier[retentionDelay] operator[SEP] operator[SEP] operator[SEP] identifier[vocabulary] operator[SEP] identifier[put] operator[SEP] identifier[word] , identifier[vw] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hugeModelExpected] operator[&&] identifier[minWordFrequency] operator[>] Other[1] operator[&&] identifier[hiddenWordsCounter] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[%] identifier[scavengerThreshold] operator[==] Other[0] operator[SEP] identifier[activateScavenger] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
|
private static Object getParentObjByPath4text(Map dataMap,String dept_path){
String[] pathNode=dept_path.split("/");
int size=pathNode.length;
if(size<0){
return dataMap;
}
Object subObj=null;
Map rowObj=dataMap;
if(dept_path.equals("")){
return dataMap;
}
for(int i=0;i<size;i++){
String key=pathNode[i];
if(key.contains("[")){
int start=key.indexOf("[");
int end=key.indexOf("]");
String realKey=key.substring(0,start);
String temp=key.substring(start+1, end);
int index=0;
if(temp!=null && !"".equals(temp)){
index=Integer.valueOf(temp);
}
List tempList=(List) rowObj.get(realKey);
if(tempList==null){
tempList=new ArrayList();
rowObj.put(realKey, tempList);
}
int lsize=tempList.size();
while(lsize<index+1){
tempList.add(new HashMap());
lsize=tempList.size();
}
subObj=tempList.get(index);
}else{
subObj=rowObj.get(key);
if(subObj==null){
subObj=new HashMap();
rowObj.put(key, subObj);
}
}
if(i+1<size){
rowObj=(Map) subObj;
}
}
return subObj;
} | class class_name[name] begin[{]
method[getParentObjByPath4text, return_type[type[Object]], modifier[private static], parameter[dataMap, dept_path]] begin[{]
local_variable[type[String], pathNode]
local_variable[type[int], size]
if[binary_operation[member[.size], <, literal[0]]] begin[{]
return[member[.dataMap]]
else begin[{]
None
end[}]
local_variable[type[Object], subObj]
local_variable[type[Map], rowObj]
if[call[dept_path.equals, parameter[literal[""]]]] begin[{]
return[member[.dataMap]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=pathNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=subObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=rowObj, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=subObj, 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=subObj, 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=HashMap, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=rowObj, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), name=start)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), name=realKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), name=temp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=realKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=rowObj, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), name=tempList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tempList, 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=tempList, 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=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=realKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tempList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=rowObj, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=tempList, selectors=[], type_arguments=None), name=lsize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=tempList, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lsize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=tempList, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=lsize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=<), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=subObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tempList, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rowObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=subObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.subObj]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Object] identifier[getParentObjByPath4text] operator[SEP] identifier[Map] identifier[dataMap] , identifier[String] identifier[dept_path] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[pathNode] operator[=] identifier[dept_path] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[pathNode] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[<] Other[0] operator[SEP] {
Keyword[return] identifier[dataMap] operator[SEP]
}
identifier[Object] identifier[subObj] operator[=] Other[null] operator[SEP] identifier[Map] identifier[rowObj] operator[=] identifier[dataMap] operator[SEP] Keyword[if] operator[SEP] identifier[dept_path] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[dataMap] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[key] operator[=] identifier[pathNode] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[key] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[key] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[realKey] operator[=] identifier[key] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[start] operator[SEP] operator[SEP] identifier[String] identifier[temp] operator[=] identifier[key] operator[SEP] identifier[substring] operator[SEP] identifier[start] operator[+] Other[1] , identifier[end] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[temp] operator[!=] Other[null] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[temp] operator[SEP] operator[SEP] {
identifier[index] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[temp] operator[SEP] operator[SEP]
}
identifier[List] identifier[tempList] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[rowObj] operator[SEP] identifier[get] operator[SEP] identifier[realKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tempList] operator[==] Other[null] operator[SEP] {
identifier[tempList] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[rowObj] operator[SEP] identifier[put] operator[SEP] identifier[realKey] , identifier[tempList] operator[SEP] operator[SEP]
}
Keyword[int] identifier[lsize] operator[=] identifier[tempList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[lsize] operator[<] identifier[index] operator[+] Other[1] operator[SEP] {
identifier[tempList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lsize] operator[=] identifier[tempList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP]
}
identifier[subObj] operator[=] identifier[tempList] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[subObj] operator[=] identifier[rowObj] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[subObj] operator[==] Other[null] operator[SEP] {
identifier[subObj] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] identifier[rowObj] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[subObj] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[size] operator[SEP] {
identifier[rowObj] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[subObj] operator[SEP]
}
}
Keyword[return] identifier[subObj] operator[SEP]
}
|
public void kill_zombie_appenders () {
//- Get all devices
Vector dl = Util.instance().get_device_list("*");
//- Check appenders validity then kill them if needed
for (Object aDl : dl)
{
//- Get device reference
DeviceImpl dev = (DeviceImpl) aDl;
//- Get device logger
Logger logger = dev.get_logger();
if (logger != null)
{
Enumeration all_appenders = logger.getAllAppenders();
while (all_appenders.hasMoreElements())
{
Appender appender = (Appender) all_appenders.nextElement();
if (((TangoAppender) appender).isValid() == false)
{
Util.out4.println("Removing zombie appender " + dev.get_name() + LOGGING_SEPARATOR + appender.getName());
logger.removeAppender(appender);
}
}
}
}
} | class class_name[name] begin[{]
method[kill_zombie_appenders, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Vector], dl]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=aDl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DeviceImpl, sub_type=None)), name=dev)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeviceImpl, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get_logger, postfix_operators=[], prefix_operators=[], qualifier=dev, selectors=[], type_arguments=None), name=logger)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Logger, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAllAppenders, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), name=all_appenders)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=all_appenders, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Appender, sub_type=None)), name=appender)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Appender, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Cast(expression=MemberReference(member=appender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TangoAppender, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Removing zombie appender "), operandr=MethodInvocation(arguments=[], member=get_name, postfix_operators=[], prefix_operators=[], qualifier=dev, selectors=[], type_arguments=None), operator=+), operandr=MemberReference(member=LOGGING_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=appender, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=Util.out4, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=appender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeAppender, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=all_appenders, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=dl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aDl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[kill_zombie_appenders] operator[SEP] operator[SEP] {
identifier[Vector] identifier[dl] operator[=] identifier[Util] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[get_device_list] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[aDl] operator[:] identifier[dl] operator[SEP] {
identifier[DeviceImpl] identifier[dev] operator[=] operator[SEP] identifier[DeviceImpl] operator[SEP] identifier[aDl] operator[SEP] identifier[Logger] identifier[logger] operator[=] identifier[dev] operator[SEP] identifier[get_logger] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[!=] Other[null] operator[SEP] {
identifier[Enumeration] identifier[all_appenders] operator[=] identifier[logger] operator[SEP] identifier[getAllAppenders] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[all_appenders] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[Appender] identifier[appender] operator[=] operator[SEP] identifier[Appender] operator[SEP] identifier[all_appenders] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[TangoAppender] operator[SEP] identifier[appender] operator[SEP] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[Util] operator[SEP] identifier[out4] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[dev] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] operator[+] identifier[LOGGING_SEPARATOR] operator[+] identifier[appender] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[removeAppender] operator[SEP] identifier[appender] operator[SEP] operator[SEP]
}
}
}
}
}
|
protected static void lookupFieldResource(javax.naming.Context context,
Object instance, Field field, String name)
throws NamingException, IllegalAccessException {
Object lookedupResource = null;
boolean accessibility = false;
String normalizedName = normalize(name);
if ((normalizedName != null) && (normalizedName.length() > 0)) {
lookedupResource = context.lookup(normalizedName);
} else {
if(field.getClass().getName().startsWith("javax.servlet.sip")) {
lookedupResource = context.lookup("sip/" + instance.getClass().getName() + "/" + field.getName());
} else {
lookedupResource = context.lookup(instance.getClass().getName() + "/" + field.getName());
}
}
accessibility = field.isAccessible();
field.setAccessible(true);
field.set(instance, lookedupResource);
field.setAccessible(accessibility);
} | class class_name[name] begin[{]
method[lookupFieldResource, return_type[void], modifier[static protected], parameter[context, instance, field, name]] begin[{]
local_variable[type[Object], lookedupResource]
local_variable[type[boolean], accessibility]
local_variable[type[String], normalizedName]
if[binary_operation[binary_operation[member[.normalizedName], !=, literal[null]], &&, binary_operation[call[normalizedName.length, parameter[]], >, literal[0]]]] begin[{]
assign[member[.lookedupResource], call[context.lookup, parameter[member[.normalizedName]]]]
else begin[{]
if[call[field.getClass, parameter[]]] begin[{]
assign[member[.lookedupResource], call[context.lookup, parameter[binary_operation[binary_operation[binary_operation[literal["sip/"], +, call[instance.getClass, parameter[]]], +, literal["/"]], +, call[field.getName, parameter[]]]]]]
else begin[{]
assign[member[.lookedupResource], call[context.lookup, parameter[binary_operation[binary_operation[call[instance.getClass, parameter[]], +, literal["/"]], +, call[field.getName, parameter[]]]]]]
end[}]
end[}]
assign[member[.accessibility], call[field.isAccessible, parameter[]]]
call[field.setAccessible, parameter[literal[true]]]
call[field.set, parameter[member[.instance], member[.lookedupResource]]]
call[field.setAccessible, parameter[member[.accessibility]]]
end[}]
END[}] | Keyword[protected] Keyword[static] Keyword[void] identifier[lookupFieldResource] operator[SEP] identifier[javax] operator[SEP] identifier[naming] operator[SEP] identifier[Context] identifier[context] , identifier[Object] identifier[instance] , identifier[Field] identifier[field] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[NamingException] , identifier[IllegalAccessException] {
identifier[Object] identifier[lookedupResource] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[accessibility] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[normalizedName] operator[=] identifier[normalize] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[normalizedName] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[normalizedName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] {
identifier[lookedupResource] operator[=] identifier[context] operator[SEP] identifier[lookup] operator[SEP] identifier[normalizedName] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[lookedupResource] operator[=] identifier[context] operator[SEP] identifier[lookup] operator[SEP] literal[String] operator[+] identifier[instance] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[lookedupResource] operator[=] identifier[context] operator[SEP] identifier[lookup] operator[SEP] identifier[instance] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[accessibility] operator[=] identifier[field] operator[SEP] identifier[isAccessible] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[set] operator[SEP] identifier[instance] , identifier[lookedupResource] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setAccessible] operator[SEP] identifier[accessibility] operator[SEP] operator[SEP]
}
|
private void moveOldStructure() throws Exception
{
ExtendedSession session = (ExtendedSession)service.getStorageSession();
try
{
if (session.itemExists(storagePathOld))
{
return;
}
else
{
session.move(service.getStoragePath(), storagePathOld, false);
session.save();
}
}
finally
{
session.logout();
}
} | class class_name[name] begin[{]
method[moveOldStructure, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[ExtendedSession], session]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=storagePathOld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=itemExists, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStoragePath, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[], type_arguments=None), MemberReference(member=storagePathOld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=move, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=save, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=logout, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[moveOldStructure] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[ExtendedSession] identifier[session] operator[=] operator[SEP] identifier[ExtendedSession] operator[SEP] identifier[service] operator[SEP] identifier[getStorageSession] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[session] operator[SEP] identifier[itemExists] operator[SEP] identifier[storagePathOld] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[else] {
identifier[session] operator[SEP] identifier[move] operator[SEP] identifier[service] operator[SEP] identifier[getStoragePath] operator[SEP] operator[SEP] , identifier[storagePathOld] , literal[boolean] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[session] operator[SEP] identifier[logout] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void insert(final double argIn) {
attributeValue_5.data_format = AttrDataFormat.FMT_UNKNOWN;
attributeValue_5.w_dim.dim_x = 1;
attributeValue_5.w_dim.dim_y = 0;
insert(new double[] { argIn });
} | class class_name[name] begin[{]
method[insert, return_type[void], modifier[public], parameter[argIn]] begin[{]
assign[member[attributeValue_5.data_format], member[AttrDataFormat.FMT_UNKNOWN]]
assign[member[attributeValue_5.w_dim.dim_x], literal[1]]
assign[member[attributeValue_5.w_dim.dim_y], literal[0]]
call[.insert, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=argIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[insert] operator[SEP] Keyword[final] Keyword[double] identifier[argIn] operator[SEP] {
identifier[attributeValue_5] operator[SEP] identifier[data_format] operator[=] identifier[AttrDataFormat] operator[SEP] identifier[FMT_UNKNOWN] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[w_dim] operator[SEP] identifier[dim_x] operator[=] Other[1] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[w_dim] operator[SEP] identifier[dim_y] operator[=] Other[0] operator[SEP] identifier[insert] operator[SEP] Keyword[new] Keyword[double] operator[SEP] operator[SEP] {
identifier[argIn]
} operator[SEP] operator[SEP]
}
|
protected static Comment transformComment(CSNodeWrapper node) {
final Comment comment;
if (node.getNodeType() == CommonConstants.CS_NODE_COMMENT) {
comment = new Comment(node.getTitle());
} else {
throw new IllegalArgumentException("The passed node is not a Comment");
}
comment.setUniqueId(node.getId() == null ? null : node.getId().toString());
return comment;
} | class class_name[name] begin[{]
method[transformComment, return_type[type[Comment]], modifier[static protected], parameter[node]] begin[{]
local_variable[type[Comment], comment]
if[binary_operation[call[node.getNodeType, parameter[]], ==, member[CommonConstants.CS_NODE_COMMENT]]] begin[{]
assign[member[.comment], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTitle, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Comment, sub_type=None))]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The passed node is not a Comment")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
call[comment.setUniqueId, parameter[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MethodInvocation(arguments=[], member=toString, 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[member[.comment]]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[Comment] identifier[transformComment] operator[SEP] identifier[CSNodeWrapper] identifier[node] operator[SEP] {
Keyword[final] identifier[Comment] identifier[comment] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[CommonConstants] operator[SEP] identifier[CS_NODE_COMMENT] operator[SEP] {
identifier[comment] operator[=] Keyword[new] identifier[Comment] operator[SEP] identifier[node] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[comment] operator[SEP] identifier[setUniqueId] operator[SEP] identifier[node] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[node] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[comment] operator[SEP]
}
|
public static <T> T copy(T orig) {
if (orig == null)
return null;
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(orig);
oos.flush();
ByteArrayInputStream bin = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bin);
return (T) ois.readObject();
} catch (Exception e) {
throw S1SystemError.wrap(e);
}
} | class class_name[name] begin[{]
method[copy, return_type[type[T]], modifier[public static], parameter[orig]] begin[{]
if[binary_operation[member[.orig], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=bos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None)), name=oos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=orig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None)), name=bin)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bin, 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=ObjectInputStream, sub_type=None)), name=ois)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectInputStream, sub_type=None)), ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=S1SystemError, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[copy] operator[SEP] identifier[T] identifier[orig] operator[SEP] {
Keyword[if] operator[SEP] identifier[orig] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[try] {
identifier[ByteArrayOutputStream] identifier[bos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectOutputStream] identifier[oos] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] identifier[bos] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[writeObject] operator[SEP] identifier[orig] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[ByteArrayInputStream] identifier[bin] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[bos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectInputStream] identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] identifier[bin] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[ois] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] identifier[S1SystemError] operator[SEP] identifier[wrap] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public String placeGateioLimitOrder(
CurrencyPair currencyPair, GateioOrderType orderType, BigDecimal rate, BigDecimal amount)
throws IOException {
String pair = formatCurrencyPair(currencyPair);
GateioPlaceOrderReturn orderId;
if (orderType.equals(GateioOrderType.BUY)) {
orderId = bter.buy(pair, rate, amount, apiKey, signatureCreator);
} else {
orderId = bter.sell(pair, rate, amount, apiKey, signatureCreator);
}
return handleResponse(orderId).getOrderId();
} | class class_name[name] begin[{]
method[placeGateioLimitOrder, return_type[type[String]], modifier[public], parameter[currencyPair, orderType, rate, amount]] begin[{]
local_variable[type[String], pair]
local_variable[type[GateioPlaceOrderReturn], orderId]
if[call[orderType.equals, parameter[member[GateioOrderType.BUY]]]] begin[{]
assign[member[.orderId], call[bter.buy, parameter[member[.pair], member[.rate], member[.amount], member[.apiKey], member[.signatureCreator]]]]
else begin[{]
assign[member[.orderId], call[bter.sell, parameter[member[.pair], member[.rate], member[.amount], member[.apiKey], member[.signatureCreator]]]]
end[}]
return[call[.handleResponse, parameter[member[.orderId]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[placeGateioLimitOrder] operator[SEP] identifier[CurrencyPair] identifier[currencyPair] , identifier[GateioOrderType] identifier[orderType] , identifier[BigDecimal] identifier[rate] , identifier[BigDecimal] identifier[amount] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[pair] operator[=] identifier[formatCurrencyPair] operator[SEP] identifier[currencyPair] operator[SEP] operator[SEP] identifier[GateioPlaceOrderReturn] identifier[orderId] operator[SEP] Keyword[if] operator[SEP] identifier[orderType] operator[SEP] identifier[equals] operator[SEP] identifier[GateioOrderType] operator[SEP] identifier[BUY] operator[SEP] operator[SEP] {
identifier[orderId] operator[=] identifier[bter] operator[SEP] identifier[buy] operator[SEP] identifier[pair] , identifier[rate] , identifier[amount] , identifier[apiKey] , identifier[signatureCreator] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[orderId] operator[=] identifier[bter] operator[SEP] identifier[sell] operator[SEP] identifier[pair] , identifier[rate] , identifier[amount] , identifier[apiKey] , identifier[signatureCreator] operator[SEP] operator[SEP]
}
Keyword[return] identifier[handleResponse] operator[SEP] identifier[orderId] operator[SEP] operator[SEP] identifier[getOrderId] operator[SEP] operator[SEP] operator[SEP]
}
|
public @Nonnull Iterable<Double> doubles() {
final JsonArray parent=this;
return () -> {
final Iterator<JsonElement> iterator = parent.iterator();
return new Iterator<Double>() {
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public Double next() {
return iterator.next().asDouble();
}
@Override
public void remove() {
iterator.remove();
}
};
};
} | class class_name[name] begin[{]
method[doubles, return_type[type[Iterable]], modifier[public], parameter[]] begin[{]
local_variable[type[JsonArray], parent]
return[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), name=iterator)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JsonElement, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[MethodInvocation(arguments=[], member=asDouble, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=remove, parameters=[], 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=Double, sub_type=None))], dimensions=None, name=Iterator, sub_type=None)), label=None)], parameters=[])]
end[}]
END[}] | Keyword[public] annotation[@] identifier[Nonnull] identifier[Iterable] operator[<] identifier[Double] operator[>] identifier[doubles] operator[SEP] operator[SEP] {
Keyword[final] identifier[JsonArray] identifier[parent] operator[=] Keyword[this] operator[SEP] Keyword[return] operator[SEP] operator[SEP] operator[->] {
Keyword[final] identifier[Iterator] operator[<] identifier[JsonElement] operator[>] identifier[iterator] operator[=] identifier[parent] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[Double] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] {
Keyword[return] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] identifier[Double] identifier[next] operator[SEP] operator[SEP] {
Keyword[return] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[asDouble] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] {
identifier[iterator] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
} operator[SEP]
}
|
public DERObject toASN1Object()
{
ASN1EncodableVector av = new ASN1EncodableVector();
av.add (organization);
av.add (noticeNumbers);
return new DERSequence (av);
} | class class_name[name] begin[{]
method[toASN1Object, return_type[type[DERObject]], modifier[public], parameter[]] begin[{]
local_variable[type[ASN1EncodableVector], av]
call[av.add, parameter[member[.organization]]]
call[av.add, parameter[member[.noticeNumbers]]]
return[ClassCreator(arguments=[MemberReference(member=av, 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=DERSequence, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[DERObject] identifier[toASN1Object] operator[SEP] operator[SEP] {
identifier[ASN1EncodableVector] identifier[av] operator[=] Keyword[new] identifier[ASN1EncodableVector] operator[SEP] operator[SEP] operator[SEP] identifier[av] operator[SEP] identifier[add] operator[SEP] identifier[organization] operator[SEP] operator[SEP] identifier[av] operator[SEP] identifier[add] operator[SEP] identifier[noticeNumbers] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DERSequence] operator[SEP] identifier[av] operator[SEP] operator[SEP]
}
|
public EtcdStoreStatsResponse getStoreStats() {
try {
return new EtcdStoreStatsRequest(this.client, retryHandler).send().get();
} catch (IOException | EtcdException | EtcdAuthenticationException | TimeoutException e) {
return null;
}
} | class class_name[name] begin[{]
method[getStoreStats, return_type[type[EtcdStoreStatsResponse]], modifier[public], parameter[]] begin[{]
TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=client, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=retryHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=send, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=EtcdStoreStatsRequest, sub_type=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException', 'EtcdException', 'EtcdAuthenticationException', 'TimeoutException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[EtcdStoreStatsResponse] identifier[getStoreStats] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] Keyword[new] identifier[EtcdStoreStatsRequest] operator[SEP] Keyword[this] operator[SEP] identifier[client] , identifier[retryHandler] operator[SEP] operator[SEP] identifier[send] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[EtcdException] operator[|] identifier[EtcdAuthenticationException] operator[|] identifier[TimeoutException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
|
@SuppressWarnings("rawtypes")
@Override
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
monitor.subTask("Running SpotBugs...");
switch (kind) {
case IncrementalProjectBuilder.FULL_BUILD: {
FindBugs2Eclipse.cleanClassClache(getProject());
if (FindbugsPlugin.getUserPreferences(getProject()).isRunAtFullBuild()) {
if (DEBUG) {
System.out.println("FULL BUILD");
}
doBuild(args, monitor, kind);
} else {
// TODO probably worth to cleanup?
// MarkerUtil.removeMarkers(getProject());
}
break;
}
case IncrementalProjectBuilder.INCREMENTAL_BUILD: {
if (DEBUG) {
System.out.println("INCREMENTAL BUILD");
}
doBuild(args, monitor, kind);
break;
}
case IncrementalProjectBuilder.AUTO_BUILD: {
if (DEBUG) {
System.out.println("AUTO BUILD");
}
doBuild(args, monitor, kind);
break;
}
default: {
FindbugsPlugin.getDefault()
.logWarning("UKNOWN BUILD kind" + kind);
doBuild(args, monitor, kind);
break;
}
}
return null;
} | class class_name[name] begin[{]
method[build, return_type[type[IProject]], modifier[protected], parameter[kind, args, monitor]] begin[{]
call[monitor.subTask, parameter[literal["Running SpotBugs..."]]]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=FULL_BUILD, postfix_operators=[], prefix_operators=[], qualifier=IncrementalProjectBuilder, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=cleanClassClache, postfix_operators=[], prefix_operators=[], qualifier=FindBugs2Eclipse, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getUserPreferences, postfix_operators=[], prefix_operators=[], qualifier=FindbugsPlugin, selectors=[MethodInvocation(arguments=[], member=isRunAtFullBuild, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=DEBUG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FULL BUILD")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=monitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doBuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=INCREMENTAL_BUILD, postfix_operators=[], prefix_operators=[], qualifier=IncrementalProjectBuilder, selectors=[])], statements=[BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=DEBUG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INCREMENTAL BUILD")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=monitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doBuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=AUTO_BUILD, postfix_operators=[], prefix_operators=[], qualifier=IncrementalProjectBuilder, selectors=[])], statements=[BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=DEBUG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AUTO BUILD")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=monitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doBuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=FindbugsPlugin, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UKNOWN BUILD kind"), operandr=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=logWarning, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=monitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doBuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])])], expression=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[protected] identifier[IProject] operator[SEP] operator[SEP] identifier[build] operator[SEP] Keyword[int] identifier[kind] , identifier[Map] identifier[args] , identifier[IProgressMonitor] identifier[monitor] operator[SEP] Keyword[throws] identifier[CoreException] {
identifier[monitor] operator[SEP] identifier[subTask] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[kind] operator[SEP] {
Keyword[case] identifier[IncrementalProjectBuilder] operator[SEP] identifier[FULL_BUILD] operator[:] {
identifier[FindBugs2Eclipse] operator[SEP] identifier[cleanClassClache] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[FindbugsPlugin] operator[SEP] identifier[getUserPreferences] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isRunAtFullBuild] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[doBuild] operator[SEP] identifier[args] , identifier[monitor] , identifier[kind] operator[SEP] operator[SEP]
}
Keyword[else] {
}
Keyword[break] operator[SEP]
}
Keyword[case] identifier[IncrementalProjectBuilder] operator[SEP] identifier[INCREMENTAL_BUILD] operator[:] {
Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[doBuild] operator[SEP] identifier[args] , identifier[monitor] , identifier[kind] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[IncrementalProjectBuilder] operator[SEP] identifier[AUTO_BUILD] operator[:] {
Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[doBuild] operator[SEP] identifier[args] , identifier[monitor] , identifier[kind] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[default] operator[:] {
identifier[FindbugsPlugin] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[logWarning] operator[SEP] literal[String] operator[+] identifier[kind] operator[SEP] operator[SEP] identifier[doBuild] operator[SEP] identifier[args] , identifier[monitor] , identifier[kind] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public void marshall(PurchaseOfferingRequest purchaseOfferingRequest, ProtocolMarshaller protocolMarshaller) {
if (purchaseOfferingRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(purchaseOfferingRequest.getOfferingId(), OFFERINGID_BINDING);
protocolMarshaller.marshall(purchaseOfferingRequest.getQuantity(), QUANTITY_BINDING);
protocolMarshaller.marshall(purchaseOfferingRequest.getOfferingPromotionId(), OFFERINGPROMOTIONID_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[purchaseOfferingRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.purchaseOfferingRequest], ==, 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=getOfferingId, postfix_operators=[], prefix_operators=[], qualifier=purchaseOfferingRequest, selectors=[], type_arguments=None), MemberReference(member=OFFERINGID_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=getQuantity, postfix_operators=[], prefix_operators=[], qualifier=purchaseOfferingRequest, selectors=[], type_arguments=None), MemberReference(member=QUANTITY_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=getOfferingPromotionId, postfix_operators=[], prefix_operators=[], qualifier=purchaseOfferingRequest, selectors=[], type_arguments=None), MemberReference(member=OFFERINGPROMOTIONID_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[PurchaseOfferingRequest] identifier[purchaseOfferingRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[purchaseOfferingRequest] 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[purchaseOfferingRequest] operator[SEP] identifier[getOfferingId] operator[SEP] operator[SEP] , identifier[OFFERINGID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[purchaseOfferingRequest] operator[SEP] identifier[getQuantity] operator[SEP] operator[SEP] , identifier[QUANTITY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[purchaseOfferingRequest] operator[SEP] identifier[getOfferingPromotionId] operator[SEP] operator[SEP] , identifier[OFFERINGPROMOTIONID_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private CoordinateSequence restoreDim4(CoordinateSequence cs, Map<Coordinate, Double> map) {
CoordinateSequence seq = new PackedCoordinateSequenceFactory(DOUBLE, 4).create(cs.size(), 4);
for (int i = 0; i < cs.size(); i++) {
seq.setOrdinate(i, 0, cs.getOrdinate(i, 0));
seq.setOrdinate(i, 1, cs.getOrdinate(i, 1));
seq.setOrdinate(i, 2, cs.getOrdinate(i, 2));
Double d = map.get(cs.getCoordinate(i));
seq.setOrdinate(i, 3, d == null ? Double.NaN : d);
}
return seq;
} | class class_name[name] begin[{]
method[restoreDim4, return_type[type[CoordinateSequence]], modifier[private], parameter[cs, map]] begin[{]
local_variable[type[CoordinateSequence], seq]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getOrdinate, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None)], member=setOrdinate, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getOrdinate, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None)], member=setOrdinate, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=getOrdinate, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None)], member=setOrdinate, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCoordinate, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=NaN, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]))], member=setOrdinate, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cs, 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[.seq]]
end[}]
END[}] | Keyword[private] identifier[CoordinateSequence] identifier[restoreDim4] operator[SEP] identifier[CoordinateSequence] identifier[cs] , identifier[Map] operator[<] identifier[Coordinate] , identifier[Double] operator[>] identifier[map] operator[SEP] {
identifier[CoordinateSequence] identifier[seq] operator[=] Keyword[new] identifier[PackedCoordinateSequenceFactory] operator[SEP] identifier[DOUBLE] , Other[4] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[cs] operator[SEP] identifier[size] operator[SEP] operator[SEP] , Other[4] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[cs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[seq] operator[SEP] identifier[setOrdinate] operator[SEP] identifier[i] , Other[0] , identifier[cs] operator[SEP] identifier[getOrdinate] operator[SEP] identifier[i] , Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[seq] operator[SEP] identifier[setOrdinate] operator[SEP] identifier[i] , Other[1] , identifier[cs] operator[SEP] identifier[getOrdinate] operator[SEP] identifier[i] , Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[seq] operator[SEP] identifier[setOrdinate] operator[SEP] identifier[i] , Other[2] , identifier[cs] operator[SEP] identifier[getOrdinate] operator[SEP] identifier[i] , Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[Double] identifier[d] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[cs] operator[SEP] identifier[getCoordinate] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[seq] operator[SEP] identifier[setOrdinate] operator[SEP] identifier[i] , Other[3] , identifier[d] operator[==] Other[null] operator[?] identifier[Double] operator[SEP] identifier[NaN] operator[:] identifier[d] operator[SEP] operator[SEP]
}
Keyword[return] identifier[seq] operator[SEP]
}
|
public long openSession(long index, long timestamp, RaftSession session) {
log.debug("Opening session {}", session.sessionId());
// Update the state machine index/timestamp.
tick(index, timestamp);
// Set the session timestamp to the current service timestamp.
session.setLastUpdated(currentTimestamp);
// Expire sessions that have timed out.
expireSessions(currentTimestamp);
// Add the session to the sessions list.
session.open();
service.register(sessions.addSession(session));
// Commit the index, causing events to be sent to clients if necessary.
commit();
// Complete the future.
return session.sessionId().id();
} | class class_name[name] begin[{]
method[openSession, return_type[type[long]], modifier[public], parameter[index, timestamp, session]] begin[{]
call[log.debug, parameter[literal["Opening session {}"], call[session.sessionId, parameter[]]]]
call[.tick, parameter[member[.index], member[.timestamp]]]
call[session.setLastUpdated, parameter[member[.currentTimestamp]]]
call[.expireSessions, parameter[member[.currentTimestamp]]]
call[session.open, parameter[]]
call[service.register, parameter[call[sessions.addSession, parameter[member[.session]]]]]
call[.commit, parameter[]]
return[call[session.sessionId, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[openSession] operator[SEP] Keyword[long] identifier[index] , Keyword[long] identifier[timestamp] , identifier[RaftSession] identifier[session] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[session] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tick] operator[SEP] identifier[index] , identifier[timestamp] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[setLastUpdated] operator[SEP] identifier[currentTimestamp] operator[SEP] operator[SEP] identifier[expireSessions] operator[SEP] identifier[currentTimestamp] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] identifier[service] operator[SEP] identifier[register] operator[SEP] identifier[sessions] operator[SEP] identifier[addSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[session] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP]
}
|
public Tag getTag(Object projectIdOrPath, String tagName) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "repository", "tags", tagName);
return (response.readEntity(Tag.class));
} | class class_name[name] begin[{]
method[getTag, return_type[type[Tag]], modifier[public], parameter[projectIdOrPath, tagName]] begin[{]
local_variable[type[Response], response]
return[call[response.readEntity, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Tag, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Tag] identifier[getTag] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[String] identifier[tagName] operator[SEP] Keyword[throws] identifier[GitLabApiException] {
identifier[Response] identifier[response] operator[=] identifier[get] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[OK] , Other[null] , literal[String] , identifier[getProjectIdOrPath] operator[SEP] identifier[projectIdOrPath] operator[SEP] , literal[String] , literal[String] , identifier[tagName] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[response] operator[SEP] identifier[readEntity] operator[SEP] identifier[Tag] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
@SuppressWarnings("unchecked")
public String get(Object events) throws IllegalArgumentException {
if (events instanceof Iterable) {
return get((Iterable<String>) events, DEFAULT_VALUE);
} else if (events instanceof String) {
final String[] iter = parseEventsAndDefault((String) events);
return get(iter[0], iter[1]);
}
throw new IllegalArgumentException("expected Iterable<String> or String but was " + events);
} | class class_name[name] begin[{]
method[get, return_type[type[String]], modifier[public], parameter[events]] begin[{]
if[binary_operation[member[.events], instanceof, type[Iterable]]] begin[{]
return[call[.get, parameter[Cast(expression=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterable, sub_type=None)), member[.DEFAULT_VALUE]]]]
else begin[{]
if[binary_operation[member[.events], instanceof, type[String]]] begin[{]
local_variable[type[String], iter]
return[call[.get, parameter[member[.iter], member[.iter]]]]
else begin[{]
None
end[}]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="expected Iterable<String> or String but was "), operandr=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[String] identifier[get] operator[SEP] identifier[Object] identifier[events] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[if] operator[SEP] identifier[events] Keyword[instanceof] identifier[Iterable] operator[SEP] {
Keyword[return] identifier[get] operator[SEP] operator[SEP] identifier[Iterable] operator[<] identifier[String] operator[>] operator[SEP] identifier[events] , identifier[DEFAULT_VALUE] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[events] Keyword[instanceof] identifier[String] operator[SEP] {
Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[iter] operator[=] identifier[parseEventsAndDefault] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[events] operator[SEP] operator[SEP] Keyword[return] identifier[get] operator[SEP] identifier[iter] operator[SEP] Other[0] operator[SEP] , identifier[iter] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[events] operator[SEP] operator[SEP]
}
|
public void setURI( String uriString, boolean encoded ) throws URISyntaxException
{
if ( uriString == null )
{
setScheme( null );
setUserInfo( null );
setHost( null );
setPort( UNDEFINED_PORT );
setPath( null );
setQuery( null );
setFragment( null );
}
else
{
URI uri = null;
if ( encoded )
{
// Get (parse) the components using java.net.URI
uri = new URI( uriString );
}
else
{
// Parse, then encode this string into its components using URI
uri = encodeURI( uriString );
}
setURI( uri );
}
} | class class_name[name] begin[{]
method[setURI, return_type[void], modifier[public], parameter[uriString, encoded]] begin[{]
if[binary_operation[member[.uriString], ==, literal[null]]] begin[{]
call[.setScheme, parameter[literal[null]]]
call[.setUserInfo, parameter[literal[null]]]
call[.setHost, parameter[literal[null]]]
call[.setPort, parameter[member[.UNDEFINED_PORT]]]
call[.setPath, parameter[literal[null]]]
call[.setQuery, parameter[literal[null]]]
call[.setFragment, parameter[literal[null]]]
else begin[{]
local_variable[type[URI], uri]
if[member[.encoded]] begin[{]
assign[member[.uri], ClassCreator(arguments=[MemberReference(member=uriString, 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=URI, sub_type=None))]
else begin[{]
assign[member[.uri], call[.encodeURI, parameter[member[.uriString]]]]
end[}]
call[.setURI, parameter[member[.uri]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setURI] operator[SEP] identifier[String] identifier[uriString] , Keyword[boolean] identifier[encoded] operator[SEP] Keyword[throws] identifier[URISyntaxException] {
Keyword[if] operator[SEP] identifier[uriString] operator[==] Other[null] operator[SEP] {
identifier[setScheme] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setUserInfo] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setHost] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setPort] operator[SEP] identifier[UNDEFINED_PORT] operator[SEP] operator[SEP] identifier[setPath] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setQuery] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setFragment] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[URI] identifier[uri] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[encoded] operator[SEP] {
identifier[uri] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[uriString] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[uri] operator[=] identifier[encodeURI] operator[SEP] identifier[uriString] operator[SEP] operator[SEP]
}
identifier[setURI] operator[SEP] identifier[uri] operator[SEP] operator[SEP]
}
}
|
public String convertWindowSpecificationRES3ToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | class class_name[name] begin[{]
method[convertWindowSpecificationRES3ToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | Keyword[public] identifier[String] identifier[convertWindowSpecificationRES3ToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] {
Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void clientDidLogon (Client client)
{
log.info("Connected to peer " + _record + ".");
// subscribe to this peer's node object
PeerBootstrapData pdata = (PeerBootstrapData)client.getBootstrapData();
client.getDObjectManager().subscribeToObject(pdata.nodeOid, this);
} | class class_name[name] begin[{]
method[clientDidLogon, return_type[void], modifier[public], parameter[client]] begin[{]
call[log.info, parameter[binary_operation[binary_operation[literal["Connected to peer "], +, member[._record]], +, literal["."]]]]
local_variable[type[PeerBootstrapData], pdata]
call[client.getDObjectManager, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[clientDidLogon] operator[SEP] identifier[Client] identifier[client] operator[SEP] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[_record] operator[+] literal[String] operator[SEP] operator[SEP] identifier[PeerBootstrapData] identifier[pdata] operator[=] operator[SEP] identifier[PeerBootstrapData] operator[SEP] identifier[client] operator[SEP] identifier[getBootstrapData] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[getDObjectManager] operator[SEP] operator[SEP] operator[SEP] identifier[subscribeToObject] operator[SEP] identifier[pdata] operator[SEP] identifier[nodeOid] , Keyword[this] operator[SEP] operator[SEP]
}
|
static void bindTabWithData(BottomNavigationItem bottomNavigationItem, BottomNavigationTab bottomNavigationTab, BottomNavigationBar bottomNavigationBar) {
Context context = bottomNavigationBar.getContext();
bottomNavigationTab.setLabel(bottomNavigationItem.getTitle(context));
bottomNavigationTab.setIcon(bottomNavigationItem.getIcon(context));
int activeColor = bottomNavigationItem.getActiveColor(context);
int inActiveColor = bottomNavigationItem.getInActiveColor(context);
if (activeColor != Utils.NO_COLOR) {
bottomNavigationTab.setActiveColor(activeColor);
} else {
bottomNavigationTab.setActiveColor(bottomNavigationBar.getActiveColor());
}
if (inActiveColor != Utils.NO_COLOR) {
bottomNavigationTab.setInactiveColor(inActiveColor);
} else {
bottomNavigationTab.setInactiveColor(bottomNavigationBar.getInActiveColor());
}
if (bottomNavigationItem.isInActiveIconAvailable()) {
Drawable inactiveDrawable = bottomNavigationItem.getInactiveIcon(context);
if (inactiveDrawable != null) {
bottomNavigationTab.setInactiveIcon(inactiveDrawable);
}
}
bottomNavigationTab.setItemBackgroundColor(bottomNavigationBar.getBackgroundColor());
BadgeItem badgeItem = bottomNavigationItem.getBadgeItem();
if (badgeItem != null) {
badgeItem.bindToBottomTab(bottomNavigationTab);
}
} | class class_name[name] begin[{]
method[bindTabWithData, return_type[void], modifier[static], parameter[bottomNavigationItem, bottomNavigationTab, bottomNavigationBar]] begin[{]
local_variable[type[Context], context]
call[bottomNavigationTab.setLabel, parameter[call[bottomNavigationItem.getTitle, parameter[member[.context]]]]]
call[bottomNavigationTab.setIcon, parameter[call[bottomNavigationItem.getIcon, parameter[member[.context]]]]]
local_variable[type[int], activeColor]
local_variable[type[int], inActiveColor]
if[binary_operation[member[.activeColor], !=, member[Utils.NO_COLOR]]] begin[{]
call[bottomNavigationTab.setActiveColor, parameter[member[.activeColor]]]
else begin[{]
call[bottomNavigationTab.setActiveColor, parameter[call[bottomNavigationBar.getActiveColor, parameter[]]]]
end[}]
if[binary_operation[member[.inActiveColor], !=, member[Utils.NO_COLOR]]] begin[{]
call[bottomNavigationTab.setInactiveColor, parameter[member[.inActiveColor]]]
else begin[{]
call[bottomNavigationTab.setInactiveColor, parameter[call[bottomNavigationBar.getInActiveColor, parameter[]]]]
end[}]
if[call[bottomNavigationItem.isInActiveIconAvailable, parameter[]]] begin[{]
local_variable[type[Drawable], inactiveDrawable]
if[binary_operation[member[.inactiveDrawable], !=, literal[null]]] begin[{]
call[bottomNavigationTab.setInactiveIcon, parameter[member[.inactiveDrawable]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[bottomNavigationTab.setItemBackgroundColor, parameter[call[bottomNavigationBar.getBackgroundColor, parameter[]]]]
local_variable[type[BadgeItem], badgeItem]
if[binary_operation[member[.badgeItem], !=, literal[null]]] begin[{]
call[badgeItem.bindToBottomTab, parameter[member[.bottomNavigationTab]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[static] Keyword[void] identifier[bindTabWithData] operator[SEP] identifier[BottomNavigationItem] identifier[bottomNavigationItem] , identifier[BottomNavigationTab] identifier[bottomNavigationTab] , identifier[BottomNavigationBar] identifier[bottomNavigationBar] operator[SEP] {
identifier[Context] identifier[context] operator[=] identifier[bottomNavigationBar] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[bottomNavigationTab] operator[SEP] identifier[setLabel] operator[SEP] identifier[bottomNavigationItem] operator[SEP] identifier[getTitle] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] identifier[bottomNavigationTab] operator[SEP] identifier[setIcon] operator[SEP] identifier[bottomNavigationItem] operator[SEP] identifier[getIcon] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[activeColor] operator[=] identifier[bottomNavigationItem] operator[SEP] identifier[getActiveColor] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[int] identifier[inActiveColor] operator[=] identifier[bottomNavigationItem] operator[SEP] identifier[getInActiveColor] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[activeColor] operator[!=] identifier[Utils] operator[SEP] identifier[NO_COLOR] operator[SEP] {
identifier[bottomNavigationTab] operator[SEP] identifier[setActiveColor] operator[SEP] identifier[activeColor] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[bottomNavigationTab] operator[SEP] identifier[setActiveColor] operator[SEP] identifier[bottomNavigationBar] operator[SEP] identifier[getActiveColor] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[inActiveColor] operator[!=] identifier[Utils] operator[SEP] identifier[NO_COLOR] operator[SEP] {
identifier[bottomNavigationTab] operator[SEP] identifier[setInactiveColor] operator[SEP] identifier[inActiveColor] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[bottomNavigationTab] operator[SEP] identifier[setInactiveColor] operator[SEP] identifier[bottomNavigationBar] operator[SEP] identifier[getInActiveColor] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[bottomNavigationItem] operator[SEP] identifier[isInActiveIconAvailable] operator[SEP] operator[SEP] operator[SEP] {
identifier[Drawable] identifier[inactiveDrawable] operator[=] identifier[bottomNavigationItem] operator[SEP] identifier[getInactiveIcon] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inactiveDrawable] operator[!=] Other[null] operator[SEP] {
identifier[bottomNavigationTab] operator[SEP] identifier[setInactiveIcon] operator[SEP] identifier[inactiveDrawable] operator[SEP] operator[SEP]
}
}
identifier[bottomNavigationTab] operator[SEP] identifier[setItemBackgroundColor] operator[SEP] identifier[bottomNavigationBar] operator[SEP] identifier[getBackgroundColor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BadgeItem] identifier[badgeItem] operator[=] identifier[bottomNavigationItem] operator[SEP] identifier[getBadgeItem] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[badgeItem] operator[!=] Other[null] operator[SEP] {
identifier[badgeItem] operator[SEP] identifier[bindToBottomTab] operator[SEP] identifier[bottomNavigationTab] operator[SEP] operator[SEP]
}
}
|
protected void spatial(String field, Function<SpatialOptionsFactory, SpatialOptions> indexing) {
spatialOptionsStrings.put(field, indexing.apply(new SpatialOptionsFactory()));
} | class class_name[name] begin[{]
method[spatial, return_type[void], modifier[protected], parameter[field, indexing]] begin[{]
call[spatialOptionsStrings.put, parameter[member[.field], call[indexing.apply, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpatialOptionsFactory, sub_type=None))]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[spatial] operator[SEP] identifier[String] identifier[field] , identifier[Function] operator[<] identifier[SpatialOptionsFactory] , identifier[SpatialOptions] operator[>] identifier[indexing] operator[SEP] {
identifier[spatialOptionsStrings] operator[SEP] identifier[put] operator[SEP] identifier[field] , identifier[indexing] operator[SEP] identifier[apply] operator[SEP] Keyword[new] identifier[SpatialOptionsFactory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Segment enableMultithreading(boolean enable)
{
if (enable) config.threadNumber = Runtime.getRuntime().availableProcessors();
else config.threadNumber = 1;
return this;
} | class class_name[name] begin[{]
method[enableMultithreading, return_type[type[Segment]], modifier[public], parameter[enable]] begin[{]
if[member[.enable]] begin[{]
assign[member[config.threadNumber], call[Runtime.getRuntime, parameter[]]]
else begin[{]
assign[member[config.threadNumber], literal[1]]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Segment] identifier[enableMultithreading] operator[SEP] Keyword[boolean] identifier[enable] operator[SEP] {
Keyword[if] operator[SEP] identifier[enable] operator[SEP] identifier[config] operator[SEP] identifier[threadNumber] operator[=] identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[availableProcessors] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[config] operator[SEP] identifier[threadNumber] operator[=] Other[1] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static boolean equalsAny(final Object o1, final Object... o2s) {
if (o2s != null) {
for (final Object o2 : o2s) {
if (o1 == null) {
if (o2 == null) {
return true;
}
continue;
}
// o1 != null
if (o1.equals(o2)) {
return true;
}
}
} else {
return o1 == null;
}
return false;
} | class class_name[name] begin[{]
method[equalsAny, return_type[type[boolean]], modifier[public static], parameter[o1, o2s]] begin[{]
if[binary_operation[member[.o2s], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o1, 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=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=o1, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=o2s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o2)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
else begin[{]
return[binary_operation[member[.o1], ==, literal[null]]]
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[equalsAny] operator[SEP] Keyword[final] identifier[Object] identifier[o1] , Keyword[final] identifier[Object] operator[...] identifier[o2s] operator[SEP] {
Keyword[if] operator[SEP] identifier[o2s] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[Object] identifier[o2] operator[:] identifier[o2s] operator[SEP] {
Keyword[if] operator[SEP] identifier[o1] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[o2] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[o1] operator[SEP] identifier[equals] operator[SEP] identifier[o2] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
Keyword[else] {
Keyword[return] identifier[o1] operator[==] Other[null] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void set(Vector3d v1) {
x = v1.x;
y = v1.y;
z = v1.z;
} | class class_name[name] begin[{]
method[set, return_type[void], modifier[public], parameter[v1]] begin[{]
assign[member[.x], member[v1.x]]
assign[member[.y], member[v1.y]]
assign[member[.z], member[v1.z]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[Vector3d] identifier[v1] operator[SEP] {
identifier[x] operator[=] identifier[v1] operator[SEP] identifier[x] operator[SEP] identifier[y] operator[=] identifier[v1] operator[SEP] identifier[y] operator[SEP] identifier[z] operator[=] identifier[v1] operator[SEP] identifier[z] operator[SEP]
}
|
public static String getEntityName(EntityDataModel entityDataModel, Object entity) throws ODataEdmException {
// Get the entity type
EntityType entityType = getAndCheckEntityType(entityDataModel, entity.getClass());
// Check if the entity belongs to an Entity Set
String entityName = null;
for (EntitySet entitySet : entityDataModel.getEntityContainer().getEntitySets()) {
if (entitySet.getTypeName().equals(entityType.getFullyQualifiedName())) {
entityName = entitySet.getName();
break;
}
}
if (entityName == null) {
for (Singleton singleton : entityDataModel.getEntityContainer().getSingletons()) {
if (singleton.getTypeName().equals(entityType.getFullyQualifiedName())) {
entityName = singleton.getName();
break;
}
}
if (entityName == null) {
throw new ODataSystemException("Entity not found in the entity data model for type: "
+ entityType.getFullyQualifiedName());
}
}
return entityName;
} | class class_name[name] begin[{]
method[getEntityName, return_type[type[String]], modifier[public static], parameter[entityDataModel, entity]] begin[{]
local_variable[type[EntityType], entityType]
local_variable[type[String], entityName]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=entitySet, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=entityType, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entitySet, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getEntityContainer, postfix_operators=[], prefix_operators=[], qualifier=entityDataModel, selectors=[MethodInvocation(arguments=[], member=getEntitySets, 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=entitySet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EntitySet, sub_type=None))), label=None)
if[binary_operation[member[.entityName], ==, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=singleton, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=entityType, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=singleton, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getEntityContainer, postfix_operators=[], prefix_operators=[], qualifier=entityDataModel, selectors=[MethodInvocation(arguments=[], member=getSingletons, 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=singleton)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Singleton, sub_type=None))), label=None)
if[binary_operation[member[.entityName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity not found in the entity data model for type: "), operandr=MethodInvocation(arguments=[], member=getFullyQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=entityType, 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=ODataSystemException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.entityName]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getEntityName] operator[SEP] identifier[EntityDataModel] identifier[entityDataModel] , identifier[Object] identifier[entity] operator[SEP] Keyword[throws] identifier[ODataEdmException] {
identifier[EntityType] identifier[entityType] operator[=] identifier[getAndCheckEntityType] operator[SEP] identifier[entityDataModel] , identifier[entity] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[entityName] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[EntitySet] identifier[entitySet] operator[:] identifier[entityDataModel] operator[SEP] identifier[getEntityContainer] operator[SEP] operator[SEP] operator[SEP] identifier[getEntitySets] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[entitySet] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[entityType] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[entityName] operator[=] identifier[entitySet] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[entityName] operator[==] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Singleton] identifier[singleton] operator[:] identifier[entityDataModel] operator[SEP] identifier[getEntityContainer] operator[SEP] operator[SEP] operator[SEP] identifier[getSingletons] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[singleton] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[entityType] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[entityName] operator[=] identifier[singleton] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[entityName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ODataSystemException] operator[SEP] literal[String] operator[+] identifier[entityType] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[entityName] operator[SEP]
}
|
public final void mESC_SEQ() throws RecognitionException {
try {
// com/dyuproject/protostuff/parser/ProtoLexer.g:280:5: ( '\\\\' ( 'a' | 'v' | 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | '\\\\' ( 'x' | 'X' ) HEX_DIGIT HEX_DIGIT | UNICODE_ESC | OCTAL_ESC )
int alt18=4;
switch ( input.LA(1) ) {
case '\\':
{
switch ( input.LA(2) ) {
case '\"':
case '\'':
case '\\':
case 'a':
case 'b':
case 'f':
case 'n':
case 'r':
case 't':
case 'v':
{
alt18=1;
}
break;
case 'X':
case 'x':
{
alt18=2;
}
break;
case 'u':
{
alt18=3;
}
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
{
alt18=4;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 18, 1, input);
throw nvae;
}
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 18, 0, input);
throw nvae;
}
switch (alt18) {
case 1 :
// com/dyuproject/protostuff/parser/ProtoLexer.g:280:9: '\\\\' ( 'a' | 'v' | 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
{
match('\\');
if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||(input.LA(1)>='a' && input.LA(1)<='b')||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t'||input.LA(1)=='v' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
case 2 :
// com/dyuproject/protostuff/parser/ProtoLexer.g:281:9: '\\\\' ( 'x' | 'X' ) HEX_DIGIT HEX_DIGIT
{
match('\\');
if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
mHEX_DIGIT();
mHEX_DIGIT();
}
break;
case 3 :
// com/dyuproject/protostuff/parser/ProtoLexer.g:282:9: UNICODE_ESC
{
mUNICODE_ESC();
}
break;
case 4 :
// com/dyuproject/protostuff/parser/ProtoLexer.g:283:9: OCTAL_ESC
{
mOCTAL_ESC();
}
break;
}
}
finally {
}
} | class class_name[name] begin[{]
method[mESC_SEQ, return_type[void], modifier[final public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), name=alt18)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], statements=[BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\''), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='v')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt18, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='X'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='x')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt18, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='u')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt18, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='1'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='2'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='3'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='4'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='5'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='6'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='7')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt18, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=input, 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=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, 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=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"'), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\''), operator===), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\'), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), operator===), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n'), operator===), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r'), operator===), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t'), operator===), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='v'), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=input, 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=MismatchedSetException, sub_type=None)), name=mse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MismatchedSetException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=mse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=consume, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='X'), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='x'), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=input, 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=MismatchedSetException, sub_type=None)), name=mse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MismatchedSetException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=mse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=consume, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=mHEX_DIGIT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=mHEX_DIGIT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=mUNICODE_ESC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=mOCTAL_ESC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt18, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[mESC_SEQ] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
Keyword[int] identifier[alt18] operator[=] Other[4] operator[SEP] Keyword[switch] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] {
Keyword[case] literal[String] operator[:] {
Keyword[switch] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[2] operator[SEP] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] {
identifier[alt18] operator[=] Other[1] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] {
identifier[alt18] operator[=] Other[2] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] {
identifier[alt18] operator[=] Other[3] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] {
identifier[alt18] operator[=] Other[4] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[18] , Other[1] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[18] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt18] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[>=] literal[String] operator[&&] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[<=] literal[String] operator[SEP] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[input] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[MismatchedSetException] identifier[mse] operator[=] Keyword[new] identifier[MismatchedSetException] operator[SEP] Other[null] , identifier[input] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[mse] operator[SEP] operator[SEP] Keyword[throw] identifier[mse] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] {
identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[input] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[MismatchedSetException] identifier[mse] operator[=] Keyword[new] identifier[MismatchedSetException] operator[SEP] Other[null] , identifier[input] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[mse] operator[SEP] operator[SEP] Keyword[throw] identifier[mse] operator[SEP]
}
identifier[mHEX_DIGIT] operator[SEP] operator[SEP] operator[SEP] identifier[mHEX_DIGIT] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] {
identifier[mUNICODE_ESC] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] {
identifier[mOCTAL_ESC] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
}
Keyword[finally] {
}
}
|
public void setValue(ReloadableType rtype, Object instance, Object value, String name)
throws IllegalAccessException {
// System.err.println(">setValue(rtype=" + rtype + ",instance=" + instance + ",value=" + value + ",name=" + name + ")");
// Look up through our reloadable hierarchy to find it
FieldMember fieldmember = rtype.findInstanceField(name);
if (fieldmember == null) {
// If the field is null, there are two possible reasons:
// 1. The field does not exist in the hierarchy at all
// 2. The field is on a type just above our topmost reloadable type
FieldReaderWriter frw = rtype.locateField(name);
if (frw == null) {
// bad code redeployed?
log.info("Unexpectedly unable to locate instance field " + name + " starting from type "
+ rtype.dottedtypename
+ ": clinit running late?");
return;
}
frw.setValue(instance, value, this);
}
else {
if (fieldmember.isStatic()) {
throw new IncompatibleClassChangeError("Expected non-static field " + rtype.dottedtypename + "."
+ fieldmember.getName());
}
Map<String, Object> typeValues = values.get(fieldmember.getDeclaringTypeName());
if (typeValues == null) {
typeValues = new HashMap<String, Object>();
values.put(fieldmember.getDeclaringTypeName(), typeValues);
}
typeValues.put(name, value);
}
} | class class_name[name] begin[{]
method[setValue, return_type[void], modifier[public], parameter[rtype, instance, value, name]] begin[{]
local_variable[type[FieldMember], fieldmember]
if[binary_operation[member[.fieldmember], ==, literal[null]]] begin[{]
local_variable[type[FieldReaderWriter], frw]
if[binary_operation[member[.frw], ==, literal[null]]] begin[{]
call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Unexpectedly unable to locate instance field "], +, member[.name]], +, literal[" starting from type "]], +, member[rtype.dottedtypename]], +, literal[": clinit running late?"]]]]
return[None]
else begin[{]
None
end[}]
call[frw.setValue, parameter[member[.instance], member[.value], THIS[]]]
else begin[{]
if[call[fieldmember.isStatic, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected non-static field "), operandr=MemberReference(member=dottedtypename, postfix_operators=[], prefix_operators=[], qualifier=rtype, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=fieldmember, 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=IncompatibleClassChangeError, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Map], typeValues]
if[binary_operation[member[.typeValues], ==, literal[null]]] begin[{]
assign[member[.typeValues], 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=Object, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
call[values.put, parameter[call[fieldmember.getDeclaringTypeName, parameter[]], member[.typeValues]]]
else begin[{]
None
end[}]
call[typeValues.put, parameter[member[.name], member[.value]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setValue] operator[SEP] identifier[ReloadableType] identifier[rtype] , identifier[Object] identifier[instance] , identifier[Object] identifier[value] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[IllegalAccessException] {
identifier[FieldMember] identifier[fieldmember] operator[=] identifier[rtype] operator[SEP] identifier[findInstanceField] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldmember] operator[==] Other[null] operator[SEP] {
identifier[FieldReaderWriter] identifier[frw] operator[=] identifier[rtype] operator[SEP] identifier[locateField] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[frw] operator[==] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[rtype] operator[SEP] identifier[dottedtypename] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[frw] operator[SEP] identifier[setValue] operator[SEP] identifier[instance] , identifier[value] , Keyword[this] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[fieldmember] operator[SEP] identifier[isStatic] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IncompatibleClassChangeError] operator[SEP] literal[String] operator[+] identifier[rtype] operator[SEP] identifier[dottedtypename] operator[+] literal[String] operator[+] identifier[fieldmember] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[typeValues] operator[=] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[fieldmember] operator[SEP] identifier[getDeclaringTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeValues] operator[==] Other[null] operator[SEP] {
identifier[typeValues] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[put] operator[SEP] identifier[fieldmember] operator[SEP] identifier[getDeclaringTypeName] operator[SEP] operator[SEP] , identifier[typeValues] operator[SEP] operator[SEP]
}
identifier[typeValues] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
}
|
private static void sortAnonymous(List<IType> anonymous, IType anonType) {
SourceOffsetComparator sourceComparator = new SourceOffsetComparator();
final AnonymClassComparator classComparator = new AnonymClassComparator(anonType, sourceComparator);
Collections.sort(anonymous, classComparator);
// if (Reporter.DEBUG) {
// debugCompilePrio(classComparator);
// }
} | class class_name[name] begin[{]
method[sortAnonymous, return_type[void], modifier[private static], parameter[anonymous, anonType]] begin[{]
local_variable[type[SourceOffsetComparator], sourceComparator]
local_variable[type[AnonymClassComparator], classComparator]
call[Collections.sort, parameter[member[.anonymous], member[.classComparator]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[sortAnonymous] operator[SEP] identifier[List] operator[<] identifier[IType] operator[>] identifier[anonymous] , identifier[IType] identifier[anonType] operator[SEP] {
identifier[SourceOffsetComparator] identifier[sourceComparator] operator[=] Keyword[new] identifier[SourceOffsetComparator] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AnonymClassComparator] identifier[classComparator] operator[=] Keyword[new] identifier[AnonymClassComparator] operator[SEP] identifier[anonType] , identifier[sourceComparator] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[anonymous] , identifier[classComparator] operator[SEP] operator[SEP]
}
|
public ListComplianceSummariesResult withComplianceSummaryItems(ComplianceSummaryItem... complianceSummaryItems) {
if (this.complianceSummaryItems == null) {
setComplianceSummaryItems(new com.amazonaws.internal.SdkInternalList<ComplianceSummaryItem>(complianceSummaryItems.length));
}
for (ComplianceSummaryItem ele : complianceSummaryItems) {
this.complianceSummaryItems.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withComplianceSummaryItems, return_type[type[ListComplianceSummariesResult]], modifier[public], parameter[complianceSummaryItems]] begin[{]
if[binary_operation[THIS[member[None.complianceSummaryItems]], ==, literal[null]]] begin[{]
call[.setComplianceSummaryItems, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=complianceSummaryItems, 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=ComplianceSummaryItem, 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=complianceSummaryItems, 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=complianceSummaryItems, 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=ComplianceSummaryItem, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ListComplianceSummariesResult] identifier[withComplianceSummaryItems] operator[SEP] identifier[ComplianceSummaryItem] operator[...] identifier[complianceSummaryItems] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[complianceSummaryItems] operator[==] Other[null] operator[SEP] {
identifier[setComplianceSummaryItems] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ComplianceSummaryItem] operator[>] operator[SEP] identifier[complianceSummaryItems] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[ComplianceSummaryItem] identifier[ele] operator[:] identifier[complianceSummaryItems] operator[SEP] {
Keyword[this] operator[SEP] identifier[complianceSummaryItems] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public void write(OutputStream stream) throws IOException {
//Creating buffer
ByteArrayOutputStream bos = new ByteArrayOutputStream();
//Creating compressed output data stream
DeflaterOutputStream deflate = new DeflaterOutputStream(bos);
DataOutputStream dataStream = new DataOutputStream(deflate);
//Writing index step
dataStream.writeLong(step);
//Writing boundaries of index
dataStream.writeLong(getStartingRecordNumber());
dataStream.writeLong(getLastRecordNumber());
//Writing number of meta-records
dataStream.writeInt(metadata.size());
//Writing meta records
for (Map.Entry<String, String> e : metadata.entrySet()) {
dataStream.writeUTF(e.getKey());
dataStream.writeUTF(e.getValue());
}
//Writing number of entries
dataStream.writeInt(index.size());
//Writing index
long lastValue = 0, v;
for (int i = 0; i < index.size(); ++i) {
IOUtil.writeRawVarint64(dataStream, (v = index.get(i)) - lastValue);
lastValue = v;
}
//Flushing gzip output stream to underlying stream
deflate.finish();
//Creating raw output stream
DataOutputStream raw = new DataOutputStream(stream);
//Writing non-compressed magic number
raw.writeInt(MAGIC);
//Writing index size
raw.writeInt(bos.size());
//Writes index
raw.write(bos.toByteArray());
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[stream]] begin[{]
local_variable[type[ByteArrayOutputStream], bos]
local_variable[type[DeflaterOutputStream], deflate]
local_variable[type[DataOutputStream], dataStream]
call[dataStream.writeLong, parameter[member[.step]]]
call[dataStream.writeLong, parameter[call[.getStartingRecordNumber, parameter[]]]]
call[dataStream.writeLong, parameter[call[.getLastRecordNumber, parameter[]]]]
call[dataStream.writeInt, parameter[call[metadata.size, parameter[]]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=writeUTF, postfix_operators=[], prefix_operators=[], qualifier=dataStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=writeUTF, postfix_operators=[], prefix_operators=[], qualifier=dataStream, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
call[dataStream.writeInt, parameter[call[index.size, parameter[]]]]
local_variable[type[long], lastValue]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dataStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), operandr=MemberReference(member=lastValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=writeRawVarint64, postfix_operators=[], prefix_operators=[], qualifier=IOUtil, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=index, 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)
call[deflate.finish, parameter[]]
local_variable[type[DataOutputStream], raw]
call[raw.writeInt, parameter[member[.MAGIC]]]
call[raw.writeInt, parameter[call[bos.size, parameter[]]]]
call[raw.write, parameter[call[bos.toByteArray, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[OutputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ByteArrayOutputStream] identifier[bos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[DeflaterOutputStream] identifier[deflate] operator[=] Keyword[new] identifier[DeflaterOutputStream] operator[SEP] identifier[bos] operator[SEP] operator[SEP] identifier[DataOutputStream] identifier[dataStream] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[deflate] operator[SEP] operator[SEP] identifier[dataStream] operator[SEP] identifier[writeLong] operator[SEP] identifier[step] operator[SEP] operator[SEP] identifier[dataStream] operator[SEP] identifier[writeLong] operator[SEP] identifier[getStartingRecordNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dataStream] operator[SEP] identifier[writeLong] operator[SEP] identifier[getLastRecordNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dataStream] operator[SEP] identifier[writeInt] operator[SEP] identifier[metadata] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[e] operator[:] identifier[metadata] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[dataStream] operator[SEP] identifier[writeUTF] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dataStream] operator[SEP] identifier[writeUTF] operator[SEP] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[dataStream] operator[SEP] identifier[writeInt] operator[SEP] identifier[index] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[lastValue] operator[=] Other[0] , identifier[v] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[index] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[IOUtil] operator[SEP] identifier[writeRawVarint64] operator[SEP] identifier[dataStream] , operator[SEP] identifier[v] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[-] identifier[lastValue] operator[SEP] operator[SEP] identifier[lastValue] operator[=] identifier[v] operator[SEP]
}
identifier[deflate] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP] identifier[DataOutputStream] identifier[raw] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[stream] operator[SEP] operator[SEP] identifier[raw] operator[SEP] identifier[writeInt] operator[SEP] identifier[MAGIC] operator[SEP] operator[SEP] identifier[raw] operator[SEP] identifier[writeInt] operator[SEP] identifier[bos] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[raw] operator[SEP] identifier[write] operator[SEP] identifier[bos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected String isSingleAbstractMethod(Class<?> target) {
String methodName = null;
Method[] methods = target.getMethods();
for (int i = 0; i < methods.length; ++i) {
int modifiers = methods[i].getModifiers();
if (Modifier.isPublic(modifiers) && Modifier.isAbstract(modifiers)) {
if (methodName == null) {
methodName = methods[i].getName();
} else if (!methodName.equals(methods[i].getName())) {
return null;
}
}
}
return methodName;
} | class class_name[name] begin[{]
method[isSingleAbstractMethod, return_type[type[String]], modifier[protected], parameter[target]] begin[{]
local_variable[type[String], methodName]
local_variable[type[Method], methods]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getModifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=modifiers)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPublic, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAbstract, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=methodName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[member[.methodName]]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[isSingleAbstractMethod] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[target] operator[SEP] {
identifier[String] identifier[methodName] operator[=] Other[null] operator[SEP] identifier[Method] operator[SEP] operator[SEP] identifier[methods] operator[=] identifier[target] operator[SEP] identifier[getMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[methods] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[int] identifier[modifiers] operator[=] identifier[methods] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[modifiers] operator[SEP] operator[&&] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[methodName] operator[==] Other[null] operator[SEP] {
identifier[methodName] operator[=] identifier[methods] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[methodName] operator[SEP] identifier[equals] operator[SEP] identifier[methods] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
}
Keyword[return] identifier[methodName] operator[SEP]
}
|
@Override
public ArrayList<ThreadContext> taskStarting() throws RejectedExecutionException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
// EE Concurrency 3.3.4: All invocations to any of the proxied interface methods will fail with a
// java.lang.IllegalStateException exception if the application component is not started or deployed.
if (!"false".equalsIgnoreCase(execProps.get(WSContextService.REQUIRE_AVAILABLE_APP)) &&
metaDataIdentifier != null && threadContextMgr.metadataIdentifierService.getMetaData(metaDataIdentifier) == null) {
String taskName = execProps.get("javax.enterprise.concurrent.IDENTITY_NAME"); // ManagedTask.IDENTITY_NAME
notAvailable(metaDataIdentifier, taskName);
}
String defaultContextTypes = execProps.get(WSContextService.DEFAULT_CONTEXT);
final Set<String> providerNamesForDefaultContext =
WSContextService.UNCONFIGURED_CONTEXT_TYPES.equals(defaultContextTypes) || WSContextService.ALL_CONTEXT_TYPES.equals(defaultContextTypes)
? new HashSet<String>(threadContextMgr.threadContextProviders.keySet())
: Collections.<String> emptySet();
providerNamesForDefaultContext.removeAll(providerNamesToSkip);
LinkedHashMap<ThreadContextProvider, ThreadContext> contextAppliedToThread = new LinkedHashMap<ThreadContextProvider, ThreadContext>();
try {
// lazily obtaining services is a privileged operation
Map<ThreadContextProvider, ThreadContext> contextNotApplied = AccessController.doPrivileged(new PrivilegedAction<Map<ThreadContextProvider, ThreadContext>>() {
@Override
public Map<ThreadContextProvider, ThreadContext> run() {
Map<ThreadContextProvider, ThreadContext> contextNotApplied = new LinkedHashMap<ThreadContextProvider, ThreadContext>();
// First pass through configured context, and figure out what default context is needed
for (int i = 0; i < threadContext.size(); i++) {
String providerName = providerNames.get(i);
providerNamesForDefaultContext.remove(providerName);
contextNotApplied.put(threadContextMgr.threadContextProviders.getServiceWithException(providerName), threadContext.get(i));
}
// First pass through default context
for (String providerName : providerNamesForDefaultContext)
contextNotApplied.put(threadContextMgr.threadContextProviders.getServiceWithException(providerName), null);
return contextNotApplied;
}
});
// Make multiple passes through context that hasn't been applied until the size stops changing
for (int count = contextNotApplied.size(), prev = count + 1; count > 0 && count < prev; prev = count, count = contextNotApplied.size())
for (Iterator<Entry<ThreadContextProvider, ThreadContext>> it = contextNotApplied.entrySet().iterator(); it.hasNext();) {
Entry<ThreadContextProvider, ThreadContext> entry = it.next();
ThreadContextProvider provider = entry.getKey();
List<ThreadContextProvider> prereqs = provider.getPrerequisites();
if (prereqs == null || containsAll(contextAppliedToThread, prereqs)) {
ThreadContext context = entry.getValue();
context = context == null
? provider.createDefaultThreadContext(execProps)
: context.clone();
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "taskStarting " + toString(context));
context.taskStarting();
contextAppliedToThread.put(provider, context);
it.remove();
}
}
if (contextNotApplied.size() > 0)
throw new IllegalStateException(contextNotApplied.keySet().toString());
} catch (Throwable x) {
// In the event of failure, undo all context propagation up to this point.
ArrayList<ThreadContext> contextToRemove = new ArrayList<ThreadContext>(contextAppliedToThread.values());
for (int c = contextToRemove.size() - 1; c >= 0; c--)
try {
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "taskStopping " + toString(contextToRemove.get(c)));
contextToRemove.get(c).taskStopping();
} catch (Throwable stopX) {
}
if (x instanceof RejectedExecutionException)
throw (RejectedExecutionException) x;
if (x instanceof RuntimeException)
throw (RuntimeException) x;
if (x instanceof Error)
throw (Error) x;
throw new RejectedExecutionException(x);
}
return new ArrayList<ThreadContext>(contextAppliedToThread.values());
} | class class_name[name] begin[{]
method[taskStarting, return_type[type[ArrayList]], modifier[public], parameter[]] begin[{]
local_variable[type[boolean], trace]
if[binary_operation[binary_operation[literal["false"], &&, binary_operation[member[.metaDataIdentifier], !=, literal[null]]], &&, binary_operation[call[threadContextMgr.metadataIdentifierService.getMetaData, parameter[member[.metaDataIdentifier]]], ==, literal[null]]]] begin[{]
local_variable[type[String], taskName]
call[.notAvailable, parameter[member[.metaDataIdentifier], member[.taskName]]]
else begin[{]
None
end[}]
local_variable[type[String], defaultContextTypes]
local_variable[type[Set], providerNamesForDefaultContext]
call[providerNamesForDefaultContext.removeAll, parameter[member[.providerNamesToSkip]]]
local_variable[type[LinkedHashMap], contextAppliedToThread]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=None, name=LinkedHashMap, sub_type=None)), name=contextNotApplied)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=providerNames, selectors=[], type_arguments=None), name=providerName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=providerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=providerNamesForDefaultContext, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=providerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getServiceWithException, postfix_operators=[], prefix_operators=[], qualifier=threadContextMgr.threadContextProviders, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=threadContext, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=contextNotApplied, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=threadContext, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=providerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getServiceWithException, postfix_operators=[], prefix_operators=[], qualifier=threadContextMgr.threadContextProviders, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=put, postfix_operators=[], prefix_operators=[], qualifier=contextNotApplied, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=providerNamesForDefaultContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=providerName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), ReturnStatement(expression=MemberReference(member=contextNotApplied, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=[], name=Map, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=None, name=PrivilegedAction, sub_type=None))], member=doPrivileged, postfix_operators=[], prefix_operators=[], qualifier=AccessController, selectors=[], type_arguments=None), name=contextNotApplied)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=[], name=Entry, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=provider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPrerequisites, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None), name=prereqs)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prereqs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=contextAppliedToThread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prereqs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=context)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=execProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createDefaultThreadContext, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="taskStarting "), operandr=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=taskStarting, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=contextAppliedToThread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=contextNotApplied, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContextProvider, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=[], name=Entry, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=contextNotApplied, selectors=[], type_arguments=None), name=count), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=prev)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), Assignment(expressionl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=contextNotApplied, selectors=[], type_arguments=None))]), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=contextNotApplied, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=contextNotApplied, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None))], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=contextAppliedToThread, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=contextToRemove)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), ForStatement(body=TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="taskStopping "), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=contextToRemove, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=contextToRemove, selectors=[MethodInvocation(arguments=[], member=taskStopping, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=stopX, types=['Throwable']))], finally_block=None, label=None, resources=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=contextToRemove, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RejectedExecutionException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RejectedExecutionException, sub_type=None)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=x, 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=RejectedExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['Throwable']))], finally_block=None, label=None, resources=None)
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=contextAppliedToThread, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ThreadContext, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ArrayList] operator[<] identifier[ThreadContext] operator[>] identifier[taskStarting] operator[SEP] operator[SEP] Keyword[throws] identifier[RejectedExecutionException] {
Keyword[final] Keyword[boolean] identifier[trace] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[execProps] operator[SEP] identifier[get] operator[SEP] identifier[WSContextService] operator[SEP] identifier[REQUIRE_AVAILABLE_APP] operator[SEP] operator[SEP] operator[&&] identifier[metaDataIdentifier] operator[!=] Other[null] operator[&&] identifier[threadContextMgr] operator[SEP] identifier[metadataIdentifierService] operator[SEP] identifier[getMetaData] operator[SEP] identifier[metaDataIdentifier] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[String] identifier[taskName] operator[=] identifier[execProps] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[notAvailable] operator[SEP] identifier[metaDataIdentifier] , identifier[taskName] operator[SEP] operator[SEP]
}
identifier[String] identifier[defaultContextTypes] operator[=] identifier[execProps] operator[SEP] identifier[get] operator[SEP] identifier[WSContextService] operator[SEP] identifier[DEFAULT_CONTEXT] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[providerNamesForDefaultContext] operator[=] identifier[WSContextService] operator[SEP] identifier[UNCONFIGURED_CONTEXT_TYPES] operator[SEP] identifier[equals] operator[SEP] identifier[defaultContextTypes] operator[SEP] operator[||] identifier[WSContextService] operator[SEP] identifier[ALL_CONTEXT_TYPES] operator[SEP] identifier[equals] operator[SEP] identifier[defaultContextTypes] operator[SEP] operator[?] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] identifier[threadContextMgr] operator[SEP] identifier[threadContextProviders] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[Collections] operator[SEP] operator[<] identifier[String] operator[>] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP] identifier[providerNamesForDefaultContext] operator[SEP] identifier[removeAll] operator[SEP] identifier[providerNamesToSkip] operator[SEP] operator[SEP] identifier[LinkedHashMap] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] identifier[contextAppliedToThread] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Map] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] identifier[contextNotApplied] operator[=] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[Map] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] identifier[run] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] identifier[contextNotApplied] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[threadContext] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[providerName] operator[=] identifier[providerNames] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[providerNamesForDefaultContext] operator[SEP] identifier[remove] operator[SEP] identifier[providerName] operator[SEP] operator[SEP] identifier[contextNotApplied] operator[SEP] identifier[put] operator[SEP] identifier[threadContextMgr] operator[SEP] identifier[threadContextProviders] operator[SEP] identifier[getServiceWithException] operator[SEP] identifier[providerName] operator[SEP] , identifier[threadContext] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[providerName] operator[:] identifier[providerNamesForDefaultContext] operator[SEP] identifier[contextNotApplied] operator[SEP] identifier[put] operator[SEP] identifier[threadContextMgr] operator[SEP] identifier[threadContextProviders] operator[SEP] identifier[getServiceWithException] operator[SEP] identifier[providerName] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[contextNotApplied] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[count] operator[=] identifier[contextNotApplied] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[prev] operator[=] identifier[count] operator[+] Other[1] operator[SEP] identifier[count] operator[>] Other[0] operator[&&] identifier[count] operator[<] identifier[prev] operator[SEP] identifier[prev] operator[=] identifier[count] , identifier[count] operator[=] identifier[contextNotApplied] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Entry] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] operator[>] identifier[it] operator[=] identifier[contextNotApplied] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Entry] operator[<] identifier[ThreadContextProvider] , identifier[ThreadContext] operator[>] identifier[entry] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[ThreadContextProvider] identifier[provider] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ThreadContextProvider] operator[>] identifier[prereqs] operator[=] identifier[provider] operator[SEP] identifier[getPrerequisites] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prereqs] operator[==] Other[null] operator[||] identifier[containsAll] operator[SEP] identifier[contextAppliedToThread] , identifier[prereqs] operator[SEP] operator[SEP] {
identifier[ThreadContext] identifier[context] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[=] identifier[context] operator[==] Other[null] operator[?] identifier[provider] operator[SEP] identifier[createDefaultThreadContext] operator[SEP] identifier[execProps] operator[SEP] operator[:] identifier[context] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[toString] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[taskStarting] operator[SEP] operator[SEP] operator[SEP] identifier[contextAppliedToThread] operator[SEP] identifier[put] operator[SEP] identifier[provider] , identifier[context] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[contextNotApplied] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[contextNotApplied] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[x] operator[SEP] {
identifier[ArrayList] operator[<] identifier[ThreadContext] operator[>] identifier[contextToRemove] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ThreadContext] operator[>] operator[SEP] identifier[contextAppliedToThread] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] identifier[contextToRemove] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[c] operator[>=] Other[0] operator[SEP] identifier[c] operator[--] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[toString] operator[SEP] identifier[contextToRemove] operator[SEP] identifier[get] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[contextToRemove] operator[SEP] identifier[get] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[taskStopping] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[stopX] operator[SEP] {
}
Keyword[if] operator[SEP] identifier[x] Keyword[instanceof] identifier[RejectedExecutionException] operator[SEP] Keyword[throw] operator[SEP] identifier[RejectedExecutionException] operator[SEP] identifier[x] operator[SEP] Keyword[if] operator[SEP] identifier[x] Keyword[instanceof] identifier[RuntimeException] operator[SEP] Keyword[throw] operator[SEP] identifier[RuntimeException] operator[SEP] identifier[x] operator[SEP] Keyword[if] operator[SEP] identifier[x] Keyword[instanceof] identifier[Error] operator[SEP] Keyword[throw] operator[SEP] identifier[Error] operator[SEP] identifier[x] operator[SEP] Keyword[throw] Keyword[new] identifier[RejectedExecutionException] operator[SEP] identifier[x] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[ArrayList] operator[<] identifier[ThreadContext] operator[>] operator[SEP] identifier[contextAppliedToThread] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void copyThread(InputStream in, OutputStream out)
{
try{
instance().run(new Job(in,out));
}
catch(InterruptedException e)
{
log.warn(LogSupport.EXCEPTION,e);
}
} | class class_name[name] begin[{]
method[copyThread, return_type[void], modifier[public static], parameter[in, out]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=out, 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=Job, sub_type=None))], member=run, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EXCEPTION, postfix_operators=[], prefix_operators=[], qualifier=LogSupport, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[copyThread] operator[SEP] identifier[InputStream] identifier[in] , identifier[OutputStream] identifier[out] operator[SEP] {
Keyword[try] {
identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[run] operator[SEP] Keyword[new] identifier[Job] operator[SEP] identifier[in] , identifier[out] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[LogSupport] operator[SEP] identifier[EXCEPTION] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public Member getMember(String name) {
if (null == keyValStore) throw new RuntimeException("No key value store was found. You must first call Chain.setKeyValStore");
if (null == memberServices) throw new RuntimeException("No member services was found. You must first call Chain.setMemberServices or Chain.setMemberServicesUrl");
// Try to get the member state from the cache
Member member = (Member) members.get(name);
if (null != member) return member;
// Create the member and try to restore it's state from the key value store (if found).
member = new Member(name, this);
member.restoreState();
return member;
} | class class_name[name] begin[{]
method[getMember, return_type[type[Member]], modifier[public], parameter[name]] begin[{]
if[binary_operation[literal[null], ==, member[.keyValStore]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No key value store was found. You must first call Chain.setKeyValStore")], 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)
else begin[{]
None
end[}]
if[binary_operation[literal[null], ==, member[.memberServices]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No member services was found. You must first call Chain.setMemberServices or Chain.setMemberServicesUrl")], 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)
else begin[{]
None
end[}]
local_variable[type[Member], member]
if[binary_operation[literal[null], !=, member[.member]]] begin[{]
return[member[.member]]
else begin[{]
None
end[}]
assign[member[.member], ClassCreator(arguments=[MemberReference(member=name, 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=Member, sub_type=None))]
call[member.restoreState, parameter[]]
return[member[.member]]
end[}]
END[}] | Keyword[public] identifier[Member] identifier[getMember] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[keyValStore] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[memberServices] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Member] identifier[member] operator[=] operator[SEP] identifier[Member] operator[SEP] identifier[members] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[member] operator[SEP] Keyword[return] identifier[member] operator[SEP] identifier[member] operator[=] Keyword[new] identifier[Member] operator[SEP] identifier[name] , Keyword[this] operator[SEP] operator[SEP] identifier[member] operator[SEP] identifier[restoreState] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[member] operator[SEP]
}
|
protected void releaseConnection(Object conn)
{
clientFactory.releaseConnection(((Connection) conn).getPool(), ((Connection) conn).getClient());
} | class class_name[name] begin[{]
method[releaseConnection, return_type[void], modifier[protected], parameter[conn]] begin[{]
call[clientFactory.releaseConnection, parameter[Cast(expression=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None)), Cast(expression=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None))]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[releaseConnection] operator[SEP] identifier[Object] identifier[conn] operator[SEP] {
identifier[clientFactory] operator[SEP] identifier[releaseConnection] operator[SEP] operator[SEP] operator[SEP] identifier[Connection] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[getPool] operator[SEP] operator[SEP] , operator[SEP] operator[SEP] identifier[Connection] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[getClient] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public ClassGraph overrideClasspath(final Iterable<?> overrideClasspathElements) {
final String overrideClasspath = JarUtils.pathElementsToPathStr(overrideClasspathElements);
if (overrideClasspath.isEmpty()) {
throw new IllegalArgumentException("Can't override classpath with an empty path");
}
overrideClasspath(overrideClasspath);
return this;
} | class class_name[name] begin[{]
method[overrideClasspath, return_type[type[ClassGraph]], modifier[public], parameter[overrideClasspathElements]] begin[{]
local_variable[type[String], overrideClasspath]
if[call[overrideClasspath.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't override classpath with an empty path")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.overrideClasspath, parameter[member[.overrideClasspath]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ClassGraph] identifier[overrideClasspath] operator[SEP] Keyword[final] identifier[Iterable] operator[<] operator[?] operator[>] identifier[overrideClasspathElements] operator[SEP] {
Keyword[final] identifier[String] identifier[overrideClasspath] operator[=] identifier[JarUtils] operator[SEP] identifier[pathElementsToPathStr] operator[SEP] identifier[overrideClasspathElements] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[overrideClasspath] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[overrideClasspath] operator[SEP] identifier[overrideClasspath] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public static <T extends Number & Comparable> T median(Collection<T> values) {
if (values.isEmpty())
throw new IllegalArgumentException(
"No median in an empty collection");
List<T> sorted = new ArrayList<T>(values);
Collections.sort(sorted);
return sorted.get(sorted.size() / 2);
} | class class_name[name] begin[{]
method[median, return_type[type[T]], modifier[public static], parameter[values]] begin[{]
if[call[values.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No median in an empty collection")], 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[List], sorted]
call[Collections.sort, parameter[member[.sorted]]]
return[call[sorted.get, parameter[binary_operation[call[sorted.size, parameter[]], /, literal[2]]]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Number] operator[&] identifier[Comparable] operator[>] identifier[T] identifier[median] operator[SEP] identifier[Collection] operator[<] identifier[T] operator[>] identifier[values] operator[SEP] {
Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[sorted] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[sorted] operator[SEP] operator[SEP] Keyword[return] identifier[sorted] operator[SEP] identifier[get] operator[SEP] identifier[sorted] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[SEP] operator[SEP]
}
|
public <T extends JobProperty> T getProperty(Class<T> clazz) {
if (clazz == BuildDiscarderProperty.class && logRotator != null) {
return clazz.cast(new BuildDiscarderProperty(logRotator));
}
return _getProperty(clazz);
} | class class_name[name] begin[{]
method[getProperty, return_type[type[T]], modifier[public], parameter[clazz]] begin[{]
if[binary_operation[binary_operation[member[.clazz], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BuildDiscarderProperty, sub_type=None))], &&, binary_operation[member[.logRotator], !=, literal[null]]]] begin[{]
return[call[clazz.cast, parameter[ClassCreator(arguments=[MemberReference(member=logRotator, 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=BuildDiscarderProperty, sub_type=None))]]]
else begin[{]
None
end[}]
return[call[._getProperty, parameter[member[.clazz]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[JobProperty] operator[>] identifier[T] identifier[getProperty] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] {
Keyword[if] operator[SEP] identifier[clazz] operator[==] identifier[BuildDiscarderProperty] operator[SEP] Keyword[class] operator[&&] identifier[logRotator] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[clazz] operator[SEP] identifier[cast] operator[SEP] Keyword[new] identifier[BuildDiscarderProperty] operator[SEP] identifier[logRotator] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[_getProperty] operator[SEP] identifier[clazz] operator[SEP] operator[SEP]
}
|
public boolean retainIndex(Collection<FeatureIndexType> types) {
Set<FeatureIndexType> delete = new HashSet<>(indexLocationQueryOrder);
delete.removeAll(types);
return deleteIndex(delete);
} | class class_name[name] begin[{]
method[retainIndex, return_type[type[boolean]], modifier[public], parameter[types]] begin[{]
local_variable[type[Set], delete]
call[delete.removeAll, parameter[member[.types]]]
return[call[.deleteIndex, parameter[member[.delete]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[retainIndex] operator[SEP] identifier[Collection] operator[<] identifier[FeatureIndexType] operator[>] identifier[types] operator[SEP] {
identifier[Set] operator[<] identifier[FeatureIndexType] operator[>] identifier[delete] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[indexLocationQueryOrder] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[removeAll] operator[SEP] identifier[types] operator[SEP] operator[SEP] Keyword[return] identifier[deleteIndex] operator[SEP] identifier[delete] operator[SEP] operator[SEP]
}
|
private static void addClassConstantMethod(ClassVisitor cv) // RTC111522
{
// -----------------------------------------------------------------------
// static synthetic Class class$(String className)
// {
// try
// {
// return Class.forName( className );
// }
// catch ( ClassNotFoundException cnfex )
// {
// throw new NoClassDefFoundError(cnfex.getMessage());
// }
// }
// -----------------------------------------------------------------------
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, INDENT + "adding method : class$ (Ljava/lang/String;)Ljava/lang/Class;");
MethodVisitor mv;
mv = cv.visitMethod(ACC_STATIC + ACC_SYNTHETIC, "class$",
"(Ljava/lang/String;)Ljava/lang/Class;", null, null);
mv.visitCode();
Label try_begin = new Label();
mv.visitLabel(try_begin);
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESTATIC, "java/lang/Class", "forName",
"(Ljava/lang/String;)Ljava/lang/Class;");
mv.visitInsn(ARETURN);
Label try_end = new Label();
mv.visitLabel(try_end);
mv.visitVarInsn(ASTORE, 1);
mv.visitTypeInsn(NEW, "java/lang/NoClassDefFoundError");
mv.visitInsn(DUP);
mv.visitVarInsn(ALOAD, 1);
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Throwable", "getMessage",
"()Ljava/lang/String;");
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/NoClassDefFoundError",
"<init>", "(Ljava/lang/String;)V");
mv.visitInsn(ATHROW);
mv.visitTryCatchBlock(try_begin, try_end, try_end, "java/lang/ClassNotFoundException");
mv.visitMaxs(3, 2);
mv.visitEnd();
} | class class_name[name] begin[{]
method[addClassConstantMethod, return_type[void], modifier[private static], parameter[cv]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[member[.INDENT], +, literal["adding method : class$ (Ljava/lang/String;)Ljava/lang/Class;"]]]]
else begin[{]
None
end[}]
local_variable[type[MethodVisitor], mv]
assign[member[.mv], call[cv.visitMethod, parameter[binary_operation[member[.ACC_STATIC], +, member[.ACC_SYNTHETIC]], literal["class$"], literal["(Ljava/lang/String;)Ljava/lang/Class;"], literal[null], literal[null]]]]
call[mv.visitCode, parameter[]]
local_variable[type[Label], try_begin]
call[mv.visitLabel, parameter[member[.try_begin]]]
call[mv.visitVarInsn, parameter[member[.ALOAD], literal[0]]]
call[mv.visitMethodInsn, parameter[member[.INVOKESTATIC], literal["java/lang/Class"], literal["forName"], literal["(Ljava/lang/String;)Ljava/lang/Class;"]]]
call[mv.visitInsn, parameter[member[.ARETURN]]]
local_variable[type[Label], try_end]
call[mv.visitLabel, parameter[member[.try_end]]]
call[mv.visitVarInsn, parameter[member[.ASTORE], literal[1]]]
call[mv.visitTypeInsn, parameter[member[.NEW], literal["java/lang/NoClassDefFoundError"]]]
call[mv.visitInsn, parameter[member[.DUP]]]
call[mv.visitVarInsn, parameter[member[.ALOAD], literal[1]]]
call[mv.visitMethodInsn, parameter[member[.INVOKEVIRTUAL], literal["java/lang/Throwable"], literal["getMessage"], literal["()Ljava/lang/String;"]]]
call[mv.visitMethodInsn, parameter[member[.INVOKESPECIAL], literal["java/lang/NoClassDefFoundError"], literal["<init>"], literal["(Ljava/lang/String;)V"]]]
call[mv.visitInsn, parameter[member[.ATHROW]]]
call[mv.visitTryCatchBlock, parameter[member[.try_begin], member[.try_end], member[.try_end], literal["java/lang/ClassNotFoundException"]]]
call[mv.visitMaxs, parameter[literal[3], literal[2]]]
call[mv.visitEnd, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[addClassConstantMethod] operator[SEP] identifier[ClassVisitor] identifier[cv] 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] , identifier[INDENT] operator[+] literal[String] operator[SEP] operator[SEP] identifier[MethodVisitor] identifier[mv] operator[SEP] identifier[mv] operator[=] identifier[cv] operator[SEP] identifier[visitMethod] operator[SEP] identifier[ACC_STATIC] operator[+] identifier[ACC_SYNTHETIC] , literal[String] , literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitCode] operator[SEP] operator[SEP] operator[SEP] identifier[Label] identifier[try_begin] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitLabel] operator[SEP] identifier[try_begin] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitVarInsn] operator[SEP] identifier[ALOAD] , Other[0] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitMethodInsn] operator[SEP] identifier[INVOKESTATIC] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitInsn] operator[SEP] identifier[ARETURN] operator[SEP] operator[SEP] identifier[Label] identifier[try_end] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitLabel] operator[SEP] identifier[try_end] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitVarInsn] operator[SEP] identifier[ASTORE] , Other[1] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitTypeInsn] operator[SEP] identifier[NEW] , literal[String] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitInsn] operator[SEP] identifier[DUP] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitVarInsn] operator[SEP] identifier[ALOAD] , Other[1] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitMethodInsn] operator[SEP] identifier[INVOKEVIRTUAL] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitMethodInsn] operator[SEP] identifier[INVOKESPECIAL] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitInsn] operator[SEP] identifier[ATHROW] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitTryCatchBlock] operator[SEP] identifier[try_begin] , identifier[try_end] , identifier[try_end] , literal[String] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitMaxs] operator[SEP] Other[3] , Other[2] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitEnd] operator[SEP] operator[SEP] operator[SEP]
}
|
public static long copySome(final InputStream input,
final OutputStream output,
final long length)
throws IOException {
return copySome(input, output, DEFAULT_BUFFER_SIZE, length);
} | class class_name[name] begin[{]
method[copySome, return_type[type[long]], modifier[public static], parameter[input, output, length]] begin[{]
return[call[.copySome, parameter[member[.input], member[.output], member[.DEFAULT_BUFFER_SIZE], member[.length]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[long] identifier[copySome] operator[SEP] Keyword[final] identifier[InputStream] identifier[input] , Keyword[final] identifier[OutputStream] identifier[output] , Keyword[final] Keyword[long] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[copySome] operator[SEP] identifier[input] , identifier[output] , identifier[DEFAULT_BUFFER_SIZE] , identifier[length] operator[SEP] operator[SEP]
}
|
private void init() {
host = DEFAULT_HOST;
port = DEFAULT_PORT;
database = DEFAULT_DATABASE;
user = DEFAULT_USER;
password = DEFAULT_PASSWORD;
cachePreparedStatements = DEFAULT_CACHE_PREPARED_STATEMENTS;
pipeliningLimit = DEFAULT_PIPELINING_LIMIT;
sslMode = DEFAULT_SSLMODE;
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.host], member[.DEFAULT_HOST]]
assign[member[.port], member[.DEFAULT_PORT]]
assign[member[.database], member[.DEFAULT_DATABASE]]
assign[member[.user], member[.DEFAULT_USER]]
assign[member[.password], member[.DEFAULT_PASSWORD]]
assign[member[.cachePreparedStatements], member[.DEFAULT_CACHE_PREPARED_STATEMENTS]]
assign[member[.pipeliningLimit], member[.DEFAULT_PIPELINING_LIMIT]]
assign[member[.sslMode], member[.DEFAULT_SSLMODE]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[init] operator[SEP] operator[SEP] {
identifier[host] operator[=] identifier[DEFAULT_HOST] operator[SEP] identifier[port] operator[=] identifier[DEFAULT_PORT] operator[SEP] identifier[database] operator[=] identifier[DEFAULT_DATABASE] operator[SEP] identifier[user] operator[=] identifier[DEFAULT_USER] operator[SEP] identifier[password] operator[=] identifier[DEFAULT_PASSWORD] operator[SEP] identifier[cachePreparedStatements] operator[=] identifier[DEFAULT_CACHE_PREPARED_STATEMENTS] operator[SEP] identifier[pipeliningLimit] operator[=] identifier[DEFAULT_PIPELINING_LIMIT] operator[SEP] identifier[sslMode] operator[=] identifier[DEFAULT_SSLMODE] operator[SEP]
}
|
@Override
public final PArray getArray(final String key) {
PArray result = optArray(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return result;
} | class class_name[name] begin[{]
method[getArray, return_type[type[PArray]], modifier[final public], parameter[key]] begin[{]
local_variable[type[PArray], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=key, 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=ObjectMissingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[PArray] identifier[getArray] operator[SEP] Keyword[final] identifier[String] identifier[key] operator[SEP] {
identifier[PArray] identifier[result] operator[=] identifier[optArray] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ObjectMissingException] operator[SEP] Keyword[this] , identifier[key] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void persist(Object e)
{
if (e == null)
{
throw new IllegalArgumentException(
"Entity object is invalid, operation failed. Please check previous log message for details");
}
// Create an object graph of the entity object.
ObjectGraph graph = new GraphGenerator().generateGraph(e, this);
// Call persist on each node in object graph.
Node node = graph.getHeadNode();
try
{
// Get write lock before writing object required for transaction.
lock.writeLock().lock();
node.setPersistenceDelegator(this);
node.persist();
// build flush stack.
flushManager.buildFlushStack(node, com.impetus.kundera.persistence.context.EventLog.EventType.INSERT);
// Flushing data.
flush();
// Add node to persistence context after successful flush.
getPersistenceCache().getMainCache().addHeadNode(node);
}
finally
{
lock.writeLock().unlock();
}
// Unlocking object.
graph.clear();
graph = null;
if (log.isDebugEnabled())
{
log.debug("Data persisted successfully for entity {}.", e.getClass());
}
} | class class_name[name] begin[{]
method[persist, return_type[void], modifier[public], parameter[e]] begin[{]
if[binary_operation[member[.e], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity object is invalid, operation failed. Please check previous log message for details")], 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[ObjectGraph], graph]
local_variable[type[Node], node]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[MethodInvocation(arguments=[], member=lock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=setPersistenceDelegator, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=persist, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=INSERT, postfix_operators=[], prefix_operators=[], qualifier=com.impetus.kundera.persistence.context.EventLog.EventType, selectors=[])], member=buildFlushStack, postfix_operators=[], prefix_operators=[], qualifier=flushManager, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getPersistenceCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getMainCache, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeadNode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)
call[graph.clear, parameter[]]
assign[member[.graph], literal[null]]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[literal["Data persisted successfully for entity {}."], call[e.getClass, parameter[]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[persist] operator[SEP] identifier[Object] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[e] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[ObjectGraph] identifier[graph] operator[=] Keyword[new] identifier[GraphGenerator] operator[SEP] operator[SEP] operator[SEP] identifier[generateGraph] operator[SEP] identifier[e] , Keyword[this] operator[SEP] operator[SEP] identifier[Node] identifier[node] operator[=] identifier[graph] operator[SEP] identifier[getHeadNode] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[setPersistenceDelegator] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[persist] operator[SEP] operator[SEP] operator[SEP] identifier[flushManager] operator[SEP] identifier[buildFlushStack] operator[SEP] identifier[node] , identifier[com] operator[SEP] identifier[impetus] operator[SEP] identifier[kundera] operator[SEP] identifier[persistence] operator[SEP] identifier[context] operator[SEP] identifier[EventLog] operator[SEP] identifier[EventType] operator[SEP] identifier[INSERT] operator[SEP] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[getPersistenceCache] operator[SEP] operator[SEP] operator[SEP] identifier[getMainCache] operator[SEP] operator[SEP] operator[SEP] identifier[addHeadNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
identifier[graph] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[graph] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static void showHelp(String helpindex) {
if (getHelpBroker() == null) {
return;
}
try {
getHelpBroker().showID(helpindex, "javax.help.SecondaryWindow", null);
} catch (Exception e) {
logger.error("error loading help with index: " + helpindex, e);
}
} | class class_name[name] begin[{]
method[showHelp, return_type[void], modifier[public static], parameter[helpindex]] begin[{]
if[binary_operation[call[.getHelpBroker, parameter[]], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getHelpBroker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=helpindex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="javax.help.SecondaryWindow"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=showID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error loading help with index: "), operandr=MemberReference(member=helpindex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[showHelp] operator[SEP] identifier[String] identifier[helpindex] operator[SEP] {
Keyword[if] operator[SEP] identifier[getHelpBroker] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[try] {
identifier[getHelpBroker] operator[SEP] operator[SEP] operator[SEP] identifier[showID] operator[SEP] identifier[helpindex] , literal[String] , Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[helpindex] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
protected void startUp() {
try {
startRTS();
} catch (Exception e) {
throw new IllegalArgumentException("Cannot initiate RTS. Missing or bad arguments");
}
try {
startHFTA();
} catch (Exception e) {
throw new IllegalArgumentException("Cannot initiate HFTA processes. Missing or bad arguments");
}
try {
startGSEXIT();
} catch (Exception e) {
throw new IllegalArgumentException("Cannot initiate GSEXIT processes. Missing or bad arguments");
}
} | class class_name[name] begin[{]
method[startUp, return_type[void], modifier[protected], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=startRTS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot initiate RTS. Missing or bad arguments")], 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, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=startHFTA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot initiate HFTA processes. Missing or bad arguments")], 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, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=startGSEXIT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot initiate GSEXIT processes. Missing or bad arguments")], 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, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[startUp] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[startRTS] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[startHFTA] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[startGSEXIT] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public static Tag outcome(ContainerResponse response) {
if (response != null) {
int status = response.getStatus();
switch (Response.Status.Family.familyOf(status)) {
case INFORMATIONAL:
return OUTCOME_INFORMATIONAL;
case SUCCESSFUL:
return OUTCOME_SUCCESS;
case REDIRECTION:
return OUTCOME_REDIRECTION;
case CLIENT_ERROR:
return OUTCOME_CLIENT_ERROR;
case SERVER_ERROR:
return OUTCOME_SERVER_ERROR;
default:
return OUTCOME_UNKNOWN;
}
}
/* In case there is no response we are dealing with an unmapped exception. */
return OUTCOME_SERVER_ERROR;
} | class class_name[name] begin[{]
method[outcome, return_type[type[Tag]], modifier[public static], parameter[response]] begin[{]
if[binary_operation[member[.response], !=, literal[null]]] begin[{]
local_variable[type[int], status]
SwitchStatement(cases=[SwitchStatementCase(case=['INFORMATIONAL'], statements=[ReturnStatement(expression=MemberReference(member=OUTCOME_INFORMATIONAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['SUCCESSFUL'], statements=[ReturnStatement(expression=MemberReference(member=OUTCOME_SUCCESS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['REDIRECTION'], statements=[ReturnStatement(expression=MemberReference(member=OUTCOME_REDIRECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['CLIENT_ERROR'], statements=[ReturnStatement(expression=MemberReference(member=OUTCOME_CLIENT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['SERVER_ERROR'], statements=[ReturnStatement(expression=MemberReference(member=OUTCOME_SERVER_ERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MemberReference(member=OUTCOME_UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=familyOf, postfix_operators=[], prefix_operators=[], qualifier=Response.Status.Family, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
return[member[.OUTCOME_SERVER_ERROR]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Tag] identifier[outcome] operator[SEP] identifier[ContainerResponse] identifier[response] operator[SEP] {
Keyword[if] operator[SEP] identifier[response] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[status] operator[=] identifier[response] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[Family] operator[SEP] identifier[familyOf] operator[SEP] identifier[status] operator[SEP] operator[SEP] {
Keyword[case] identifier[INFORMATIONAL] operator[:] Keyword[return] identifier[OUTCOME_INFORMATIONAL] operator[SEP] Keyword[case] identifier[SUCCESSFUL] operator[:] Keyword[return] identifier[OUTCOME_SUCCESS] operator[SEP] Keyword[case] identifier[REDIRECTION] operator[:] Keyword[return] identifier[OUTCOME_REDIRECTION] operator[SEP] Keyword[case] identifier[CLIENT_ERROR] operator[:] Keyword[return] identifier[OUTCOME_CLIENT_ERROR] operator[SEP] Keyword[case] identifier[SERVER_ERROR] operator[:] Keyword[return] identifier[OUTCOME_SERVER_ERROR] operator[SEP] Keyword[default] operator[:] Keyword[return] identifier[OUTCOME_UNKNOWN] operator[SEP]
}
}
Keyword[return] identifier[OUTCOME_SERVER_ERROR] operator[SEP]
}
|
private View inflateDividerView(@Nullable final ViewGroup parent,
@NonNull final Divider divider, final int position) {
LayoutInflater layoutInflater = LayoutInflater.from(context);
View view = layoutInflater.inflate(R.layout.divider, parent, false);
DividerViewHolder viewHolder = new DividerViewHolder();
viewHolder.leftDivider = view.findViewById(R.id.left_divider);
viewHolder.rightDivider = view.findViewById(R.id.right_divider);
viewHolder.titleTextView = view.findViewById(android.R.id.title);
view.setTag(viewHolder);
if (!TextUtils.isEmpty(divider.getTitle()) || (position % columnCount > 0 && !TextUtils
.isEmpty(getRawItems().get(position - (position % columnCount)).getTitle()))) {
view.getLayoutParams().height = context.getResources()
.getDimensionPixelSize(R.dimen.bottom_sheet_divider_title_height);
}
return view;
} | class class_name[name] begin[{]
method[inflateDividerView, return_type[type[View]], modifier[private], parameter[parent, divider, position]] begin[{]
local_variable[type[LayoutInflater], layoutInflater]
local_variable[type[View], view]
local_variable[type[DividerViewHolder], viewHolder]
assign[member[viewHolder.leftDivider], call[view.findViewById, parameter[member[R.id.left_divider]]]]
assign[member[viewHolder.rightDivider], call[view.findViewById, parameter[member[R.id.right_divider]]]]
assign[member[viewHolder.titleTextView], call[view.findViewById, parameter[member[android.R.id.title]]]]
call[view.setTag, parameter[member[.viewHolder]]]
if[binary_operation[call[TextUtils.isEmpty, parameter[call[divider.getTitle, parameter[]]]], ||, binary_operation[binary_operation[binary_operation[member[.position], %, member[.columnCount]], >, literal[0]], &&, call[TextUtils.isEmpty, parameter[call[.getRawItems, parameter[]]]]]]] begin[{]
assign[call[view.getLayoutParams, parameter[]], call[context.getResources, parameter[]]]
else begin[{]
None
end[}]
return[member[.view]]
end[}]
END[}] | Keyword[private] identifier[View] identifier[inflateDividerView] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[ViewGroup] identifier[parent] , annotation[@] identifier[NonNull] Keyword[final] identifier[Divider] identifier[divider] , Keyword[final] Keyword[int] identifier[position] operator[SEP] {
identifier[LayoutInflater] identifier[layoutInflater] operator[=] identifier[LayoutInflater] operator[SEP] identifier[from] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[View] identifier[view] operator[=] identifier[layoutInflater] operator[SEP] identifier[inflate] operator[SEP] identifier[R] operator[SEP] identifier[layout] operator[SEP] identifier[divider] , identifier[parent] , literal[boolean] operator[SEP] operator[SEP] identifier[DividerViewHolder] identifier[viewHolder] operator[=] Keyword[new] identifier[DividerViewHolder] operator[SEP] operator[SEP] operator[SEP] identifier[viewHolder] operator[SEP] identifier[leftDivider] operator[=] identifier[view] operator[SEP] identifier[findViewById] operator[SEP] identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[left_divider] operator[SEP] operator[SEP] identifier[viewHolder] operator[SEP] identifier[rightDivider] operator[=] identifier[view] operator[SEP] identifier[findViewById] operator[SEP] identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[right_divider] operator[SEP] operator[SEP] identifier[viewHolder] operator[SEP] identifier[titleTextView] operator[=] identifier[view] operator[SEP] identifier[findViewById] operator[SEP] identifier[android] operator[SEP] identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[title] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[setTag] operator[SEP] identifier[viewHolder] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[divider] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[position] operator[%] identifier[columnCount] operator[>] Other[0] operator[&&] operator[!] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[getRawItems] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[position] operator[-] operator[SEP] identifier[position] operator[%] identifier[columnCount] operator[SEP] operator[SEP] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[view] operator[SEP] identifier[getLayoutParams] operator[SEP] operator[SEP] operator[SEP] identifier[height] operator[=] identifier[context] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[bottom_sheet_divider_title_height] operator[SEP] operator[SEP]
}
Keyword[return] identifier[view] operator[SEP]
}
|
public static String getEncodingFromLanguage(String lang)
{
if (lang.startsWith(LANG_EN))
{ //English
return ENC_ENGLISH;
}
else if (lang.equals(LANG_JAPAN1) || lang.equals(LANG_JAPAN2))
{ //Japanese
return ENC_JAPAN;
}
else if (lang.equals(LANG_CHINESE_T))
{ //T-Chinese
return ENC_CHINESE_T;
}
else if (lang.equals(LANG_KOREA))
{ //Korea
return ENC_KOREA;
}
else if (lang.equals(LANG_CHINESE_S) || lang.equals(LANG_CHINESE))
{ //S-Chinese
return ENC_CHINESE_S;
}
else
{
return ENC_ENGLISH;
}
} | class class_name[name] begin[{]
method[getEncodingFromLanguage, return_type[type[String]], modifier[public static], parameter[lang]] begin[{]
if[call[lang.startsWith, parameter[member[.LANG_EN]]]] begin[{]
return[member[.ENC_ENGLISH]]
else begin[{]
if[binary_operation[call[lang.equals, parameter[member[.LANG_JAPAN1]]], ||, call[lang.equals, parameter[member[.LANG_JAPAN2]]]]] begin[{]
return[member[.ENC_JAPAN]]
else begin[{]
if[call[lang.equals, parameter[member[.LANG_CHINESE_T]]]] begin[{]
return[member[.ENC_CHINESE_T]]
else begin[{]
if[call[lang.equals, parameter[member[.LANG_KOREA]]]] begin[{]
return[member[.ENC_KOREA]]
else begin[{]
if[binary_operation[call[lang.equals, parameter[member[.LANG_CHINESE_S]]], ||, call[lang.equals, parameter[member[.LANG_CHINESE]]]]] begin[{]
return[member[.ENC_CHINESE_S]]
else begin[{]
return[member[.ENC_ENGLISH]]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getEncodingFromLanguage] operator[SEP] identifier[String] identifier[lang] operator[SEP] {
Keyword[if] operator[SEP] identifier[lang] operator[SEP] identifier[startsWith] operator[SEP] identifier[LANG_EN] operator[SEP] operator[SEP] {
Keyword[return] identifier[ENC_ENGLISH] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[lang] operator[SEP] identifier[equals] operator[SEP] identifier[LANG_JAPAN1] operator[SEP] operator[||] identifier[lang] operator[SEP] identifier[equals] operator[SEP] identifier[LANG_JAPAN2] operator[SEP] operator[SEP] {
Keyword[return] identifier[ENC_JAPAN] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[lang] operator[SEP] identifier[equals] operator[SEP] identifier[LANG_CHINESE_T] operator[SEP] operator[SEP] {
Keyword[return] identifier[ENC_CHINESE_T] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[lang] operator[SEP] identifier[equals] operator[SEP] identifier[LANG_KOREA] operator[SEP] operator[SEP] {
Keyword[return] identifier[ENC_KOREA] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[lang] operator[SEP] identifier[equals] operator[SEP] identifier[LANG_CHINESE_S] operator[SEP] operator[||] identifier[lang] operator[SEP] identifier[equals] operator[SEP] identifier[LANG_CHINESE] operator[SEP] operator[SEP] {
Keyword[return] identifier[ENC_CHINESE_S] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[ENC_ENGLISH] operator[SEP]
}
}
|
public static MessageDto notifyUnitFailResponse(Serializable message, String action) {
MessageDto messageDto = new MessageDto();
messageDto.setState(MessageConstants.STATE_EXCEPTION);
messageDto.setAction(action);
messageDto.setData(message);
return messageDto;
} | class class_name[name] begin[{]
method[notifyUnitFailResponse, return_type[type[MessageDto]], modifier[public static], parameter[message, action]] begin[{]
local_variable[type[MessageDto], messageDto]
call[messageDto.setState, parameter[member[MessageConstants.STATE_EXCEPTION]]]
call[messageDto.setAction, parameter[member[.action]]]
call[messageDto.setData, parameter[member[.message]]]
return[member[.messageDto]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[MessageDto] identifier[notifyUnitFailResponse] operator[SEP] identifier[Serializable] identifier[message] , identifier[String] identifier[action] operator[SEP] {
identifier[MessageDto] identifier[messageDto] operator[=] Keyword[new] identifier[MessageDto] operator[SEP] operator[SEP] operator[SEP] identifier[messageDto] operator[SEP] identifier[setState] operator[SEP] identifier[MessageConstants] operator[SEP] identifier[STATE_EXCEPTION] operator[SEP] operator[SEP] identifier[messageDto] operator[SEP] identifier[setAction] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[messageDto] operator[SEP] identifier[setData] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[return] identifier[messageDto] operator[SEP]
}
|
@Nullable
public List<LineString> inner() {
List<List<Point>> coordinates = coordinates();
if (coordinates.size() <= 1) {
return new ArrayList(0);
}
List<LineString> inner = new ArrayList<>(coordinates.size() - 1);
for (List<Point> points : coordinates.subList(1, coordinates.size())) {
inner.add(LineString.fromLngLats(points));
}
return inner;
} | class class_name[name] begin[{]
method[inner, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], coordinates]
if[binary_operation[call[coordinates.size, parameter[]], <=, literal[1]]] begin[{]
return[ClassCreator(arguments=[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=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[List], inner]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromLngLats, postfix_operators=[], prefix_operators=[], qualifier=LineString, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=inner, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=coordinates, selectors=[], type_arguments=None)], member=subList, postfix_operators=[], prefix_operators=[], qualifier=coordinates, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=points)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Point, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None)
return[member[.inner]]
end[}]
END[}] | annotation[@] identifier[Nullable] Keyword[public] identifier[List] operator[<] identifier[LineString] operator[>] identifier[inner] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[List] operator[<] identifier[Point] operator[>] operator[>] identifier[coordinates] operator[=] identifier[coordinates] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[coordinates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] Other[1] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArrayList] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[LineString] operator[>] identifier[inner] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[coordinates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[Point] operator[>] identifier[points] operator[:] identifier[coordinates] operator[SEP] identifier[subList] operator[SEP] Other[1] , identifier[coordinates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[inner] operator[SEP] identifier[add] operator[SEP] identifier[LineString] operator[SEP] identifier[fromLngLats] operator[SEP] identifier[points] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[inner] operator[SEP]
}
|
public static boolean setAboutHandler(Object target, Method aboutHandler) {
boolean enableAboutMenu = (target != null && aboutHandler != null);
if (enableAboutMenu) {
setHandler(new OSXAdapter("handleAbout", target, aboutHandler));
}
// If we're setting a handler, enable the About menu item by calling
// com.apple.eawt.Application reflectively
try {
Method enableAboutMethod = macOSXApplication.getClass().getDeclaredMethod("setEnabledAboutMenu", new Class[] { boolean.class });
enableAboutMethod.invoke(macOSXApplication, new Object[] { Boolean.valueOf(enableAboutMenu) });
return true;
} catch (Exception ex) {
System.err.println("OSXAdapter could not access the About Menu");
ex.printStackTrace();
return false;
}
} | class class_name[name] begin[{]
method[setAboutHandler, return_type[type[boolean]], modifier[public static], parameter[target, aboutHandler]] begin[{]
local_variable[type[boolean], enableAboutMenu]
if[member[.enableAboutMenu]] begin[{]
call[.setHandler, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="handleAbout"), MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aboutHandler, 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=OSXAdapter, sub_type=None))]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=macOSXApplication, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setEnabledAboutMenu"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))], member=getDeclaredMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=enableAboutMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=macOSXApplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=enableAboutMenu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=enableAboutMethod, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="OSXAdapter could not access the About Menu")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None), 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=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[setAboutHandler] operator[SEP] identifier[Object] identifier[target] , identifier[Method] identifier[aboutHandler] operator[SEP] {
Keyword[boolean] identifier[enableAboutMenu] operator[=] operator[SEP] identifier[target] operator[!=] Other[null] operator[&&] identifier[aboutHandler] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enableAboutMenu] operator[SEP] {
identifier[setHandler] operator[SEP] Keyword[new] identifier[OSXAdapter] operator[SEP] literal[String] , identifier[target] , identifier[aboutHandler] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[Method] identifier[enableAboutMethod] operator[=] identifier[macOSXApplication] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredMethod] operator[SEP] literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] {
Keyword[boolean] operator[SEP] Keyword[class]
} operator[SEP] operator[SEP] identifier[enableAboutMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[macOSXApplication] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[enableAboutMenu] operator[SEP]
} operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
|
private String findProperty( String prop )
{
String result = System.getProperty( prop );
if ( result == null )
{
result = mavenProject.getProperties().getProperty( prop );
}
return result;
} | class class_name[name] begin[{]
method[findProperty, return_type[type[String]], modifier[private], parameter[prop]] begin[{]
local_variable[type[String], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
assign[member[.result], call[mavenProject.getProperties, parameter[]]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[findProperty] operator[SEP] identifier[String] identifier[prop] operator[SEP] {
identifier[String] identifier[result] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[prop] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
identifier[result] operator[=] identifier[mavenProject] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[prop] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public ServiceFuture<NotificationHubResourceInner> getAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback<NotificationHubResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback);
} | class class_name[name] begin[{]
method[getAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, namespaceName, notificationHubName, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.namespaceName], member[.notificationHubName]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[NotificationHubResourceInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[namespaceName] , identifier[String] identifier[notificationHubName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[NotificationHubResourceInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[namespaceName] , identifier[notificationHubName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public static Expression castToExpression(RowExpression rowExpression)
{
checkArgument(isExpression(rowExpression));
return ((OriginalExpression) rowExpression).getExpression();
} | class class_name[name] begin[{]
method[castToExpression, return_type[type[Expression]], modifier[public static], parameter[rowExpression]] begin[{]
call[.checkArgument, parameter[call[.isExpression, parameter[member[.rowExpression]]]]]
return[Cast(expression=MemberReference(member=rowExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OriginalExpression, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Expression] identifier[castToExpression] operator[SEP] identifier[RowExpression] identifier[rowExpression] operator[SEP] {
identifier[checkArgument] operator[SEP] identifier[isExpression] operator[SEP] identifier[rowExpression] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[OriginalExpression] operator[SEP] identifier[rowExpression] operator[SEP] operator[SEP] identifier[getExpression] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <E> Optional<E> maybeNth(long count, E[] array) {
final Iterator<E> filtered = new FilteringIterator<E>(new ArrayIterator<E>(array), new Nth<E>(count));
return new MaybeFirstElement<E>().apply(filtered);
} | class class_name[name] begin[{]
method[maybeNth, return_type[type[Optional]], modifier[public static], parameter[count, array]] begin[{]
local_variable[type[Iterator], filtered]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=filtered, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=None, name=MaybeFirstElement, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[Optional] operator[<] identifier[E] operator[>] identifier[maybeNth] operator[SEP] Keyword[long] identifier[count] , identifier[E] operator[SEP] operator[SEP] identifier[array] operator[SEP] {
Keyword[final] identifier[Iterator] operator[<] identifier[E] operator[>] identifier[filtered] operator[=] Keyword[new] identifier[FilteringIterator] operator[<] identifier[E] operator[>] operator[SEP] Keyword[new] identifier[ArrayIterator] operator[<] identifier[E] operator[>] operator[SEP] identifier[array] operator[SEP] , Keyword[new] identifier[Nth] operator[<] identifier[E] operator[>] operator[SEP] identifier[count] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[MaybeFirstElement] operator[<] identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[apply] operator[SEP] identifier[filtered] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
@Override
public EList<Checkout> getCheckouts() {
return (EList<Checkout>) eGet(StorePackage.Literals.PROJECT__CHECKOUTS, true);
} | class class_name[name] begin[{]
method[getCheckouts, return_type[type[EList]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=PROJECT__CHECKOUTS, postfix_operators=[], prefix_operators=[], qualifier=StorePackage.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Checkout, sub_type=None))], dimensions=[], name=EList, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[Checkout] operator[>] identifier[getCheckouts] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[Checkout] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[StorePackage] operator[SEP] identifier[Literals] operator[SEP] identifier[PROJECT__CHECKOUTS] , literal[boolean] operator[SEP] operator[SEP]
}
|
private void addPostParams(final Request request) {
if (from != null) {
request.addPostParam("From", from.toString());
}
if (to != null) {
request.addPostParam("To", to.toString());
}
if (statusCallback != null) {
request.addPostParam("StatusCallback", statusCallback.toString());
}
if (statusCallbackMethod != null) {
request.addPostParam("StatusCallbackMethod", statusCallbackMethod.toString());
}
if (statusCallbackEvent != null) {
for (String prop : statusCallbackEvent) {
request.addPostParam("StatusCallbackEvent", prop);
}
}
if (timeout != null) {
request.addPostParam("Timeout", timeout.toString());
}
if (record != null) {
request.addPostParam("Record", record.toString());
}
if (muted != null) {
request.addPostParam("Muted", muted.toString());
}
if (beep != null) {
request.addPostParam("Beep", beep);
}
if (startConferenceOnEnter != null) {
request.addPostParam("StartConferenceOnEnter", startConferenceOnEnter.toString());
}
if (endConferenceOnExit != null) {
request.addPostParam("EndConferenceOnExit", endConferenceOnExit.toString());
}
if (waitUrl != null) {
request.addPostParam("WaitUrl", waitUrl.toString());
}
if (waitMethod != null) {
request.addPostParam("WaitMethod", waitMethod.toString());
}
if (earlyMedia != null) {
request.addPostParam("EarlyMedia", earlyMedia.toString());
}
if (maxParticipants != null) {
request.addPostParam("MaxParticipants", maxParticipants.toString());
}
if (conferenceRecord != null) {
request.addPostParam("ConferenceRecord", conferenceRecord);
}
if (conferenceTrim != null) {
request.addPostParam("ConferenceTrim", conferenceTrim);
}
if (conferenceStatusCallback != null) {
request.addPostParam("ConferenceStatusCallback", conferenceStatusCallback.toString());
}
if (conferenceStatusCallbackMethod != null) {
request.addPostParam("ConferenceStatusCallbackMethod", conferenceStatusCallbackMethod.toString());
}
if (conferenceStatusCallbackEvent != null) {
for (String prop : conferenceStatusCallbackEvent) {
request.addPostParam("ConferenceStatusCallbackEvent", prop);
}
}
if (recordingChannels != null) {
request.addPostParam("RecordingChannels", recordingChannels);
}
if (recordingStatusCallback != null) {
request.addPostParam("RecordingStatusCallback", recordingStatusCallback.toString());
}
if (recordingStatusCallbackMethod != null) {
request.addPostParam("RecordingStatusCallbackMethod", recordingStatusCallbackMethod.toString());
}
if (sipAuthUsername != null) {
request.addPostParam("SipAuthUsername", sipAuthUsername);
}
if (sipAuthPassword != null) {
request.addPostParam("SipAuthPassword", sipAuthPassword);
}
if (region != null) {
request.addPostParam("Region", region);
}
if (conferenceRecordingStatusCallback != null) {
request.addPostParam("ConferenceRecordingStatusCallback", conferenceRecordingStatusCallback.toString());
}
if (conferenceRecordingStatusCallbackMethod != null) {
request.addPostParam("ConferenceRecordingStatusCallbackMethod", conferenceRecordingStatusCallbackMethod.toString());
}
if (recordingStatusCallbackEvent != null) {
for (String prop : recordingStatusCallbackEvent) {
request.addPostParam("RecordingStatusCallbackEvent", prop);
}
}
if (conferenceRecordingStatusCallbackEvent != null) {
for (String prop : conferenceRecordingStatusCallbackEvent) {
request.addPostParam("ConferenceRecordingStatusCallbackEvent", prop);
}
}
if (coaching != null) {
request.addPostParam("Coaching", coaching.toString());
}
if (callSidToCoach != null) {
request.addPostParam("CallSidToCoach", callSidToCoach);
}
} | class class_name[name] begin[{]
method[addPostParams, return_type[void], modifier[private], parameter[request]] begin[{]
if[binary_operation[member[.from], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["From"], call[from.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.to], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["To"], call[to.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.statusCallback], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["StatusCallback"], call[statusCallback.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.statusCallbackMethod], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["StatusCallbackMethod"], call[statusCallbackMethod.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.statusCallbackEvent], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="StatusCallbackEvent"), MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPostParam, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=statusCallbackEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.timeout], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["Timeout"], call[timeout.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.record], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["Record"], call[record.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.muted], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["Muted"], call[muted.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.beep], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["Beep"], member[.beep]]]
else begin[{]
None
end[}]
if[binary_operation[member[.startConferenceOnEnter], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["StartConferenceOnEnter"], call[startConferenceOnEnter.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.endConferenceOnExit], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["EndConferenceOnExit"], call[endConferenceOnExit.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.waitUrl], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["WaitUrl"], call[waitUrl.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.waitMethod], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["WaitMethod"], call[waitMethod.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.earlyMedia], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["EarlyMedia"], call[earlyMedia.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.maxParticipants], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["MaxParticipants"], call[maxParticipants.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceRecord], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["ConferenceRecord"], member[.conferenceRecord]]]
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceTrim], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["ConferenceTrim"], member[.conferenceTrim]]]
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceStatusCallback], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["ConferenceStatusCallback"], call[conferenceStatusCallback.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceStatusCallbackMethod], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["ConferenceStatusCallbackMethod"], call[conferenceStatusCallbackMethod.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceStatusCallbackEvent], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ConferenceStatusCallbackEvent"), MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPostParam, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=conferenceStatusCallbackEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.recordingChannels], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["RecordingChannels"], member[.recordingChannels]]]
else begin[{]
None
end[}]
if[binary_operation[member[.recordingStatusCallback], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["RecordingStatusCallback"], call[recordingStatusCallback.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.recordingStatusCallbackMethod], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["RecordingStatusCallbackMethod"], call[recordingStatusCallbackMethod.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.sipAuthUsername], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["SipAuthUsername"], member[.sipAuthUsername]]]
else begin[{]
None
end[}]
if[binary_operation[member[.sipAuthPassword], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["SipAuthPassword"], member[.sipAuthPassword]]]
else begin[{]
None
end[}]
if[binary_operation[member[.region], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["Region"], member[.region]]]
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceRecordingStatusCallback], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["ConferenceRecordingStatusCallback"], call[conferenceRecordingStatusCallback.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceRecordingStatusCallbackMethod], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["ConferenceRecordingStatusCallbackMethod"], call[conferenceRecordingStatusCallbackMethod.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.recordingStatusCallbackEvent], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="RecordingStatusCallbackEvent"), MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPostParam, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=recordingStatusCallbackEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.conferenceRecordingStatusCallbackEvent], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ConferenceRecordingStatusCallbackEvent"), MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPostParam, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=conferenceRecordingStatusCallbackEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.coaching], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["Coaching"], call[coaching.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.callSidToCoach], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["CallSidToCoach"], member[.callSidToCoach]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addPostParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] {
Keyword[if] operator[SEP] identifier[from] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[from] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[to] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[to] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[statusCallback] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[statusCallback] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[statusCallbackMethod] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[statusCallbackMethod] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[statusCallbackEvent] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[prop] operator[:] identifier[statusCallbackEvent] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[prop] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[timeout] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[timeout] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[record] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[record] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[muted] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[muted] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[beep] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[beep] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[startConferenceOnEnter] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[startConferenceOnEnter] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[endConferenceOnExit] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[endConferenceOnExit] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[waitUrl] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[waitUrl] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[waitMethod] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[waitMethod] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[earlyMedia] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[earlyMedia] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[maxParticipants] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[maxParticipants] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conferenceRecord] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[conferenceRecord] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conferenceTrim] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[conferenceTrim] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conferenceStatusCallback] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[conferenceStatusCallback] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conferenceStatusCallbackMethod] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[conferenceStatusCallbackMethod] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conferenceStatusCallbackEvent] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[prop] operator[:] identifier[conferenceStatusCallbackEvent] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[prop] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[recordingChannels] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[recordingChannels] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[recordingStatusCallback] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[recordingStatusCallback] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[recordingStatusCallbackMethod] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[recordingStatusCallbackMethod] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sipAuthUsername] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[sipAuthUsername] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sipAuthPassword] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[sipAuthPassword] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[region] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[region] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conferenceRecordingStatusCallback] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[conferenceRecordingStatusCallback] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conferenceRecordingStatusCallbackMethod] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[conferenceRecordingStatusCallbackMethod] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[recordingStatusCallbackEvent] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[prop] operator[:] identifier[recordingStatusCallbackEvent] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[prop] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[conferenceRecordingStatusCallbackEvent] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[prop] operator[:] identifier[conferenceRecordingStatusCallbackEvent] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[prop] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[coaching] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[coaching] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[callSidToCoach] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[callSidToCoach] operator[SEP] operator[SEP]
}
}
|
public EClass getIfcModulusOfSubgradeReactionMeasure() {
if (ifcModulusOfSubgradeReactionMeasureEClass == null) {
ifcModulusOfSubgradeReactionMeasureEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(713);
}
return ifcModulusOfSubgradeReactionMeasureEClass;
} | class class_name[name] begin[{]
method[getIfcModulusOfSubgradeReactionMeasure, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcModulusOfSubgradeReactionMeasureEClass], ==, literal[null]]] begin[{]
assign[member[.ifcModulusOfSubgradeReactionMeasureEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=713)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcModulusOfSubgradeReactionMeasureEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIfcModulusOfSubgradeReactionMeasure] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcModulusOfSubgradeReactionMeasureEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcModulusOfSubgradeReactionMeasureEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[713] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcModulusOfSubgradeReactionMeasureEClass] operator[SEP]
}
|
public Vm compile( String sql ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile(sql, vm);
return vm;
}
} | class class_name[name] begin[{]
method[compile, return_type[type[Vm]], modifier[public], parameter[sql]] begin[{]
SYNCHRONIZED[THIS[]] BEGIN[{]
local_variable[type[Vm], vm]
call[.vm_compile, parameter[member[.sql], member[.vm]]]
return[member[.vm]]
END[}]
end[}]
END[}] | Keyword[public] identifier[Vm] identifier[compile] operator[SEP] identifier[String] identifier[sql] operator[SEP] Keyword[throws] identifier[jsqlite] operator[SEP] identifier[Exception] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
identifier[Vm] identifier[vm] operator[=] Keyword[new] identifier[Vm] operator[SEP] operator[SEP] operator[SEP] identifier[vm_compile] operator[SEP] identifier[sql] , identifier[vm] operator[SEP] operator[SEP] Keyword[return] identifier[vm] operator[SEP]
}
}
|
public Vector3d fma(Vector3fc a, Vector3fc b) {
return fma(a, b, thisOrNew());
} | class class_name[name] begin[{]
method[fma, return_type[type[Vector3d]], modifier[public], parameter[a, b]] begin[{]
return[call[.fma, parameter[member[.a], member[.b], call[.thisOrNew, parameter[]]]]]
end[}]
END[}] | Keyword[public] identifier[Vector3d] identifier[fma] operator[SEP] identifier[Vector3fc] identifier[a] , identifier[Vector3fc] identifier[b] operator[SEP] {
Keyword[return] identifier[fma] operator[SEP] identifier[a] , identifier[b] , identifier[thisOrNew] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void resetToPath(int pathIndex) {
if (pathIndex < 0)
throw new IndexOutOfBoundsException();
m_nextPathIndex = pathIndex;
m_currentPathIndex = -1;
m_currentSegmentIndex = -1;
m_nextSegmentIndex = -1;
m_segmentCount = -1;
m_pathBegin = -1;
} | class class_name[name] begin[{]
method[resetToPath, return_type[void], modifier[public], parameter[pathIndex]] begin[{]
if[binary_operation[member[.pathIndex], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.m_nextPathIndex], member[.pathIndex]]
assign[member[.m_currentPathIndex], literal[1]]
assign[member[.m_currentSegmentIndex], literal[1]]
assign[member[.m_nextSegmentIndex], literal[1]]
assign[member[.m_segmentCount], literal[1]]
assign[member[.m_pathBegin], literal[1]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[resetToPath] operator[SEP] Keyword[int] identifier[pathIndex] operator[SEP] {
Keyword[if] operator[SEP] identifier[pathIndex] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] identifier[m_nextPathIndex] operator[=] identifier[pathIndex] operator[SEP] identifier[m_currentPathIndex] operator[=] operator[-] Other[1] operator[SEP] identifier[m_currentSegmentIndex] operator[=] operator[-] Other[1] operator[SEP] identifier[m_nextSegmentIndex] operator[=] operator[-] Other[1] operator[SEP] identifier[m_segmentCount] operator[=] operator[-] Other[1] operator[SEP] identifier[m_pathBegin] operator[=] operator[-] Other[1] operator[SEP]
}
|
@Deprecated
public ServerBuilder service(PathMapping pathMapping, Service<HttpRequest, HttpResponse> service,
String loggerName) {
defaultVirtualHostBuilderUpdated();
defaultVirtualHostBuilder.service(pathMapping, service, loggerName);
return this;
} | class class_name[name] begin[{]
method[service, return_type[type[ServerBuilder]], modifier[public], parameter[pathMapping, service, loggerName]] begin[{]
call[.defaultVirtualHostBuilderUpdated, parameter[]]
call[defaultVirtualHostBuilder.service, parameter[member[.pathMapping], member[.service], member[.loggerName]]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] identifier[ServerBuilder] identifier[service] operator[SEP] identifier[PathMapping] identifier[pathMapping] , identifier[Service] operator[<] identifier[HttpRequest] , identifier[HttpResponse] operator[>] identifier[service] , identifier[String] identifier[loggerName] operator[SEP] {
identifier[defaultVirtualHostBuilderUpdated] operator[SEP] operator[SEP] operator[SEP] identifier[defaultVirtualHostBuilder] operator[SEP] identifier[service] operator[SEP] identifier[pathMapping] , identifier[service] , identifier[loggerName] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static <V> Key<V> key(final com.google.cloud.datastore.Key raw) {
if (raw == null)
return null;
else
return new Key<>(raw);
} | class class_name[name] begin[{]
method[key, return_type[type[Key]], modifier[public static], parameter[raw]] begin[{]
if[binary_operation[member[.raw], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=raw, 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=Key, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[Key] operator[<] identifier[V] operator[>] identifier[key] operator[SEP] Keyword[final] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[cloud] operator[SEP] identifier[datastore] operator[SEP] identifier[Key] identifier[raw] operator[SEP] {
Keyword[if] operator[SEP] identifier[raw] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[else] Keyword[return] Keyword[new] identifier[Key] operator[<] operator[>] operator[SEP] identifier[raw] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.