code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public double[] evaluate(String testCorpus) throws IOException, ExecutionException, InterruptedException
{
Options options = parser.options;
options.goldFile = testCorpus;
File tmpTemplate = File.createTempFile("pred-" + new Date().getTime(), ".conll");
tmpTemplate.deleteOnExit();
options.predFile = tmpTemplate.getAbsolutePath();
options.outputFile = options.predFile;
File scoreFile = File.createTempFile("score-" + new Date().getTime(), ".txt");
scoreFile.deleteOnExit();
parser.parseConllFile(testCorpus, options.outputFile, options.rootFirst, options.beamWidth, true,
options.lowercase, 1, false, scoreFile.getAbsolutePath());
return Evaluator.evaluate(options.goldFile, options.predFile, options.punctuations);
} | class class_name[name] begin[{]
method[evaluate, return_type[type[double]], modifier[public], parameter[testCorpus]] begin[{]
local_variable[type[Options], options]
assign[member[options.goldFile], member[.testCorpus]]
local_variable[type[File], tmpTemplate]
call[tmpTemplate.deleteOnExit, parameter[]]
assign[member[options.predFile], call[tmpTemplate.getAbsolutePath, parameter[]]]
assign[member[options.outputFile], member[options.predFile]]
local_variable[type[File], scoreFile]
call[scoreFile.deleteOnExit, parameter[]]
call[parser.parseConllFile, parameter[member[.testCorpus], member[options.outputFile], member[options.rootFirst], member[options.beamWidth], literal[true], member[options.lowercase], literal[1], literal[false], call[scoreFile.getAbsolutePath, parameter[]]]]
return[call[Evaluator.evaluate, parameter[member[options.goldFile], member[options.predFile], member[options.punctuations]]]]
end[}]
END[}] | Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[evaluate] operator[SEP] identifier[String] identifier[testCorpus] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ExecutionException] , identifier[InterruptedException] {
identifier[Options] identifier[options] operator[=] identifier[parser] operator[SEP] identifier[options] operator[SEP] identifier[options] operator[SEP] identifier[goldFile] operator[=] identifier[testCorpus] operator[SEP] identifier[File] identifier[tmpTemplate] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[tmpTemplate] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[predFile] operator[=] identifier[tmpTemplate] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[outputFile] operator[=] identifier[options] operator[SEP] identifier[predFile] operator[SEP] identifier[File] identifier[scoreFile] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[scoreFile] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[parseConllFile] operator[SEP] identifier[testCorpus] , identifier[options] operator[SEP] identifier[outputFile] , identifier[options] operator[SEP] identifier[rootFirst] , identifier[options] operator[SEP] identifier[beamWidth] , literal[boolean] , identifier[options] operator[SEP] identifier[lowercase] , Other[1] , literal[boolean] , identifier[scoreFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Evaluator] operator[SEP] identifier[evaluate] operator[SEP] identifier[options] operator[SEP] identifier[goldFile] , identifier[options] operator[SEP] identifier[predFile] , identifier[options] operator[SEP] identifier[punctuations] operator[SEP] operator[SEP]
}
|
public List<CharacterMiningResponse> getCharactersCharacterIdMining(Integer characterId, String datasource,
String ifNoneMatch, Integer page, String token) throws ApiException {
ApiResponse<List<CharacterMiningResponse>> resp = getCharactersCharacterIdMiningWithHttpInfo(characterId,
datasource, ifNoneMatch, page, token);
return resp.getData();
} | class class_name[name] begin[{]
method[getCharactersCharacterIdMining, return_type[type[List]], modifier[public], parameter[characterId, datasource, ifNoneMatch, page, token]] begin[{]
local_variable[type[ApiResponse], resp]
return[call[resp.getData, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[CharacterMiningResponse] operator[>] identifier[getCharactersCharacterIdMining] operator[SEP] identifier[Integer] identifier[characterId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[Integer] identifier[page] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[ApiResponse] operator[<] identifier[List] operator[<] identifier[CharacterMiningResponse] operator[>] operator[>] identifier[resp] operator[=] identifier[getCharactersCharacterIdMiningWithHttpInfo] operator[SEP] identifier[characterId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[page] , identifier[token] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP]
}
|
private static <T> boolean newPojoSerializerIsCompatibleAfterMigration(
PojoSerializer<T> newPojoSerializer,
IntermediateCompatibilityResult<T> fieldSerializerCompatibility,
IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility,
LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots) {
return newPojoHasNewOrRemovedFields(fieldSerializerSnapshots, newPojoSerializer)
|| fieldSerializerCompatibility.isCompatibleAfterMigration()
|| preExistingRegistrationsCompatibility.isCompatibleAfterMigration();
} | class class_name[name] begin[{]
method[newPojoSerializerIsCompatibleAfterMigration, return_type[type[boolean]], modifier[private static], parameter[newPojoSerializer, fieldSerializerCompatibility, preExistingRegistrationsCompatibility, fieldSerializerSnapshots]] begin[{]
return[binary_operation[binary_operation[call[.newPojoHasNewOrRemovedFields, parameter[member[.fieldSerializerSnapshots], member[.newPojoSerializer]]], ||, call[fieldSerializerCompatibility.isCompatibleAfterMigration, parameter[]]], ||, call[preExistingRegistrationsCompatibility.isCompatibleAfterMigration, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] Keyword[boolean] identifier[newPojoSerializerIsCompatibleAfterMigration] operator[SEP] identifier[PojoSerializer] operator[<] identifier[T] operator[>] identifier[newPojoSerializer] , identifier[IntermediateCompatibilityResult] operator[<] identifier[T] operator[>] identifier[fieldSerializerCompatibility] , identifier[IntermediateCompatibilityResult] operator[<] identifier[T] operator[>] identifier[preExistingRegistrationsCompatibility] , identifier[LinkedOptionalMap] operator[<] identifier[Field] , identifier[TypeSerializerSnapshot] operator[<] operator[?] operator[>] operator[>] identifier[fieldSerializerSnapshots] operator[SEP] {
Keyword[return] identifier[newPojoHasNewOrRemovedFields] operator[SEP] identifier[fieldSerializerSnapshots] , identifier[newPojoSerializer] operator[SEP] operator[||] identifier[fieldSerializerCompatibility] operator[SEP] identifier[isCompatibleAfterMigration] operator[SEP] operator[SEP] operator[||] identifier[preExistingRegistrationsCompatibility] operator[SEP] identifier[isCompatibleAfterMigration] operator[SEP] operator[SEP] operator[SEP]
}
|
public void end(Xid xid, int flags) throws XAException {
if (flags != TMSUCCESS && flags != TMSUSPEND && flags != TMFAIL) {
throw new XAException(XAException.XAER_INVAL);
}
execute("XA END " + xidToString(xid) + " " + flagsToString(flags));
} | class class_name[name] begin[{]
method[end, return_type[void], modifier[public], parameter[xid, flags]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.flags], !=, member[.TMSUCCESS]], &&, binary_operation[member[.flags], !=, member[.TMSUSPEND]]], &&, binary_operation[member[.flags], !=, member[.TMFAIL]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=XAER_INVAL, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.execute, parameter[binary_operation[binary_operation[binary_operation[literal["XA END "], +, call[.xidToString, parameter[member[.xid]]]], +, literal[" "]], +, call[.flagsToString, parameter[member[.flags]]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[end] operator[SEP] identifier[Xid] identifier[xid] , Keyword[int] identifier[flags] operator[SEP] Keyword[throws] identifier[XAException] {
Keyword[if] operator[SEP] identifier[flags] operator[!=] identifier[TMSUCCESS] operator[&&] identifier[flags] operator[!=] identifier[TMSUSPEND] operator[&&] identifier[flags] operator[!=] identifier[TMFAIL] operator[SEP] {
Keyword[throw] Keyword[new] identifier[XAException] operator[SEP] identifier[XAException] operator[SEP] identifier[XAER_INVAL] operator[SEP] operator[SEP]
}
identifier[execute] operator[SEP] literal[String] operator[+] identifier[xidToString] operator[SEP] identifier[xid] operator[SEP] operator[+] literal[String] operator[+] identifier[flagsToString] operator[SEP] identifier[flags] operator[SEP] operator[SEP] operator[SEP]
}
|
private static Logger getOrCreateLogger(final String name) {
if (name == null || name.length() == 0) {
return root;
} else {
Logger logger = loggers.get(name);
if (logger == null) {
Logger parent = getOrCreateLogger(reduce(name));
logger = new Logger(parent, name);
loggers.put(name, logger);
}
return logger;
}
} | class class_name[name] begin[{]
method[getOrCreateLogger, return_type[type[Logger]], modifier[private static], parameter[name]] begin[{]
if[binary_operation[binary_operation[member[.name], ==, literal[null]], ||, binary_operation[call[name.length, parameter[]], ==, literal[0]]]] begin[{]
return[member[.root]]
else begin[{]
local_variable[type[Logger], logger]
if[binary_operation[member[.logger], ==, literal[null]]] begin[{]
local_variable[type[Logger], parent]
assign[member[.logger], ClassCreator(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Logger, sub_type=None))]
call[loggers.put, parameter[member[.name], member[.logger]]]
else begin[{]
None
end[}]
return[member[.logger]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Logger] identifier[getOrCreateLogger] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[||] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[root] operator[SEP]
}
Keyword[else] {
identifier[Logger] identifier[logger] operator[=] identifier[loggers] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[==] Other[null] operator[SEP] {
identifier[Logger] identifier[parent] operator[=] identifier[getOrCreateLogger] operator[SEP] identifier[reduce] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[=] Keyword[new] identifier[Logger] operator[SEP] identifier[parent] , identifier[name] operator[SEP] operator[SEP] identifier[loggers] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[logger] operator[SEP] operator[SEP]
}
Keyword[return] identifier[logger] operator[SEP]
}
}
|
protected String getTemplatePath(Response response) {
return StringUtils.isBlank(response.getTemplate()) ? (this.attachment.getControllerClassName() + "/" + this.attachment.getTemplateEngine().getTemplateName(this.attachment.getControllerMethodName())) : response.getTemplate();
} | class class_name[name] begin[{]
method[getTemplatePath, return_type[type[String]], modifier[protected], parameter[response]] begin[{]
return[TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTemplate, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[], member=getTemplate, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=attachment, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getControllerClassName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=attachment, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getTemplateEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=attachment, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getControllerMethodName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=getTemplateName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+))]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[getTemplatePath] operator[SEP] identifier[Response] identifier[response] operator[SEP] {
Keyword[return] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[response] operator[SEP] identifier[getTemplate] operator[SEP] operator[SEP] operator[SEP] operator[?] operator[SEP] Keyword[this] operator[SEP] identifier[attachment] operator[SEP] identifier[getControllerClassName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[attachment] operator[SEP] identifier[getTemplateEngine] operator[SEP] operator[SEP] operator[SEP] identifier[getTemplateName] operator[SEP] Keyword[this] operator[SEP] identifier[attachment] operator[SEP] identifier[getControllerMethodName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[response] operator[SEP] identifier[getTemplate] operator[SEP] operator[SEP] operator[SEP]
}
|
@GET
@Produces(MediaType.APPLICATION_XML)
public Response getTemplates() {
logger.debug("StartOf getTemplates - REQUEST for /templates");
TemplateHelper templateRestService = getTemplateHelper();
String serializedTemplate = null;
try {
serializedTemplate = templateRestService.getTemplates();
} catch (HelperException e) {
logger.info("getTemplates exception:"+e.getMessage());
return buildResponse(e);
}
logger.debug("EndOf getTemplates");
return buildResponse(200, serializedTemplate);
} | class class_name[name] begin[{]
method[getTemplates, return_type[type[Response]], modifier[public], parameter[]] begin[{]
call[logger.debug, parameter[literal["StartOf getTemplates - REQUEST for /templates"]]]
local_variable[type[TemplateHelper], templateRestService]
local_variable[type[String], serializedTemplate]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=serializedTemplate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTemplates, postfix_operators=[], prefix_operators=[], qualifier=templateRestService, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getTemplates exception:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['HelperException']))], finally_block=None, label=None, resources=None)
call[logger.debug, parameter[literal["EndOf getTemplates"]]]
return[call[.buildResponse, parameter[literal[200], member[.serializedTemplate]]]]
end[}]
END[}] | annotation[@] identifier[GET] annotation[@] identifier[Produces] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_XML] operator[SEP] Keyword[public] identifier[Response] identifier[getTemplates] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[TemplateHelper] identifier[templateRestService] operator[=] identifier[getTemplateHelper] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[serializedTemplate] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[serializedTemplate] operator[=] identifier[templateRestService] operator[SEP] identifier[getTemplates] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[HelperException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[buildResponse] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[buildResponse] operator[SEP] Other[200] , identifier[serializedTemplate] operator[SEP] operator[SEP]
}
|
protected void createComponent (
int componentId, String cclass, String cname, FrameProvider fprov)
{
// look up the component class information
ComponentClass clazz = _classes.get(cclass);
if (clazz == null) {
log.warning("Non-existent component class",
"class", cclass, "name", cname, "id", componentId);
return;
}
// create the component
CharacterComponent component = new CharacterComponent(componentId, cname, clazz, fprov);
// stick it into the appropriate tables
_components.put(componentId, component);
// we have a hash of lists for mapping components by class/name
ArrayList<CharacterComponent> comps = _classComps.get(cclass);
if (comps == null) {
comps = Lists.newArrayList();
_classComps.put(cclass, comps);
}
if (!comps.contains(component)) {
comps.add(component);
} else {
log.info("Requested to register the same component twice?", "comp", component);
}
} | class class_name[name] begin[{]
method[createComponent, return_type[void], modifier[protected], parameter[componentId, cclass, cname, fprov]] begin[{]
local_variable[type[ComponentClass], clazz]
if[binary_operation[member[.clazz], ==, literal[null]]] begin[{]
call[log.warning, parameter[literal["Non-existent component class"], literal["class"], member[.cclass], literal["name"], member[.cname], literal["id"], member[.componentId]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[CharacterComponent], component]
call[_components.put, parameter[member[.componentId], member[.component]]]
local_variable[type[ArrayList], comps]
if[binary_operation[member[.comps], ==, literal[null]]] begin[{]
assign[member[.comps], call[Lists.newArrayList, parameter[]]]
call[_classComps.put, parameter[member[.cclass], member[.comps]]]
else begin[{]
None
end[}]
if[call[comps.contains, parameter[member[.component]]]] begin[{]
call[comps.add, parameter[member[.component]]]
else begin[{]
call[log.info, parameter[literal["Requested to register the same component twice?"], literal["comp"], member[.component]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[createComponent] operator[SEP] Keyword[int] identifier[componentId] , identifier[String] identifier[cclass] , identifier[String] identifier[cname] , identifier[FrameProvider] identifier[fprov] operator[SEP] {
identifier[ComponentClass] identifier[clazz] operator[=] identifier[_classes] operator[SEP] identifier[get] operator[SEP] identifier[cclass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[==] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] , literal[String] , identifier[cclass] , literal[String] , identifier[cname] , literal[String] , identifier[componentId] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[CharacterComponent] identifier[component] operator[=] Keyword[new] identifier[CharacterComponent] operator[SEP] identifier[componentId] , identifier[cname] , identifier[clazz] , identifier[fprov] operator[SEP] operator[SEP] identifier[_components] operator[SEP] identifier[put] operator[SEP] identifier[componentId] , identifier[component] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[CharacterComponent] operator[>] identifier[comps] operator[=] identifier[_classComps] operator[SEP] identifier[get] operator[SEP] identifier[cclass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comps] operator[==] Other[null] operator[SEP] {
identifier[comps] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[_classComps] operator[SEP] identifier[put] operator[SEP] identifier[cclass] , identifier[comps] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[comps] operator[SEP] identifier[contains] operator[SEP] identifier[component] operator[SEP] operator[SEP] {
identifier[comps] operator[SEP] identifier[add] operator[SEP] identifier[component] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , literal[String] , identifier[component] operator[SEP] operator[SEP]
}
}
|
@Override
public CommerceWishList findByGroupId_First(long groupId,
OrderByComparator<CommerceWishList> orderByComparator)
throws NoSuchWishListException {
CommerceWishList commerceWishList = fetchByGroupId_First(groupId,
orderByComparator);
if (commerceWishList != null) {
return commerceWishList;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("groupId=");
msg.append(groupId);
msg.append("}");
throw new NoSuchWishListException(msg.toString());
} | class class_name[name] begin[{]
method[findByGroupId_First, return_type[type[CommerceWishList]], modifier[public], parameter[groupId, orderByComparator]] begin[{]
local_variable[type[CommerceWishList], commerceWishList]
if[binary_operation[member[.commerceWishList], !=, literal[null]]] begin[{]
return[member[.commerceWishList]]
else begin[{]
None
end[}]
local_variable[type[StringBundler], msg]
call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]]
call[msg.append, parameter[literal["groupId="]]]
call[msg.append, parameter[member[.groupId]]]
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=NoSuchWishListException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CommerceWishList] identifier[findByGroupId_First] operator[SEP] Keyword[long] identifier[groupId] , identifier[OrderByComparator] operator[<] identifier[CommerceWishList] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchWishListException] {
identifier[CommerceWishList] identifier[commerceWishList] operator[=] identifier[fetchByGroupId_First] operator[SEP] identifier[groupId] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceWishList] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[commerceWishList] operator[SEP]
}
identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[4] 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[groupId] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchWishListException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void addFlowEdge(DiffEntry change) {
if (checkFilePath(change.getNewPath(), EDGE_FILE_DEPTH)) {
Path edgeFilePath = new Path(this.repositoryDir, change.getNewPath());
try {
Config edgeConfig = loadEdgeFileWithOverrides(edgeFilePath);
List<SpecExecutor> specExecutors = getSpecExecutors(edgeConfig);
Class flowEdgeFactoryClass = Class.forName(ConfigUtils.getString(edgeConfig, FlowGraphConfigurationKeys.FLOW_EDGE_FACTORY_CLASS,
FlowGraphConfigurationKeys.DEFAULT_FLOW_EDGE_FACTORY_CLASS));
FlowEdgeFactory flowEdgeFactory = (FlowEdgeFactory) GobblinConstructorUtils.invokeLongestConstructor(flowEdgeFactoryClass, edgeConfig);
if (flowCatalog.isPresent()) {
FlowEdge edge = flowEdgeFactory.createFlowEdge(edgeConfig, flowCatalog.get(), specExecutors);
if (!this.flowGraph.addFlowEdge(edge)) {
log.warn("Could not add edge {} to FlowGraph; skipping", edge.getId());
} else {
log.info("Added edge {} to FlowGraph", edge.getId());
}
} else {
log.warn("Could not add edge defined in {} to FlowGraph as FlowCatalog is absent", change.getNewPath());
}
} catch (Exception e) {
log.warn("Could not add edge defined in {} due to exception {}", change.getNewPath(), e.getMessage());
}
}
} | class class_name[name] begin[{]
method[addFlowEdge, return_type[void], modifier[private], parameter[change]] begin[{]
if[call[.checkFilePath, parameter[call[change.getNewPath, parameter[]], member[.EDGE_FILE_DEPTH]]]] begin[{]
local_variable[type[Path], edgeFilePath]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=edgeFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadEdgeFileWithOverrides, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=edgeConfig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Config, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=edgeConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSpecExecutors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=specExecutors)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SpecExecutor, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=edgeConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FLOW_EDGE_FACTORY_CLASS, postfix_operators=[], prefix_operators=[], qualifier=FlowGraphConfigurationKeys, selectors=[]), MemberReference(member=DEFAULT_FLOW_EDGE_FACTORY_CLASS, postfix_operators=[], prefix_operators=[], qualifier=FlowGraphConfigurationKeys, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=ConfigUtils, selectors=[], type_arguments=None)], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=flowEdgeFactoryClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=flowEdgeFactoryClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=edgeConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeLongestConstructor, postfix_operators=[], prefix_operators=[], qualifier=GobblinConstructorUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FlowEdgeFactory, sub_type=None)), name=flowEdgeFactory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FlowEdgeFactory, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=flowCatalog, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not add edge defined in {} to FlowGraph as FlowCatalog is absent"), MethodInvocation(arguments=[], member=getNewPath, postfix_operators=[], prefix_operators=[], qualifier=change, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=edgeConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=flowCatalog, selectors=[], type_arguments=None), MemberReference(member=specExecutors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createFlowEdge, postfix_operators=[], prefix_operators=[], qualifier=flowEdgeFactory, selectors=[], type_arguments=None), name=edge)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FlowEdge, sub_type=None)), IfStatement(condition=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MemberReference(member=flowGraph, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=edge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFlowEdge, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Added edge {} to FlowGraph"), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not add edge {} to FlowGraph; skipping"), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not add edge defined in {} due to exception {}"), MethodInvocation(arguments=[], member=getNewPath, postfix_operators=[], prefix_operators=[], qualifier=change, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], 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=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addFlowEdge] operator[SEP] identifier[DiffEntry] identifier[change] operator[SEP] {
Keyword[if] operator[SEP] identifier[checkFilePath] operator[SEP] identifier[change] operator[SEP] identifier[getNewPath] operator[SEP] operator[SEP] , identifier[EDGE_FILE_DEPTH] operator[SEP] operator[SEP] {
identifier[Path] identifier[edgeFilePath] operator[=] Keyword[new] identifier[Path] operator[SEP] Keyword[this] operator[SEP] identifier[repositoryDir] , identifier[change] operator[SEP] identifier[getNewPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Config] identifier[edgeConfig] operator[=] identifier[loadEdgeFileWithOverrides] operator[SEP] identifier[edgeFilePath] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[SpecExecutor] operator[>] identifier[specExecutors] operator[=] identifier[getSpecExecutors] operator[SEP] identifier[edgeConfig] operator[SEP] operator[SEP] identifier[Class] identifier[flowEdgeFactoryClass] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[ConfigUtils] operator[SEP] identifier[getString] operator[SEP] identifier[edgeConfig] , identifier[FlowGraphConfigurationKeys] operator[SEP] identifier[FLOW_EDGE_FACTORY_CLASS] , identifier[FlowGraphConfigurationKeys] operator[SEP] identifier[DEFAULT_FLOW_EDGE_FACTORY_CLASS] operator[SEP] operator[SEP] operator[SEP] identifier[FlowEdgeFactory] identifier[flowEdgeFactory] operator[=] operator[SEP] identifier[FlowEdgeFactory] operator[SEP] identifier[GobblinConstructorUtils] operator[SEP] identifier[invokeLongestConstructor] operator[SEP] identifier[flowEdgeFactoryClass] , identifier[edgeConfig] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[flowCatalog] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[FlowEdge] identifier[edge] operator[=] identifier[flowEdgeFactory] operator[SEP] identifier[createFlowEdge] operator[SEP] identifier[edgeConfig] , identifier[flowCatalog] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[specExecutors] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[flowGraph] operator[SEP] identifier[addFlowEdge] operator[SEP] identifier[edge] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[edge] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[edge] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[change] operator[SEP] identifier[getNewPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[change] operator[SEP] identifier[getNewPath] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
private boolean shouldRemoveDataPullUpperBounds() {
if (!this.workUnitState.getPropAsBoolean(ConfigurationKeys.SOURCE_QUERYBASED_ALLOW_REMOVE_UPPER_BOUNDS, true)) {
return false;
}
// Only consider the last work unit
if (!partition.isLastPartition()) {
return false;
}
// Don't remove if user specifies one or is recorded in previous run
if (partition.getHasUserSpecifiedHighWatermark() ||
this.workUnitState.getProp(ConfigurationKeys.WORK_UNIT_STATE_ACTUAL_HIGH_WATER_MARK_KEY) != null) {
return false;
}
return true;
} | class class_name[name] begin[{]
method[shouldRemoveDataPullUpperBounds, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
if[THIS[member[None.workUnitState]call[None.getPropAsBoolean, parameter[member[ConfigurationKeys.SOURCE_QUERYBASED_ALLOW_REMOVE_UPPER_BOUNDS], literal[true]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[partition.isLastPartition, parameter[]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[call[partition.getHasUserSpecifiedHighWatermark, parameter[]], ||, binary_operation[THIS[member[None.workUnitState]call[None.getProp, parameter[member[ConfigurationKeys.WORK_UNIT_STATE_ACTUAL_HIGH_WATER_MARK_KEY]]]], !=, literal[null]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[shouldRemoveDataPullUpperBounds] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[workUnitState] operator[SEP] identifier[getPropAsBoolean] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[SOURCE_QUERYBASED_ALLOW_REMOVE_UPPER_BOUNDS] , literal[boolean] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[partition] operator[SEP] identifier[isLastPartition] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[partition] operator[SEP] identifier[getHasUserSpecifiedHighWatermark] operator[SEP] operator[SEP] operator[||] Keyword[this] operator[SEP] identifier[workUnitState] operator[SEP] identifier[getProp] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[WORK_UNIT_STATE_ACTUAL_HIGH_WATER_MARK_KEY] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public synchronized void registerNeighborConcurrent(String groupName, NeighborConcurrentGroup neighborConcurrentGroup) {
verifyCanScheduleState();
if (neighborConcurrentGroupMap == null) {
neighborConcurrentGroupMap = new ConcurrentHashMap<String, NeighborConcurrentGroup>(); // just in case
neighborConcurrentGroupList = new CopyOnWriteArrayList<NeighborConcurrentGroup>(); // just in case
}
neighborConcurrentGroupMap.put(groupName, neighborConcurrentGroup);
neighborConcurrentGroupList.add(neighborConcurrentGroup);
} | class class_name[name] begin[{]
method[registerNeighborConcurrent, return_type[void], modifier[synchronized public], parameter[groupName, neighborConcurrentGroup]] begin[{]
call[.verifyCanScheduleState, parameter[]]
if[binary_operation[member[.neighborConcurrentGroupMap], ==, literal[null]]] begin[{]
assign[member[.neighborConcurrentGroupMap], 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=NeighborConcurrentGroup, sub_type=None))], dimensions=None, name=ConcurrentHashMap, sub_type=None))]
assign[member[.neighborConcurrentGroupList], 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=NeighborConcurrentGroup, sub_type=None))], dimensions=None, name=CopyOnWriteArrayList, sub_type=None))]
else begin[{]
None
end[}]
call[neighborConcurrentGroupMap.put, parameter[member[.groupName], member[.neighborConcurrentGroup]]]
call[neighborConcurrentGroupList.add, parameter[member[.neighborConcurrentGroup]]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[registerNeighborConcurrent] operator[SEP] identifier[String] identifier[groupName] , identifier[NeighborConcurrentGroup] identifier[neighborConcurrentGroup] operator[SEP] {
identifier[verifyCanScheduleState] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[neighborConcurrentGroupMap] operator[==] Other[null] operator[SEP] {
identifier[neighborConcurrentGroupMap] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[String] , identifier[NeighborConcurrentGroup] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[neighborConcurrentGroupList] operator[=] Keyword[new] identifier[CopyOnWriteArrayList] operator[<] identifier[NeighborConcurrentGroup] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
identifier[neighborConcurrentGroupMap] operator[SEP] identifier[put] operator[SEP] identifier[groupName] , identifier[neighborConcurrentGroup] operator[SEP] operator[SEP] identifier[neighborConcurrentGroupList] operator[SEP] identifier[add] operator[SEP] identifier[neighborConcurrentGroup] operator[SEP] operator[SEP]
}
|
public static Constructor<?>[] getAnnotatedDeclaredConstructors(
Class<?> clazz, Class<? extends Annotation> annotationClass,
boolean recursively) {
Constructor<?>[] allConstructors = getDeclaredConstructors(clazz,
recursively);
List<Constructor<?>> annotatedConstructors = new LinkedList<Constructor<?>>();
for (Constructor<?> field : allConstructors) {
if (field.isAnnotationPresent(annotationClass))
annotatedConstructors.add(field);
}
return annotatedConstructors
.toArray(new Constructor<?>[annotatedConstructors.size()]);
} | class class_name[name] begin[{]
method[getAnnotatedDeclaredConstructors, return_type[type[Constructor]], modifier[public static], parameter[clazz, annotationClass, recursively]] begin[{]
local_variable[type[Constructor], allConstructors]
local_variable[type[List], annotatedConstructors]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=annotationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAnnotationPresent, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=annotatedConstructors, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=allConstructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Constructor, sub_type=None))), label=None)
return[call[annotatedConstructors.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=annotatedConstructors, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Constructor, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Constructor] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[getAnnotatedDeclaredConstructors] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotationClass] , Keyword[boolean] identifier[recursively] operator[SEP] {
identifier[Constructor] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[allConstructors] operator[=] identifier[getDeclaredConstructors] operator[SEP] identifier[clazz] , identifier[recursively] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Constructor] operator[<] operator[?] operator[>] operator[>] identifier[annotatedConstructors] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[Constructor] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Constructor] operator[<] operator[?] operator[>] identifier[field] operator[:] identifier[allConstructors] operator[SEP] {
Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[annotationClass] operator[SEP] operator[SEP] identifier[annotatedConstructors] operator[SEP] identifier[add] operator[SEP] identifier[field] operator[SEP] operator[SEP]
}
Keyword[return] identifier[annotatedConstructors] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Constructor] operator[<] operator[?] operator[>] operator[SEP] identifier[annotatedConstructors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Structure addCopyOfStructure(Group g, @Nonnull Structure original, String shortName, List<Dimension> dims) {
if (!defineMode)
throw new UnsupportedOperationException("not in define mode");
if (original == null)
throw new NullPointerException("Original structure must be non-null");
shortName = makeValidObjectName(shortName);
if (!version.isExtendedModel())
throw new IllegalArgumentException("Structure type only supported in extended model, version="+version);
Structure s = new Structure(ncfile, g, null, shortName);
s.setDimensions(dims);
for (Variable m : original.getVariables()) { // LOOK no nested structs
Variable nest = new Variable(ncfile, g, s, m.getShortName());
nest.setDataType(m.getDataType());
nest.setDimensions(m.getDimensions());
nest.addAll(m.getAttributes());
s.addMemberVariable(nest);
}
ncfile.addVariable(g, s);
return s;
} | class class_name[name] begin[{]
method[addCopyOfStructure, return_type[type[Structure]], modifier[public], parameter[g, original, shortName, dims]] begin[{]
if[member[.defineMode]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not in define mode")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.original], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Original structure must be non-null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.shortName], call[.makeValidObjectName, parameter[member[.shortName]]]]
if[call[version.isExtendedModel, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Structure type only supported in extended model, version="), operandr=MemberReference(member=version, 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)
else begin[{]
None
end[}]
local_variable[type[Structure], s]
call[s.setDimensions, parameter[member[.dims]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=ncfile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getShortName, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Variable, sub_type=None)), name=nest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDataType, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=setDataType, postfix_operators=[], prefix_operators=[], qualifier=nest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDimensions, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=setDimensions, postfix_operators=[], prefix_operators=[], qualifier=nest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=nest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMemberVariable, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getVariables, postfix_operators=[], prefix_operators=[], qualifier=original, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None))), label=None)
call[ncfile.addVariable, parameter[member[.g], member[.s]]]
return[member[.s]]
end[}]
END[}] | Keyword[public] identifier[Structure] identifier[addCopyOfStructure] operator[SEP] identifier[Group] identifier[g] , annotation[@] identifier[Nonnull] identifier[Structure] identifier[original] , identifier[String] identifier[shortName] , identifier[List] operator[<] identifier[Dimension] operator[>] identifier[dims] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[defineMode] operator[SEP] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[original] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[shortName] operator[=] identifier[makeValidObjectName] operator[SEP] identifier[shortName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[version] operator[SEP] identifier[isExtendedModel] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[version] operator[SEP] operator[SEP] identifier[Structure] identifier[s] operator[=] Keyword[new] identifier[Structure] operator[SEP] identifier[ncfile] , identifier[g] , Other[null] , identifier[shortName] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[setDimensions] operator[SEP] identifier[dims] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Variable] identifier[m] operator[:] identifier[original] operator[SEP] identifier[getVariables] operator[SEP] operator[SEP] operator[SEP] {
identifier[Variable] identifier[nest] operator[=] Keyword[new] identifier[Variable] operator[SEP] identifier[ncfile] , identifier[g] , identifier[s] , identifier[m] operator[SEP] identifier[getShortName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[nest] operator[SEP] identifier[setDataType] operator[SEP] identifier[m] operator[SEP] identifier[getDataType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[nest] operator[SEP] identifier[setDimensions] operator[SEP] identifier[m] operator[SEP] identifier[getDimensions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[nest] operator[SEP] identifier[addAll] operator[SEP] identifier[m] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[addMemberVariable] operator[SEP] identifier[nest] operator[SEP] operator[SEP]
}
identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] identifier[g] , identifier[s] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[SEP]
}
|
@Override
public synchronized void addEmptyFile(String pRelativePath) throws TTException, IOException {
MetaKey key = new MetaKey(pRelativePath);
MetaValue value = new MetaValue(FilelistenerReadTrx.emptyFileKey);
getBucketTransaction().getMetaBucket().put(key, value);
return;
} | class class_name[name] begin[{]
method[addEmptyFile, return_type[void], modifier[synchronized public], parameter[pRelativePath]] begin[{]
local_variable[type[MetaKey], key]
local_variable[type[MetaValue], value]
call[.getBucketTransaction, parameter[]]
return[None]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[addEmptyFile] operator[SEP] identifier[String] identifier[pRelativePath] operator[SEP] Keyword[throws] identifier[TTException] , identifier[IOException] {
identifier[MetaKey] identifier[key] operator[=] Keyword[new] identifier[MetaKey] operator[SEP] identifier[pRelativePath] operator[SEP] operator[SEP] identifier[MetaValue] identifier[value] operator[=] Keyword[new] identifier[MetaValue] operator[SEP] identifier[FilelistenerReadTrx] operator[SEP] identifier[emptyFileKey] operator[SEP] operator[SEP] identifier[getBucketTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[getMetaBucket] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
|
@SuppressWarnings("unchecked")
List<V> deserializeValues(List<byte[]> rawValues) {
return SerializationUtils.deserialize(rawValues, valueSerializer());
} | class class_name[name] begin[{]
method[deserializeValues, return_type[type[List]], modifier[default], parameter[rawValues]] begin[{]
return[call[SerializationUtils.deserialize, parameter[member[.rawValues], call[.valueSerializer, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[List] operator[<] identifier[V] operator[>] identifier[deserializeValues] operator[SEP] identifier[List] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[rawValues] operator[SEP] {
Keyword[return] identifier[SerializationUtils] operator[SEP] identifier[deserialize] operator[SEP] identifier[rawValues] , identifier[valueSerializer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@ApiModelProperty(example = "null", required = true, value = "")
public Map<String, Object> getState() {
return state;
} | class class_name[name] begin[{]
method[getState, return_type[type[Map]], modifier[public], parameter[]] begin[{]
return[member[.state]]
end[}]
END[}] | annotation[@] identifier[ApiModelProperty] operator[SEP] identifier[example] operator[=] literal[String] , identifier[required] operator[=] literal[boolean] , identifier[value] operator[=] literal[String] operator[SEP] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getState] operator[SEP] operator[SEP] {
Keyword[return] identifier[state] operator[SEP]
}
|
public final SalesInvoice retrieveEntity(final Map<String, Object> pReqVars,
final SalesInvoice pInvoice, final String pLang,
final boolean pIsOverseas) throws Exception {
SalesInvoice inv = this.srvOrm.retrieveEntity(pReqVars, pInvoice);
if (pIsOverseas) {
Set<String> ndFlSil = new HashSet<String>();
ndFlSil.add("itsId");
ndFlSil.add("subtotal");
ndFlSil.add("totalTaxes");
ndFlSil.add("taxesDescription");
ndFlSil.add("invItem");
ndFlSil.add("unitOfMeasure");
ndFlSil.add("itsQuantity");
ndFlSil.add("itsPrice");
ndFlSil.add("itsTotal");
ndFlSil.add("foreignPrice");
ndFlSil.add("foreignSubtotal");
ndFlSil.add("foreignTotalTaxes");
ndFlSil.add("foreignTotal");
pReqVars.put("SalesInvoiceLineneededFields", ndFlSil);
Set<String> ndFlItUm = new HashSet<String>();
ndFlItUm.add("itsId");
ndFlItUm.add("itsName");
pReqVars.put("InvItemneededFields", ndFlItUm);
pReqVars.put("UnitOfMeasureneededFields", ndFlItUm);
inv.setItsLines(getSrvOrm().retrieveListByQuery(pReqVars,
SalesInvoiceLine.class,
evalSalesInvOverseaseLinesSql(inv.getItsId().toString(), pLang)));
pReqVars.remove("SalesInvoiceLineneededFields");
pReqVars.remove("InvItemneededFields");
pReqVars.remove("UnitOfMeasureneededFields");
} else {
pReqVars.put("SalesInvoiceLineitsOwnerdeepLevel", 1); //only ID
inv.setItsLines(getSrvOrm().
retrieveListWithConditions(pReqVars, SalesInvoiceLine.class,
"where REVERSEDID is null and ITSOWNER=" + inv.getItsId()));
pReqVars.remove("SalesInvoiceLineitsOwnerdeepLevel");
}
//overseas sales usually free from sales taxes
SalesInvoiceTaxLine sitl = new SalesInvoiceTaxLine();
sitl.setItsOwner(inv);
pReqVars.put("SalesInvoiceTaxLineitsOwnerdeepLevel", 1); //only ID
inv.setTaxesLines(getSrvOrm().
retrieveListForField(pReqVars, sitl, "itsOwner"));
pReqVars.remove("SalesInvoiceTaxLineitsOwnerdeepLevel");
if (pIsOverseas) {
Set<String> ndFlSil = new HashSet<String>();
ndFlSil.add("itsId");
ndFlSil.add("subtotal");
ndFlSil.add("totalTaxes");
ndFlSil.add("taxesDescription");
ndFlSil.add("unitOfMeasure");
ndFlSil.add("itsQuantity");
ndFlSil.add("service");
ndFlSil.add("itsPrice");
ndFlSil.add("itsTotal");
ndFlSil.add("foreignPrice");
ndFlSil.add("foreignSubtotal");
ndFlSil.add("foreignTotalTaxes");
ndFlSil.add("foreignTotal");
pReqVars.put("SalesInvoiceServiceLineneededFields", ndFlSil);
Set<String> ndFlItUm = new HashSet<String>();
ndFlItUm.add("itsId");
ndFlItUm.add("itsName");
pReqVars.put("ServiceToSaleneededFields", ndFlItUm);
pReqVars.put("UnitOfMeasureneededFields", ndFlItUm);
inv.setServices(getSrvOrm().retrieveListByQuery(pReqVars,
SalesInvoiceServiceLine.class, evalSalesInvOverseaseServiceLinesSql(
inv.getItsId().toString(), pLang)));
pReqVars.remove("SalesInvoiceServiceLineneededFields");
pReqVars.remove("ServiceToSaleneededFields");
pReqVars.remove("UnitOfMeasureneededFields");
} else {
SalesInvoiceServiceLine sisl = new SalesInvoiceServiceLine();
sisl.setItsOwner(inv);
pReqVars.put("SalesInvoiceServiceLineitsOwnerdeepLevel", 1); //only ID
inv.setServices(getSrvOrm().
retrieveListForField(pReqVars, sisl, "itsOwner"));
}
pReqVars.remove("SalesInvoiceServiceLineitsOwnerdeepLevel");
return inv;
} | class class_name[name] begin[{]
method[retrieveEntity, return_type[type[SalesInvoice]], modifier[final public], parameter[pReqVars, pInvoice, pLang, pIsOverseas]] begin[{]
local_variable[type[SalesInvoice], inv]
if[member[.pIsOverseas]] begin[{]
local_variable[type[Set], ndFlSil]
call[ndFlSil.add, parameter[literal["itsId"]]]
call[ndFlSil.add, parameter[literal["subtotal"]]]
call[ndFlSil.add, parameter[literal["totalTaxes"]]]
call[ndFlSil.add, parameter[literal["taxesDescription"]]]
call[ndFlSil.add, parameter[literal["invItem"]]]
call[ndFlSil.add, parameter[literal["unitOfMeasure"]]]
call[ndFlSil.add, parameter[literal["itsQuantity"]]]
call[ndFlSil.add, parameter[literal["itsPrice"]]]
call[ndFlSil.add, parameter[literal["itsTotal"]]]
call[ndFlSil.add, parameter[literal["foreignPrice"]]]
call[ndFlSil.add, parameter[literal["foreignSubtotal"]]]
call[ndFlSil.add, parameter[literal["foreignTotalTaxes"]]]
call[ndFlSil.add, parameter[literal["foreignTotal"]]]
call[pReqVars.put, parameter[literal["SalesInvoiceLineneededFields"], member[.ndFlSil]]]
local_variable[type[Set], ndFlItUm]
call[ndFlItUm.add, parameter[literal["itsId"]]]
call[ndFlItUm.add, parameter[literal["itsName"]]]
call[pReqVars.put, parameter[literal["InvItemneededFields"], member[.ndFlItUm]]]
call[pReqVars.put, parameter[literal["UnitOfMeasureneededFields"], member[.ndFlItUm]]]
call[inv.setItsLines, parameter[call[.getSrvOrm, parameter[]]]]
call[pReqVars.remove, parameter[literal["SalesInvoiceLineneededFields"]]]
call[pReqVars.remove, parameter[literal["InvItemneededFields"]]]
call[pReqVars.remove, parameter[literal["UnitOfMeasureneededFields"]]]
else begin[{]
call[pReqVars.put, parameter[literal["SalesInvoiceLineitsOwnerdeepLevel"], literal[1]]]
call[inv.setItsLines, parameter[call[.getSrvOrm, parameter[]]]]
call[pReqVars.remove, parameter[literal["SalesInvoiceLineitsOwnerdeepLevel"]]]
end[}]
local_variable[type[SalesInvoiceTaxLine], sitl]
call[sitl.setItsOwner, parameter[member[.inv]]]
call[pReqVars.put, parameter[literal["SalesInvoiceTaxLineitsOwnerdeepLevel"], literal[1]]]
call[inv.setTaxesLines, parameter[call[.getSrvOrm, parameter[]]]]
call[pReqVars.remove, parameter[literal["SalesInvoiceTaxLineitsOwnerdeepLevel"]]]
if[member[.pIsOverseas]] begin[{]
local_variable[type[Set], ndFlSil]
call[ndFlSil.add, parameter[literal["itsId"]]]
call[ndFlSil.add, parameter[literal["subtotal"]]]
call[ndFlSil.add, parameter[literal["totalTaxes"]]]
call[ndFlSil.add, parameter[literal["taxesDescription"]]]
call[ndFlSil.add, parameter[literal["unitOfMeasure"]]]
call[ndFlSil.add, parameter[literal["itsQuantity"]]]
call[ndFlSil.add, parameter[literal["service"]]]
call[ndFlSil.add, parameter[literal["itsPrice"]]]
call[ndFlSil.add, parameter[literal["itsTotal"]]]
call[ndFlSil.add, parameter[literal["foreignPrice"]]]
call[ndFlSil.add, parameter[literal["foreignSubtotal"]]]
call[ndFlSil.add, parameter[literal["foreignTotalTaxes"]]]
call[ndFlSil.add, parameter[literal["foreignTotal"]]]
call[pReqVars.put, parameter[literal["SalesInvoiceServiceLineneededFields"], member[.ndFlSil]]]
local_variable[type[Set], ndFlItUm]
call[ndFlItUm.add, parameter[literal["itsId"]]]
call[ndFlItUm.add, parameter[literal["itsName"]]]
call[pReqVars.put, parameter[literal["ServiceToSaleneededFields"], member[.ndFlItUm]]]
call[pReqVars.put, parameter[literal["UnitOfMeasureneededFields"], member[.ndFlItUm]]]
call[inv.setServices, parameter[call[.getSrvOrm, parameter[]]]]
call[pReqVars.remove, parameter[literal["SalesInvoiceServiceLineneededFields"]]]
call[pReqVars.remove, parameter[literal["ServiceToSaleneededFields"]]]
call[pReqVars.remove, parameter[literal["UnitOfMeasureneededFields"]]]
else begin[{]
local_variable[type[SalesInvoiceServiceLine], sisl]
call[sisl.setItsOwner, parameter[member[.inv]]]
call[pReqVars.put, parameter[literal["SalesInvoiceServiceLineitsOwnerdeepLevel"], literal[1]]]
call[inv.setServices, parameter[call[.getSrvOrm, parameter[]]]]
end[}]
call[pReqVars.remove, parameter[literal["SalesInvoiceServiceLineitsOwnerdeepLevel"]]]
return[member[.inv]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[SalesInvoice] identifier[retrieveEntity] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pReqVars] , Keyword[final] identifier[SalesInvoice] identifier[pInvoice] , Keyword[final] identifier[String] identifier[pLang] , Keyword[final] Keyword[boolean] identifier[pIsOverseas] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[SalesInvoice] identifier[inv] operator[=] Keyword[this] operator[SEP] identifier[srvOrm] operator[SEP] identifier[retrieveEntity] operator[SEP] identifier[pReqVars] , identifier[pInvoice] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pIsOverseas] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[ndFlSil] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[ndFlSil] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[ndFlItUm] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ndFlItUm] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlItUm] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[ndFlItUm] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[ndFlItUm] operator[SEP] operator[SEP] identifier[inv] operator[SEP] identifier[setItsLines] operator[SEP] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] identifier[retrieveListByQuery] operator[SEP] identifier[pReqVars] , identifier[SalesInvoiceLine] operator[SEP] Keyword[class] , identifier[evalSalesInvOverseaseLinesSql] operator[SEP] identifier[inv] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[pLang] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , Other[1] operator[SEP] operator[SEP] identifier[inv] operator[SEP] identifier[setItsLines] operator[SEP] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] identifier[retrieveListWithConditions] operator[SEP] identifier[pReqVars] , identifier[SalesInvoiceLine] operator[SEP] Keyword[class] , literal[String] operator[+] identifier[inv] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[SalesInvoiceTaxLine] identifier[sitl] operator[=] Keyword[new] identifier[SalesInvoiceTaxLine] operator[SEP] operator[SEP] operator[SEP] identifier[sitl] operator[SEP] identifier[setItsOwner] operator[SEP] identifier[inv] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , Other[1] operator[SEP] operator[SEP] identifier[inv] operator[SEP] identifier[setTaxesLines] operator[SEP] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] identifier[retrieveListForField] operator[SEP] identifier[pReqVars] , identifier[sitl] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pIsOverseas] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[ndFlSil] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlSil] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[ndFlSil] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[ndFlItUm] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ndFlItUm] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ndFlItUm] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[ndFlItUm] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[ndFlItUm] operator[SEP] operator[SEP] identifier[inv] operator[SEP] identifier[setServices] operator[SEP] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] identifier[retrieveListByQuery] operator[SEP] identifier[pReqVars] , identifier[SalesInvoiceServiceLine] operator[SEP] Keyword[class] , identifier[evalSalesInvOverseaseServiceLinesSql] operator[SEP] identifier[inv] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[pLang] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[SalesInvoiceServiceLine] identifier[sisl] operator[=] Keyword[new] identifier[SalesInvoiceServiceLine] operator[SEP] operator[SEP] operator[SEP] identifier[sisl] operator[SEP] identifier[setItsOwner] operator[SEP] identifier[inv] operator[SEP] operator[SEP] identifier[pReqVars] operator[SEP] identifier[put] operator[SEP] literal[String] , Other[1] operator[SEP] operator[SEP] identifier[inv] operator[SEP] identifier[setServices] operator[SEP] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] identifier[retrieveListForField] operator[SEP] identifier[pReqVars] , identifier[sisl] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pReqVars] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[inv] operator[SEP]
}
|
public static Map<String, String> getLayerFiltersForCriterion(Criterion critter, MapModel mapModel) {
Map<String, String> filters = new HashMap<String, String>();
Set<String> serverLayerIds = new HashSet<String>();
critter.serverLayerIdVisitor(serverLayerIds);
for (VectorLayer vectorLayer : mapModel.getVectorLayers()) {
if (serverLayerIds.contains(vectorLayer.getServerLayerId())) {
if (vectorLayer.getFilter() != null && !"".equals(vectorLayer.getFilter())) {
filters.put(vectorLayer.getServerLayerId(), vectorLayer.getFilter());
}
}
}
return filters;
} | class class_name[name] begin[{]
method[getLayerFiltersForCriterion, return_type[type[Map]], modifier[public static], parameter[critter, mapModel]] begin[{]
local_variable[type[Map], filters]
local_variable[type[Set], serverLayerIds]
call[critter.serverLayerIdVisitor, parameter[member[.serverLayerIds]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServerLayerId, postfix_operators=[], prefix_operators=[], qualifier=vectorLayer, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=serverLayerIds, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFilter, postfix_operators=[], prefix_operators=[], qualifier=vectorLayer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFilter, postfix_operators=[], prefix_operators=[], qualifier=vectorLayer, selectors=[], type_arguments=None)], 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=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServerLayerId, postfix_operators=[], prefix_operators=[], qualifier=vectorLayer, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getFilter, postfix_operators=[], prefix_operators=[], qualifier=vectorLayer, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=filters, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getVectorLayers, postfix_operators=[], prefix_operators=[], qualifier=mapModel, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=vectorLayer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VectorLayer, sub_type=None))), label=None)
return[member[.filters]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getLayerFiltersForCriterion] operator[SEP] identifier[Criterion] identifier[critter] , identifier[MapModel] identifier[mapModel] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[filters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[serverLayerIds] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[critter] operator[SEP] identifier[serverLayerIdVisitor] operator[SEP] identifier[serverLayerIds] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[VectorLayer] identifier[vectorLayer] operator[:] identifier[mapModel] operator[SEP] identifier[getVectorLayers] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[serverLayerIds] operator[SEP] identifier[contains] operator[SEP] identifier[vectorLayer] operator[SEP] identifier[getServerLayerId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[vectorLayer] operator[SEP] identifier[getFilter] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[vectorLayer] operator[SEP] identifier[getFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[filters] operator[SEP] identifier[put] operator[SEP] identifier[vectorLayer] operator[SEP] identifier[getServerLayerId] operator[SEP] operator[SEP] , identifier[vectorLayer] operator[SEP] identifier[getFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[filters] operator[SEP]
}
|
public void setOwner(ListenerOwner owner)
{
super.setOwner(owner);
if (this.getOwner() != null) if (!this.getOwner().isNull())
// Display the screen that is supposed to be up now
this.fieldChanged(DBConstants.DISPLAY, DBConstants.INIT_MOVE);
} | class class_name[name] begin[{]
method[setOwner, return_type[void], modifier[public], parameter[owner]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=owner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOwner, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[binary_operation[THIS[call[None.getOwner, parameter[]]], !=, literal[null]]] begin[{]
if[THIS[call[None.getOwner, parameter[]]call[None.isNull, parameter[]]]] begin[{]
THIS[call[None.fieldChanged, parameter[member[DBConstants.DISPLAY], member[DBConstants.INIT_MOVE]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setOwner] operator[SEP] identifier[ListenerOwner] identifier[owner] operator[SEP] {
Keyword[super] operator[SEP] identifier[setOwner] operator[SEP] identifier[owner] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[SEP] identifier[isNull] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[fieldChanged] operator[SEP] identifier[DBConstants] operator[SEP] identifier[DISPLAY] , identifier[DBConstants] operator[SEP] identifier[INIT_MOVE] operator[SEP] operator[SEP]
}
|
private JAXBContext getSingleton() throws JAXBException {
if (jcSingelton == null) {
ClassLoader classLoader = ch.epfl.bbp.uima.xml.genia.ObjectFactory.class
.getClassLoader();// TODO needed?
jcSingelton = JAXBContext.newInstance(Set.class.getPackage()
.getName(), classLoader);
}
return jcSingelton;
} | class class_name[name] begin[{]
method[getSingleton, return_type[type[JAXBContext]], modifier[private], parameter[]] begin[{]
if[binary_operation[member[.jcSingelton], ==, literal[null]]] begin[{]
local_variable[type[ClassLoader], classLoader]
assign[member[.jcSingelton], call[JAXBContext.newInstance, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getPackage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Set, sub_type=None)), member[.classLoader]]]]
else begin[{]
None
end[}]
return[member[.jcSingelton]]
end[}]
END[}] | Keyword[private] identifier[JAXBContext] identifier[getSingleton] operator[SEP] operator[SEP] Keyword[throws] identifier[JAXBException] {
Keyword[if] operator[SEP] identifier[jcSingelton] operator[==] Other[null] operator[SEP] {
identifier[ClassLoader] identifier[classLoader] operator[=] identifier[ch] operator[SEP] identifier[epfl] operator[SEP] identifier[bbp] operator[SEP] identifier[uima] operator[SEP] identifier[xml] operator[SEP] identifier[genia] operator[SEP] identifier[ObjectFactory] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[jcSingelton] operator[=] identifier[JAXBContext] operator[SEP] identifier[newInstance] operator[SEP] identifier[Set] operator[SEP] Keyword[class] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[classLoader] operator[SEP] operator[SEP]
}
Keyword[return] identifier[jcSingelton] operator[SEP]
}
|
public static boolean shouldBeExported(String packageName) {
boolean service = packageName.endsWith(".service");
service = service
|| packageName.contains(".service.")
|| packageName.endsWith(".services")
|| packageName.contains(".services.");
boolean api = packageName.endsWith(".api");
api = api
|| packageName.contains(".api.")
|| packageName.endsWith(".apis")
|| packageName.contains(".apis.");
boolean model = packageName.endsWith(".model");
model = model
|| packageName.contains(".model.")
|| packageName.endsWith(".models")
|| packageName.contains(".models.");
boolean entity = packageName.endsWith(".entity");
entity = entity
|| packageName.contains(".entity.")
|| packageName.endsWith(".entities")
|| packageName.contains(".entities.");
return !packageName.isEmpty() && !packageName.equals(".") && (service || api || model || entity);
} | class class_name[name] begin[{]
method[shouldBeExported, return_type[type[boolean]], modifier[public static], parameter[packageName]] begin[{]
local_variable[type[boolean], service]
assign[member[.service], binary_operation[binary_operation[binary_operation[member[.service], ||, call[packageName.contains, parameter[literal[".service."]]]], ||, call[packageName.endsWith, parameter[literal[".services"]]]], ||, call[packageName.contains, parameter[literal[".services."]]]]]
local_variable[type[boolean], api]
assign[member[.api], binary_operation[binary_operation[binary_operation[member[.api], ||, call[packageName.contains, parameter[literal[".api."]]]], ||, call[packageName.endsWith, parameter[literal[".apis"]]]], ||, call[packageName.contains, parameter[literal[".apis."]]]]]
local_variable[type[boolean], model]
assign[member[.model], binary_operation[binary_operation[binary_operation[member[.model], ||, call[packageName.contains, parameter[literal[".model."]]]], ||, call[packageName.endsWith, parameter[literal[".models"]]]], ||, call[packageName.contains, parameter[literal[".models."]]]]]
local_variable[type[boolean], entity]
assign[member[.entity], binary_operation[binary_operation[binary_operation[member[.entity], ||, call[packageName.contains, parameter[literal[".entity."]]]], ||, call[packageName.endsWith, parameter[literal[".entities"]]]], ||, call[packageName.contains, parameter[literal[".entities."]]]]]
return[binary_operation[binary_operation[call[packageName.isEmpty, parameter[]], &&, call[packageName.equals, parameter[literal["."]]]], &&, binary_operation[binary_operation[binary_operation[member[.service], ||, member[.api]], ||, member[.model]], ||, member[.entity]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[shouldBeExported] operator[SEP] identifier[String] identifier[packageName] operator[SEP] {
Keyword[boolean] identifier[service] operator[=] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[service] operator[=] identifier[service] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[api] operator[=] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[api] operator[=] identifier[api] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[model] operator[=] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[model] operator[=] identifier[model] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[entity] operator[=] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[entity] operator[=] identifier[entity] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[!] identifier[packageName] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[packageName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[service] operator[||] identifier[api] operator[||] identifier[model] operator[||] identifier[entity] operator[SEP] operator[SEP]
}
|
public static Path removeEntropyMarkerIfPresent(FileSystem fs, Path path) {
final EntropyInjectingFileSystem efs = getEntropyFs(fs);
if (efs == null) {
return path;
}
else {
try {
return resolveEntropy(path, efs, false);
}
catch (IOException e) {
// this should never happen, because the path was valid before and we only remove characters.
// rethrow to silence the compiler
throw new FlinkRuntimeException(e.getMessage(), e);
}
}
} | class class_name[name] begin[{]
method[removeEntropyMarkerIfPresent, return_type[type[Path]], modifier[public static], parameter[fs, path]] begin[{]
local_variable[type[EntropyInjectingFileSystem], efs]
if[binary_operation[member[.efs], ==, literal[null]]] begin[{]
return[member[.path]]
else begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=efs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=resolveEntropy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=FlinkRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Path] identifier[removeEntropyMarkerIfPresent] operator[SEP] identifier[FileSystem] identifier[fs] , identifier[Path] identifier[path] operator[SEP] {
Keyword[final] identifier[EntropyInjectingFileSystem] identifier[efs] operator[=] identifier[getEntropyFs] operator[SEP] identifier[fs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[efs] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[path] operator[SEP]
}
Keyword[else] {
Keyword[try] {
Keyword[return] identifier[resolveEntropy] operator[SEP] identifier[path] , identifier[efs] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[FlinkRuntimeException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
protected List<MemcachedNode> createConnections(
final Collection<InetSocketAddress> addrs) throws IOException {
List<MemcachedNode> connections = new ArrayList<MemcachedNode>(addrs.size());
for (SocketAddress sa : addrs) {
SocketChannel ch = SocketChannel.open();
ch.configureBlocking(false);
MemcachedNode qa = connectionFactory.createMemcachedNode(sa, ch, bufSize);
qa.setConnection(this);
int ops = 0;
Socket socket = ch.socket();
socket.setTcpNoDelay(!connectionFactory.useNagleAlgorithm());
socket.setKeepAlive(connectionFactory.getKeepAlive());
try {
if (ch.connect(sa)) {
getLogger().info("Connected to %s immediately", qa);
connected(qa);
} else {
getLogger().info("Added %s to connect queue", qa);
ops = SelectionKey.OP_CONNECT;
}
selector.wakeup();
qa.setSk(ch.register(selector, ops, qa));
assert ch.isConnected()
|| qa.getSk().interestOps() == SelectionKey.OP_CONNECT
: "Not connected, and not wanting to connect";
} catch (SocketException e) {
getLogger().warn("Socket error on initial connect", e);
queueReconnect(qa);
}
connections.add(qa);
}
return connections;
} | class class_name[name] begin[{]
method[createConnections, return_type[type[List]], modifier[protected], parameter[addrs]] begin[{]
local_variable[type[List], connections]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=open, postfix_operators=[], prefix_operators=[], qualifier=SocketChannel, selectors=[], type_arguments=None), name=ch)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SocketChannel, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=configureBlocking, postfix_operators=[], prefix_operators=[], qualifier=ch, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bufSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createMemcachedNode, postfix_operators=[], prefix_operators=[], qualifier=connectionFactory, selectors=[], type_arguments=None), name=qa)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MemcachedNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=setConnection, postfix_operators=[], prefix_operators=[], qualifier=qa, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ops)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=socket, postfix_operators=[], prefix_operators=[], qualifier=ch, selectors=[], type_arguments=None), name=socket)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Socket, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=useNagleAlgorithm, postfix_operators=[], prefix_operators=['!'], qualifier=connectionFactory, selectors=[], type_arguments=None)], member=setTcpNoDelay, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeepAlive, postfix_operators=[], prefix_operators=[], qualifier=connectionFactory, selectors=[], type_arguments=None)], member=setKeepAlive, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), label=None), TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=connect, postfix_operators=[], prefix_operators=[], qualifier=ch, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Added %s to connect queue"), MemberReference(member=qa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ops, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OP_CONNECT, postfix_operators=[], prefix_operators=[], qualifier=SelectionKey, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connected to %s immediately"), MemberReference(member=qa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=qa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=wakeup, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ops, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=qa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=register, postfix_operators=[], prefix_operators=[], qualifier=ch, selectors=[], type_arguments=None)], member=setSk, postfix_operators=[], prefix_operators=[], qualifier=qa, selectors=[], type_arguments=None), label=None), AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isConnected, postfix_operators=[], prefix_operators=[], qualifier=ch, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSk, postfix_operators=[], prefix_operators=[], qualifier=qa, selectors=[MethodInvocation(arguments=[], member=interestOps, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=OP_CONNECT, postfix_operators=[], prefix_operators=[], qualifier=SelectionKey, selectors=[]), operator===), operator=||), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not connected, and not wanting to connect"))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Socket error on initial connect"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=qa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=queueReconnect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SocketException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=qa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=connections, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=addrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sa)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SocketAddress, sub_type=None))), label=None)
return[member[.connections]]
end[}]
END[}] | Keyword[protected] identifier[List] operator[<] identifier[MemcachedNode] operator[>] identifier[createConnections] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[InetSocketAddress] operator[>] identifier[addrs] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[List] operator[<] identifier[MemcachedNode] operator[>] identifier[connections] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[MemcachedNode] operator[>] operator[SEP] identifier[addrs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SocketAddress] identifier[sa] operator[:] identifier[addrs] operator[SEP] {
identifier[SocketChannel] identifier[ch] operator[=] identifier[SocketChannel] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] identifier[ch] operator[SEP] identifier[configureBlocking] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[MemcachedNode] identifier[qa] operator[=] identifier[connectionFactory] operator[SEP] identifier[createMemcachedNode] operator[SEP] identifier[sa] , identifier[ch] , identifier[bufSize] operator[SEP] operator[SEP] identifier[qa] operator[SEP] identifier[setConnection] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[int] identifier[ops] operator[=] Other[0] operator[SEP] identifier[Socket] identifier[socket] operator[=] identifier[ch] operator[SEP] identifier[socket] operator[SEP] operator[SEP] operator[SEP] identifier[socket] operator[SEP] identifier[setTcpNoDelay] operator[SEP] operator[!] identifier[connectionFactory] operator[SEP] identifier[useNagleAlgorithm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[socket] operator[SEP] identifier[setKeepAlive] operator[SEP] identifier[connectionFactory] operator[SEP] identifier[getKeepAlive] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[ch] operator[SEP] identifier[connect] operator[SEP] identifier[sa] operator[SEP] operator[SEP] {
identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[qa] operator[SEP] operator[SEP] identifier[connected] operator[SEP] identifier[qa] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[qa] operator[SEP] operator[SEP] identifier[ops] operator[=] identifier[SelectionKey] operator[SEP] identifier[OP_CONNECT] operator[SEP]
}
identifier[selector] operator[SEP] identifier[wakeup] operator[SEP] operator[SEP] operator[SEP] identifier[qa] operator[SEP] identifier[setSk] operator[SEP] identifier[ch] operator[SEP] identifier[register] operator[SEP] identifier[selector] , identifier[ops] , identifier[qa] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[ch] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[||] identifier[qa] operator[SEP] identifier[getSk] operator[SEP] operator[SEP] operator[SEP] identifier[interestOps] operator[SEP] operator[SEP] operator[==] identifier[SelectionKey] operator[SEP] identifier[OP_CONNECT] operator[:] literal[String] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SocketException] identifier[e] operator[SEP] {
identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[queueReconnect] operator[SEP] identifier[qa] operator[SEP] operator[SEP]
}
identifier[connections] operator[SEP] identifier[add] operator[SEP] identifier[qa] operator[SEP] operator[SEP]
}
Keyword[return] identifier[connections] operator[SEP]
}
|
public void setParameter(final String name, final String value) {
String[] currentValue = (String[]) parameters.get(name);
if (currentValue == null) {
currentValue = new String[]{value};
} else {
// convert the current values into a new array..
String[] newValues = new String[currentValue.length + 1];
System.arraycopy(currentValue, 0, newValues, 0, currentValue.length);
newValues[newValues.length - 1] = value;
currentValue = newValues;
}
parameters.put(name, currentValue);
} | class class_name[name] begin[{]
method[setParameter, return_type[void], modifier[public], parameter[name, value]] begin[{]
local_variable[type[String], currentValue]
if[binary_operation[member[.currentValue], ==, literal[null]]] begin[{]
assign[member[.currentValue], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]
else begin[{]
local_variable[type[String], newValues]
call[System.arraycopy, parameter[member[.currentValue], literal[0], member[.newValues], literal[0], member[currentValue.length]]]
assign[member[.newValues], member[.value]]
assign[member[.currentValue], member[.newValues]]
end[}]
call[parameters.put, parameter[member[.name], member[.currentValue]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setParameter] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[value] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[currentValue] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentValue] operator[==] Other[null] operator[SEP] {
identifier[currentValue] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[value]
} operator[SEP]
}
Keyword[else] {
identifier[String] operator[SEP] operator[SEP] identifier[newValues] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[currentValue] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[currentValue] , Other[0] , identifier[newValues] , Other[0] , identifier[currentValue] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[newValues] operator[SEP] identifier[newValues] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[currentValue] operator[=] identifier[newValues] operator[SEP]
}
identifier[parameters] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[currentValue] operator[SEP] operator[SEP]
}
|
public static boolean isValid(
int yearOfEra,
int month,
int dayOfMonth
) {
return CALSYS.isValid(CopticEra.ANNO_MARTYRUM, yearOfEra, month, dayOfMonth);
} | class class_name[name] begin[{]
method[isValid, return_type[type[boolean]], modifier[public static], parameter[yearOfEra, month, dayOfMonth]] begin[{]
return[call[CALSYS.isValid, parameter[member[CopticEra.ANNO_MARTYRUM], member[.yearOfEra], member[.month], member[.dayOfMonth]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isValid] operator[SEP] Keyword[int] identifier[yearOfEra] , Keyword[int] identifier[month] , Keyword[int] identifier[dayOfMonth] operator[SEP] {
Keyword[return] identifier[CALSYS] operator[SEP] identifier[isValid] operator[SEP] identifier[CopticEra] operator[SEP] identifier[ANNO_MARTYRUM] , identifier[yearOfEra] , identifier[month] , identifier[dayOfMonth] operator[SEP] operator[SEP]
}
|
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.AFFILIATIONS), null);
AffiliationsExtension listElem = reply.getExtension(PubSubElementType.AFFILIATIONS);
return listElem.getAffiliations();
} | class class_name[name] begin[{]
method[getAffiliations, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[PubSub], reply]
local_variable[type[AffiliationsExtension], listElem]
return[call[listElem.getAffiliations, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[Affiliation] operator[>] identifier[getAffiliations] operator[SEP] operator[SEP] Keyword[throws] identifier[NoResponseException] , identifier[XMPPErrorException] , identifier[NotConnectedException] , identifier[InterruptedException] {
identifier[PubSub] identifier[reply] operator[=] identifier[sendPubsubPacket] operator[SEP] identifier[Type] operator[SEP] identifier[get] , Keyword[new] identifier[NodeExtension] operator[SEP] identifier[PubSubElementType] operator[SEP] identifier[AFFILIATIONS] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[AffiliationsExtension] identifier[listElem] operator[=] identifier[reply] operator[SEP] identifier[getExtension] operator[SEP] identifier[PubSubElementType] operator[SEP] identifier[AFFILIATIONS] operator[SEP] operator[SEP] Keyword[return] identifier[listElem] operator[SEP] identifier[getAffiliations] operator[SEP] operator[SEP] operator[SEP]
}
|
public static final Function<BigInteger,Boolean> isNotNull() {
return (Function<BigInteger,Boolean>)((Function)FnObject.isNotNull());
} | class class_name[name] begin[{]
method[isNotNull, return_type[type[Function]], modifier[final public static], parameter[]] begin[{]
return[Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=isNotNull, postfix_operators=[], prefix_operators=[], qualifier=FnObject, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Function, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=[], name=Function, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[Function] operator[<] identifier[BigInteger] , identifier[Boolean] operator[>] identifier[isNotNull] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[Function] operator[<] identifier[BigInteger] , identifier[Boolean] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Function] operator[SEP] identifier[FnObject] operator[SEP] identifier[isNotNull] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Result notFound(File content, boolean inline) {
return notFound(content, inline, StaticFileMimeTypes.fileMimeTypes());
} | class class_name[name] begin[{]
method[notFound, return_type[type[Result]], modifier[public static], parameter[content, inline]] begin[{]
return[call[.notFound, parameter[member[.content], member[.inline], call[StaticFileMimeTypes.fileMimeTypes, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Result] identifier[notFound] operator[SEP] identifier[File] identifier[content] , Keyword[boolean] identifier[inline] operator[SEP] {
Keyword[return] identifier[notFound] operator[SEP] identifier[content] , identifier[inline] , identifier[StaticFileMimeTypes] operator[SEP] identifier[fileMimeTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Locale getUserLocale() {
Locale locale = findCachedLocale();
if (locale != null) {
// mainly here if you call this in action process
// because locale process is called before action
return locale;
}
locale = findSessionLocale();
if (locale != null) {
return locale;
}
return getRequestedLocale();
} | class class_name[name] begin[{]
method[getUserLocale, return_type[type[Locale]], modifier[public], parameter[]] begin[{]
local_variable[type[Locale], locale]
if[binary_operation[member[.locale], !=, literal[null]]] begin[{]
return[member[.locale]]
else begin[{]
None
end[}]
assign[member[.locale], call[.findSessionLocale, parameter[]]]
if[binary_operation[member[.locale], !=, literal[null]]] begin[{]
return[member[.locale]]
else begin[{]
None
end[}]
return[call[.getRequestedLocale, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Locale] identifier[getUserLocale] operator[SEP] operator[SEP] {
identifier[Locale] identifier[locale] operator[=] identifier[findCachedLocale] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[locale] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[locale] operator[SEP]
}
identifier[locale] operator[=] identifier[findSessionLocale] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[locale] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[locale] operator[SEP]
}
Keyword[return] identifier[getRequestedLocale] operator[SEP] operator[SEP] operator[SEP]
}
|
public String[] get_attribute_list(final DeviceProxy deviceProxy) throws DevFailed {
build_connection(deviceProxy);
final int retries = deviceProxy.transparent_reconnection ? 2 : 1;
for (int oneTry=1 ; oneTry<=retries ; oneTry++) {
try {
if (deviceProxy.url.protocol == TANGO) {
// Read All attribute config
final String[] wildcard = new String[1];
if (deviceProxy.device_3 != null) {
wildcard[0] = TangoConst.Tango_AllAttr_3;
} else {
wildcard[0] = TangoConst.Tango_AllAttr;
}
final AttributeInfo[] ac = get_attribute_info(deviceProxy, wildcard);
final String[] result = new String[ac.length];
for (int i = 0; i < ac.length; i++) {
result[i] = ac[i].name;
}
return result;
} else {
return deviceProxy.taco_device.get_attribute_list();
}
}
catch (DevFailed e) {
if (oneTry>=retries)
throw e;
// else retry
}
}
return null; // cannot occur
} | class class_name[name] begin[{]
method[get_attribute_list, return_type[type[String]], modifier[public], parameter[deviceProxy]] begin[{]
call[.build_connection, parameter[member[.deviceProxy]]]
local_variable[type[int], retries]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=protocol, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.url, selectors=[]), operandr=MemberReference(member=TANGO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=get_attribute_list, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.taco_device, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=wildcard)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=device_3, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=wildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MemberReference(member=Tango_AllAttr, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=wildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MemberReference(member=Tango_AllAttr_3, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=deviceProxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_attribute_info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=ac)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=AttributeInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=result)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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=ac, 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), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=oneTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=retries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DevFailed']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=oneTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=retries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=oneTry)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=oneTry, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[get_attribute_list] operator[SEP] Keyword[final] identifier[DeviceProxy] identifier[deviceProxy] operator[SEP] Keyword[throws] identifier[DevFailed] {
identifier[build_connection] operator[SEP] identifier[deviceProxy] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[retries] operator[=] identifier[deviceProxy] operator[SEP] identifier[transparent_reconnection] operator[?] Other[2] operator[:] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[oneTry] operator[=] Other[1] operator[SEP] identifier[oneTry] operator[<=] identifier[retries] operator[SEP] identifier[oneTry] operator[++] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[url] operator[SEP] identifier[protocol] operator[==] identifier[TANGO] operator[SEP] {
Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[wildcard] operator[=] Keyword[new] identifier[String] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_3] operator[!=] Other[null] operator[SEP] {
identifier[wildcard] operator[SEP] Other[0] operator[SEP] operator[=] identifier[TangoConst] operator[SEP] identifier[Tango_AllAttr_3] operator[SEP]
}
Keyword[else] {
identifier[wildcard] operator[SEP] Other[0] operator[SEP] operator[=] identifier[TangoConst] operator[SEP] identifier[Tango_AllAttr] operator[SEP]
}
Keyword[final] identifier[AttributeInfo] operator[SEP] operator[SEP] identifier[ac] operator[=] identifier[get_attribute_info] operator[SEP] identifier[deviceProxy] , identifier[wildcard] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[ac] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ac] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[ac] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[name] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[deviceProxy] operator[SEP] identifier[taco_device] operator[SEP] identifier[get_attribute_list] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[DevFailed] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[oneTry] operator[>=] identifier[retries] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public Object run() {
Thread currentThread = Thread.currentThread();
oldClassLoader = threadContextAccessor.getContextClassLoader(currentThread); // 369927
// The following tests are done in a certain order to maximize performance
if (newClassLoader == oldClassLoader) {
wasChanged = false;
} else if ((newClassLoader == null && oldClassLoader != null)
|| (newClassLoader != null &&
(oldClassLoader == null || !(newClassLoader.equals(oldClassLoader))))) {
// class loaders are different, change to new one
threadContextAccessor.setContextClassLoader(currentThread, newClassLoader); // 369927
wasChanged = true;
} else
wasChanged = false;
return oldClassLoader;
} | class class_name[name] begin[{]
method[run, return_type[type[Object]], modifier[public], parameter[]] begin[{]
local_variable[type[Thread], currentThread]
assign[member[.oldClassLoader], call[threadContextAccessor.getContextClassLoader, parameter[member[.currentThread]]]]
if[binary_operation[member[.newClassLoader], ==, member[.oldClassLoader]]] begin[{]
assign[member[.wasChanged], literal[false]]
else begin[{]
if[binary_operation[binary_operation[binary_operation[member[.newClassLoader], ==, literal[null]], &&, binary_operation[member[.oldClassLoader], !=, literal[null]]], ||, binary_operation[binary_operation[member[.newClassLoader], !=, literal[null]], &&, binary_operation[binary_operation[member[.oldClassLoader], ==, literal[null]], ||, call[newClassLoader.equals, parameter[member[.oldClassLoader]]]]]]] begin[{]
call[threadContextAccessor.setContextClassLoader, parameter[member[.currentThread], member[.newClassLoader]]]
assign[member[.wasChanged], literal[true]]
else begin[{]
assign[member[.wasChanged], literal[false]]
end[}]
end[}]
return[member[.oldClassLoader]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[run] operator[SEP] operator[SEP] {
identifier[Thread] identifier[currentThread] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[oldClassLoader] operator[=] identifier[threadContextAccessor] operator[SEP] identifier[getContextClassLoader] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newClassLoader] operator[==] identifier[oldClassLoader] operator[SEP] {
identifier[wasChanged] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[newClassLoader] operator[==] Other[null] operator[&&] identifier[oldClassLoader] operator[!=] Other[null] operator[SEP] operator[||] operator[SEP] identifier[newClassLoader] operator[!=] Other[null] operator[&&] operator[SEP] identifier[oldClassLoader] operator[==] Other[null] operator[||] operator[!] operator[SEP] identifier[newClassLoader] operator[SEP] identifier[equals] operator[SEP] identifier[oldClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[threadContextAccessor] operator[SEP] identifier[setContextClassLoader] operator[SEP] identifier[currentThread] , identifier[newClassLoader] operator[SEP] operator[SEP] identifier[wasChanged] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] identifier[wasChanged] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[oldClassLoader] operator[SEP]
}
|
@Deprecated
public void kill(Map<String, String> modelEnvVars) throws InterruptedException {
kill(null,modelEnvVars);
} | class class_name[name] begin[{]
method[kill, return_type[void], modifier[public], parameter[modelEnvVars]] begin[{]
call[.kill, parameter[literal[null], member[.modelEnvVars]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[void] identifier[kill] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[modelEnvVars] operator[SEP] Keyword[throws] identifier[InterruptedException] {
identifier[kill] operator[SEP] Other[null] , identifier[modelEnvVars] operator[SEP] operator[SEP]
}
|
public static String md5(String data, String salt) {
return bytes2HexString(md5ToByte((data + salt).getBytes()));
} | class class_name[name] begin[{]
method[md5, return_type[type[String]], modifier[public static], parameter[data, salt]] begin[{]
return[call[.bytes2HexString, parameter[call[.md5ToByte, parameter[binary_operation[member[.data], +, member[.salt]]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[md5] operator[SEP] identifier[String] identifier[data] , identifier[String] identifier[salt] operator[SEP] {
Keyword[return] identifier[bytes2HexString] operator[SEP] identifier[md5ToByte] operator[SEP] operator[SEP] identifier[data] operator[+] identifier[salt] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private TypeID genericReadTypeID(RecordInput rin, String tag) throws IOException {
byte typeVal = rin.readByte(tag);
switch (typeVal) {
case TypeID.RIOType.BOOL:
return TypeID.BoolTypeID;
case TypeID.RIOType.BUFFER:
return TypeID.BufferTypeID;
case TypeID.RIOType.BYTE:
return TypeID.ByteTypeID;
case TypeID.RIOType.DOUBLE:
return TypeID.DoubleTypeID;
case TypeID.RIOType.FLOAT:
return TypeID.FloatTypeID;
case TypeID.RIOType.INT:
return TypeID.IntTypeID;
case TypeID.RIOType.LONG:
return TypeID.LongTypeID;
case TypeID.RIOType.MAP:
{
TypeID tIDKey = genericReadTypeID(rin, tag);
TypeID tIDValue = genericReadTypeID(rin, tag);
return new MapTypeID(tIDKey, tIDValue);
}
case TypeID.RIOType.STRING:
return TypeID.StringTypeID;
case TypeID.RIOType.STRUCT:
{
StructTypeID stID = new StructTypeID();
int numElems = rin.readInt(tag);
for (int i=0; i<numElems; i++) {
stID.add(genericReadTypeInfo(rin, tag));
}
return stID;
}
case TypeID.RIOType.VECTOR:
{
TypeID tID = genericReadTypeID(rin, tag);
return new VectorTypeID(tID);
}
default:
// shouldn't be here
throw new IOException("Unknown type read");
}
} | class class_name[name] begin[{]
method[genericReadTypeID, return_type[type[TypeID]], modifier[private], parameter[rin, tag]] begin[{]
local_variable[type[byte], typeVal]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BOOL, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=BoolTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=BUFFER, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=BufferTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=BYTE, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=ByteTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=DoubleTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=FLOAT, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=FloatTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=INT, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=IntTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=LONG, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=LongTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=MAP, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=genericReadTypeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tIDKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeID, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=genericReadTypeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tIDValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeID, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=tIDKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tIDValue, 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=MapTypeID, sub_type=None)), label=None)])]), SwitchStatementCase(case=[MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=StringTypeID, postfix_operators=[], prefix_operators=[], qualifier=TypeID, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=STRUCT, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StructTypeID, sub_type=None)), name=stID)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StructTypeID, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=rin, selectors=[], type_arguments=None), name=numElems)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=rin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=genericReadTypeInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=stID, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numElems, 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), ReturnStatement(expression=MemberReference(member=stID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])]), SwitchStatementCase(case=[MemberReference(member=VECTOR, postfix_operators=[], prefix_operators=[], qualifier=TypeID.RIOType, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=genericReadTypeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tID)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeID, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=tID, 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=VectorTypeID, sub_type=None)), label=None)])]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown type read")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)])], expression=MemberReference(member=typeVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[private] identifier[TypeID] identifier[genericReadTypeID] operator[SEP] identifier[RecordInput] identifier[rin] , identifier[String] identifier[tag] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[byte] identifier[typeVal] operator[=] identifier[rin] operator[SEP] identifier[readByte] operator[SEP] identifier[tag] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[typeVal] operator[SEP] {
Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[BOOL] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[BoolTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[BUFFER] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[BufferTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[BYTE] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[ByteTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[DOUBLE] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[DoubleTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[FLOAT] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[FloatTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[INT] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[IntTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[LONG] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[LongTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[MAP] operator[:] {
identifier[TypeID] identifier[tIDKey] operator[=] identifier[genericReadTypeID] operator[SEP] identifier[rin] , identifier[tag] operator[SEP] operator[SEP] identifier[TypeID] identifier[tIDValue] operator[=] identifier[genericReadTypeID] operator[SEP] identifier[rin] , identifier[tag] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[MapTypeID] operator[SEP] identifier[tIDKey] , identifier[tIDValue] operator[SEP] operator[SEP]
}
Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[STRING] operator[:] Keyword[return] identifier[TypeID] operator[SEP] identifier[StringTypeID] operator[SEP] Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[STRUCT] operator[:] {
identifier[StructTypeID] identifier[stID] operator[=] Keyword[new] identifier[StructTypeID] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numElems] operator[=] identifier[rin] operator[SEP] identifier[readInt] operator[SEP] identifier[tag] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numElems] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[stID] operator[SEP] identifier[add] operator[SEP] identifier[genericReadTypeInfo] operator[SEP] identifier[rin] , identifier[tag] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[stID] operator[SEP]
}
Keyword[case] identifier[TypeID] operator[SEP] identifier[RIOType] operator[SEP] identifier[VECTOR] operator[:] {
identifier[TypeID] identifier[tID] operator[=] identifier[genericReadTypeID] operator[SEP] identifier[rin] , identifier[tag] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[VectorTypeID] operator[SEP] identifier[tID] operator[SEP] operator[SEP]
}
Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
static String removeExtraneousSlashes(String s) {
int lastNonSlash = NON_SLASH_MATCHER.lastIndexIn(s);
if (lastNonSlash != -1) {
s = s.substring(0, lastNonSlash + 1);
}
return SLASH_MATCHER.collapseFrom(s, '/');
} | class class_name[name] begin[{]
method[removeExtraneousSlashes, return_type[type[String]], modifier[static], parameter[s]] begin[{]
local_variable[type[int], lastNonSlash]
if[binary_operation[member[.lastNonSlash], !=, literal[1]]] begin[{]
assign[member[.s], call[s.substring, parameter[literal[0], binary_operation[member[.lastNonSlash], +, literal[1]]]]]
else begin[{]
None
end[}]
return[call[SLASH_MATCHER.collapseFrom, parameter[member[.s], literal['/']]]]
end[}]
END[}] | Keyword[static] identifier[String] identifier[removeExtraneousSlashes] operator[SEP] identifier[String] identifier[s] operator[SEP] {
Keyword[int] identifier[lastNonSlash] operator[=] identifier[NON_SLASH_MATCHER] operator[SEP] identifier[lastIndexIn] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastNonSlash] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[s] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastNonSlash] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[return] identifier[SLASH_MATCHER] operator[SEP] identifier[collapseFrom] operator[SEP] identifier[s] , literal[String] operator[SEP] operator[SEP]
}
|
public void execute(FunctionContext<Object> fc)
{
ResultSender<Object> rs = fc.getResultSender();
try
{
boolean results = false;
if (fc instanceof RegionFunctionContext)
{
results = importOnRegion((RegionFunctionContext) fc);
} else
{
results = importAllRegions(fc);
}
rs.lastResult(results);
}
catch (Exception e)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
LogManager.getLogger(getClass()).error(sw.toString());
rs.sendException(e);
}
} | class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[fc]] begin[{]
local_variable[type[ResultSender], rs]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=results)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RegionFunctionContext, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=fc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=importAllRegions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=fc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RegionFunctionContext, sub_type=None))], member=importOnRegion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lastResult, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(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=StringWriter, sub_type=None)), name=sw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringWriter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=sw, 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=PrintWriter, sub_type=None)), name=pw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PrintWriter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=LogManager, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sw, selectors=[], type_arguments=None)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendException, postfix_operators=[], prefix_operators=[], qualifier=rs, 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[void] identifier[execute] operator[SEP] identifier[FunctionContext] operator[<] identifier[Object] operator[>] identifier[fc] operator[SEP] {
identifier[ResultSender] operator[<] identifier[Object] operator[>] identifier[rs] operator[=] identifier[fc] operator[SEP] identifier[getResultSender] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[boolean] identifier[results] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[fc] Keyword[instanceof] identifier[RegionFunctionContext] operator[SEP] {
identifier[results] operator[=] identifier[importOnRegion] operator[SEP] operator[SEP] identifier[RegionFunctionContext] operator[SEP] identifier[fc] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[results] operator[=] identifier[importAllRegions] operator[SEP] identifier[fc] operator[SEP] operator[SEP]
}
identifier[rs] operator[SEP] identifier[lastResult] operator[SEP] identifier[results] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[StringWriter] identifier[sw] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[pw] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] identifier[sw] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[pw] operator[SEP] operator[SEP] identifier[LogManager] operator[SEP] identifier[getLogger] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[sw] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rs] operator[SEP] identifier[sendException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE__ARGUMENTS:
return getArguments();
case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE:
if (resolve) return getType();
return basicGetType();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=JVM_PARAMETERIZED_TYPE_REFERENCE__ARGUMENTS, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getArguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[IfStatement(condition=MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=basicGetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_PARAMETERIZED_TYPE_REFERENCE__ARGUMENTS] operator[:] Keyword[return] identifier[getArguments] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE] operator[:] Keyword[if] operator[SEP] identifier[resolve] operator[SEP] Keyword[return] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[basicGetType] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
@Override
public Constant getVal(String fldname) {
if (groupFlds.contains(fldname))
return groupVal.getVal(fldname);
if (aggFns != null)
for (AggregationFn fn : aggFns)
if (fn.fieldName().equals(fldname))
return fn.value();
throw new RuntimeException("field " + fldname + " not found.");
} | class class_name[name] begin[{]
method[getVal, return_type[type[Constant]], modifier[public], parameter[fldname]] begin[{]
if[call[groupFlds.contains, parameter[member[.fldname]]]] begin[{]
return[call[groupVal.getVal, parameter[member[.fldname]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.aggFns], !=, literal[null]]] begin[{]
ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[], member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=fn, selectors=[MethodInvocation(arguments=[MemberReference(member=fldname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=fn, selectors=[], type_arguments=None), label=None)), control=EnhancedForControl(iterable=MemberReference(member=aggFns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AggregationFn, sub_type=None))), label=None)
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="field "), operandr=MemberReference(member=fldname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not found."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Constant] identifier[getVal] operator[SEP] identifier[String] identifier[fldname] operator[SEP] {
Keyword[if] operator[SEP] identifier[groupFlds] operator[SEP] identifier[contains] operator[SEP] identifier[fldname] operator[SEP] operator[SEP] Keyword[return] identifier[groupVal] operator[SEP] identifier[getVal] operator[SEP] identifier[fldname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aggFns] operator[!=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[AggregationFn] identifier[fn] operator[:] identifier[aggFns] operator[SEP] Keyword[if] operator[SEP] identifier[fn] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[fldname] operator[SEP] operator[SEP] Keyword[return] identifier[fn] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[fldname] operator[+] literal[String] operator[SEP] operator[SEP]
}
|
public boolean isSessionBean() // d121556
{
return type == InternalConstants.TYPE_SINGLETON_SESSION ||
type == InternalConstants.TYPE_STATELESS_SESSION ||
type == InternalConstants.TYPE_STATEFUL_SESSION;
} | class class_name[name] begin[{]
method[isSessionBean, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
return[binary_operation[binary_operation[binary_operation[member[.type], ==, member[InternalConstants.TYPE_SINGLETON_SESSION]], ||, binary_operation[member[.type], ==, member[InternalConstants.TYPE_STATELESS_SESSION]]], ||, binary_operation[member[.type], ==, member[InternalConstants.TYPE_STATEFUL_SESSION]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isSessionBean] operator[SEP] operator[SEP] {
Keyword[return] identifier[type] operator[==] identifier[InternalConstants] operator[SEP] identifier[TYPE_SINGLETON_SESSION] operator[||] identifier[type] operator[==] identifier[InternalConstants] operator[SEP] identifier[TYPE_STATELESS_SESSION] operator[||] identifier[type] operator[==] identifier[InternalConstants] operator[SEP] identifier[TYPE_STATEFUL_SESSION] operator[SEP]
}
|
@Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLAnnotationImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | class class_name[name] begin[{]
method[serializeInstance, return_type[void], modifier[public], parameter[streamWriter, instance]] begin[{]
call[.serialize, parameter[member[.streamWriter], member[.instance]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[serializeInstance] operator[SEP] identifier[SerializationStreamWriter] identifier[streamWriter] , identifier[OWLAnnotationImpl] identifier[instance] operator[SEP] Keyword[throws] identifier[SerializationException] {
identifier[serialize] operator[SEP] identifier[streamWriter] , identifier[instance] operator[SEP] operator[SEP]
}
|
@Override
public boolean isFlowRunning(final int projectId, final String flowId) {
boolean isRunning = false;
try {
isRunning = isFlowRunningHelper(projectId, flowId,
this.executorLoader.fetchUnfinishedFlows().values());
} catch (final ExecutorManagerException e) {
logger.error(
"Failed to check if the flow is running for project " + projectId + ", flow " + flowId,
e);
}
return isRunning;
} | class class_name[name] begin[{]
method[isFlowRunning, return_type[type[boolean]], modifier[public], parameter[projectId, flowId]] begin[{]
local_variable[type[boolean], isRunning]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isRunning, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flowId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=executorLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=fetchUnfinishedFlows, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=isFlowRunningHelper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to check if the flow is running for project "), operandr=MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", flow "), operator=+), operandr=MemberReference(member=flowId, 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=['ExecutorManagerException']))], finally_block=None, label=None, resources=None)
return[member[.isRunning]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isFlowRunning] operator[SEP] Keyword[final] Keyword[int] identifier[projectId] , Keyword[final] identifier[String] identifier[flowId] operator[SEP] {
Keyword[boolean] identifier[isRunning] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[isRunning] operator[=] identifier[isFlowRunningHelper] operator[SEP] identifier[projectId] , identifier[flowId] , Keyword[this] operator[SEP] identifier[executorLoader] operator[SEP] identifier[fetchUnfinishedFlows] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[ExecutorManagerException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[projectId] operator[+] literal[String] operator[+] identifier[flowId] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[isRunning] operator[SEP]
}
|
void registerTaskStarted(Task task) {
synchronized (m_activeTasks) {
String mapKey = createMapKey(task.getTenant(), task.getTaskID());
if (m_activeTasks.put(mapKey, task) != null) {
m_logger.warn("Task {} registered as started but was already running", mapKey);
}
}
} | class class_name[name] begin[{]
method[registerTaskStarted, return_type[void], modifier[default], parameter[task]] begin[{]
SYNCHRONIZED[member[.m_activeTasks]] BEGIN[{]
local_variable[type[String], mapKey]
if[binary_operation[call[m_activeTasks.put, parameter[member[.mapKey], member[.task]]], !=, literal[null]]] begin[{]
call[m_logger.warn, parameter[literal["Task {} registered as started but was already running"], member[.mapKey]]]
else begin[{]
None
end[}]
END[}]
end[}]
END[}] | Keyword[void] identifier[registerTaskStarted] operator[SEP] identifier[Task] identifier[task] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[m_activeTasks] operator[SEP] {
identifier[String] identifier[mapKey] operator[=] identifier[createMapKey] operator[SEP] identifier[task] operator[SEP] identifier[getTenant] operator[SEP] operator[SEP] , identifier[task] operator[SEP] identifier[getTaskID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_activeTasks] operator[SEP] identifier[put] operator[SEP] identifier[mapKey] , identifier[task] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[m_logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[mapKey] operator[SEP] operator[SEP]
}
}
}
|
public boolean remove(Object objectToRemove, int hash) {
checkNotNull(objectToRemove);
int index = hash & mask;
// using the hashes array for looping and comparison if possible, hence we're cache friendly
while (hashes[index] != 0 || table[index] != null) {
if (hash == hashes[index] && objectToRemove.equals(table[index])) {
removeFromIndex(index);
return true;
}
index = ++index & mask;
}
return false;
} | class class_name[name] begin[{]
method[remove, return_type[type[boolean]], modifier[public], parameter[objectToRemove, hash]] begin[{]
call[.checkNotNull, parameter[member[.objectToRemove]]]
local_variable[type[int], index]
while[binary_operation[binary_operation[member[.hashes], !=, literal[0]], ||, binary_operation[member[.table], !=, literal[null]]]] begin[{]
if[binary_operation[binary_operation[member[.hash], ==, member[.hashes]], &&, call[objectToRemove.equals, parameter[member[.table]]]]] begin[{]
call[.removeFromIndex, parameter[member[.index]]]
return[literal[true]]
else begin[{]
None
end[}]
assign[member[.index], binary_operation[member[.index], &, member[.mask]]]
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[remove] operator[SEP] identifier[Object] identifier[objectToRemove] , Keyword[int] identifier[hash] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[objectToRemove] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[hash] operator[&] identifier[mask] operator[SEP] Keyword[while] operator[SEP] identifier[hashes] operator[SEP] identifier[index] operator[SEP] operator[!=] Other[0] operator[||] identifier[table] operator[SEP] identifier[index] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[hash] operator[==] identifier[hashes] operator[SEP] identifier[index] operator[SEP] operator[&&] identifier[objectToRemove] operator[SEP] identifier[equals] operator[SEP] identifier[table] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] {
identifier[removeFromIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[index] operator[=] operator[++] identifier[index] operator[&] identifier[mask] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
protected boolean withinLimit(Integer limit, Collection<?> collection) {
if (limit == null) {
return true;
} else {
int value = limit.intValue();
return value <= 0 || value > collection.size();
}
} | class class_name[name] begin[{]
method[withinLimit, return_type[type[boolean]], modifier[protected], parameter[limit, collection]] begin[{]
if[binary_operation[member[.limit], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
local_variable[type[int], value]
return[binary_operation[binary_operation[member[.value], <=, literal[0]], ||, binary_operation[member[.value], >, call[collection.size, parameter[]]]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[boolean] identifier[withinLimit] operator[SEP] identifier[Integer] identifier[limit] , identifier[Collection] operator[<] operator[?] operator[>] identifier[collection] operator[SEP] {
Keyword[if] operator[SEP] identifier[limit] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[int] identifier[value] operator[=] identifier[limit] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[<=] Other[0] operator[||] identifier[value] operator[>] identifier[collection] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static void tputs(Writer out, String str, Object... params) throws IOException {
int index = 0;
int length = str.length();
int ifte = IFTE_NONE;
boolean exec = true;
Stack<Object> stack = new Stack<Object>();
while (index < length) {
char ch = str.charAt(index++);
switch (ch) {
case '\\':
ch = str.charAt(index++);
if (ch >= '0' && ch <= '9') {
throw new UnsupportedOperationException(); // todo
} else {
switch (ch) {
case 'e':
case 'E':
if (exec) {
out.write(27); // escape
}
break;
case 'n':
out.write('\n');
break;
// case 'l':
// rawPrint('\l');
// break;
case 'r':
if (exec) {
out.write('\r');
}
break;
case 't':
if (exec) {
out.write('\t');
}
break;
case 'b':
if (exec) {
out.write('\b');
}
break;
case 'f':
if (exec) {
out.write('\f');
}
break;
case 's':
if (exec) {
out.write(' ');
}
break;
case ':':
case '^':
case '\\':
if (exec) {
out.write(ch);
}
break;
default:
throw new IllegalArgumentException();
}
}
break;
case '^':
ch = str.charAt(index++);
if (exec) {
out.write(ch - '@');
}
break;
case '%':
ch = str.charAt(index++);
switch (ch) {
case '%':
if (exec) {
out.write('%');
}
break;
case 'p':
ch = str.charAt(index++);
if (exec) {
stack.push(params[ch - '1']);
}
break;
case 'P':
ch = str.charAt(index++);
if (ch >= 'a' && ch <= 'z') {
if (exec) {
dv[ch - 'a'] = stack.pop();
}
} else if (ch >= 'A' && ch <= 'Z') {
if (exec) {
sv[ch - 'A'] = stack.pop();
}
} else {
throw new IllegalArgumentException();
}
break;
case 'g':
ch = str.charAt(index++);
if (ch >= 'a' && ch <= 'z') {
if (exec) {
stack.push(dv[ch - 'a']);
}
} else if (ch >= 'A' && ch <= 'Z') {
if (exec) {
stack.push(sv[ch - 'A']);
}
} else {
throw new IllegalArgumentException();
}
break;
case '\'':
ch = str.charAt(index++);
if (exec) {
stack.push((int) ch);
}
ch = str.charAt(index++);
if (ch != '\'') {
throw new IllegalArgumentException();
}
break;
case '{':
int start = index;
while (str.charAt(index++) != '}');
if (exec) {
int v = Integer.valueOf(str.substring(start, index - 1));
stack.push(v);
}
break;
case 'l':
if (exec) {
stack.push(stack.pop().toString().length());
}
break;
case '+':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 + v2);
}
break;
case '-':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 - v2);
}
break;
case '*':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 * v2);
}
break;
case '/':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 / v2);
}
break;
case 'm':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 % v2);
}
break;
case '&':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 & v2);
}
break;
case '|':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 | v2);
}
break;
case '^':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 ^ v2);
}
break;
case '=':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 == v2);
}
break;
case '>':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 > v2);
}
break;
case '<':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 < v2);
}
break;
case 'A':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 != 0 && v2 != 0);
}
break;
case '!':
if (exec) {
int v1 = toInteger(stack.pop());
stack.push(v1 == 0);
}
break;
case '~':
if (exec) {
int v1 = toInteger(stack.pop());
stack.push(~v1);
}
break;
case 'O':
if (exec) {
int v2 = toInteger(stack.pop());
int v1 = toInteger(stack.pop());
stack.push(v1 != 0 || v2 != 0);
}
break;
case '?':
if (ifte != IFTE_NONE) {
throw new IllegalArgumentException();
} else {
ifte = IFTE_IF;
}
break;
case 't':
if (ifte != IFTE_IF && ifte != IFTE_ELSE) {
throw new IllegalArgumentException();
} else {
ifte = IFTE_THEN;
}
exec = toInteger(stack.pop()) != 0;
break;
case 'e':
if (ifte != IFTE_THEN) {
throw new IllegalArgumentException();
} else {
ifte = IFTE_ELSE;
}
exec = !exec;
break;
case ';':
if (ifte == IFTE_NONE || ifte == IFTE_IF) {
throw new IllegalArgumentException();
} else {
ifte = IFTE_NONE;
}
exec = true;
break;
case 'i':
if (params.length >= 1) {
params[0] = toInteger(params[0]) + 1;
}
if (params.length >= 2) {
params[1] = toInteger(params[1]) + 1;
}
break;
case 'd':
out.write(Integer.toString(toInteger(stack.pop())));
break;
default:
throw new UnsupportedOperationException();
}
break;
case '$':
if (str.charAt(index) == '<') {
// We don't honour delays, just skip
while (str.charAt(index++) != '>');
} else {
if (exec) {
out.write(ch);
}
}
break;
default:
if (exec) {
out.write(ch);
}
break;
}
}
} | class class_name[name] begin[{]
method[tputs, return_type[void], modifier[public static], parameter[out, str, params]] begin[{]
local_variable[type[int], index]
local_variable[type[int], length]
local_variable[type[int], ifte]
local_variable[type[boolean], exec]
local_variable[type[Stack], stack]
while[binary_operation[member[.index], <, member[.length]]] begin[{]
local_variable[type[char], ch]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), else_statement=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='e'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='E')], statements=[IfStatement(condition=MemberReference(member=exec, 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=27)], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r')], statements=[IfStatement(condition=MemberReference(member=exec, 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='\r')], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t')], statements=[IfStatement(condition=MemberReference(member=exec, 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='\t')], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b')], statements=[IfStatement(condition=MemberReference(member=exec, 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='\b')], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], statements=[IfStatement(condition=MemberReference(member=exec, 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='\f')], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='s')], statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), 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='\\')], statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(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)])], expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='^')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='@'), operator=-)], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')], statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='p')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='1'), operator=-))])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='P')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='z'), operator=<=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Z'), operator=<=), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(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, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=-))]), type==, value=MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=-))]), type==, value=MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)), label=None)]))])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='g')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='z'), operator=<=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Z'), operator=<=), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(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, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=-))])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=-))])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)]))])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\''), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(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)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{')], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=start)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=Statement(label=None), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='}'), operator=!=), label=None), IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='l')], statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='m')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='|')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='^')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=^)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='=')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='<')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operator=&&)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='!')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='~')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=v1, postfix_operators=[], prefix_operators=['~'], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='O')], statements=[IfStatement(condition=MemberReference(member=exec, 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=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operator=||)], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='?')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IFTE_NONE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=IFTE_IF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(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)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t')], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IFTE_IF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IFTE_ELSE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=IFTE_THEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(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)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='e')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IFTE_THEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=IFTE_ELSE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(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)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=exec, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';')], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IFTE_NONE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IFTE_IF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ifte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=IFTE_NONE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(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)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='i')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='d')], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=toInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)])], expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='$')], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='<'), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[WhileStatement(body=Statement(label=None), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>'), operator=!=), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=MemberReference(member=exec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[tputs] operator[SEP] identifier[Writer] identifier[out] , identifier[String] identifier[str] , identifier[Object] operator[...] identifier[params] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ifte] operator[=] identifier[IFTE_NONE] operator[SEP] Keyword[boolean] identifier[exec] operator[=] literal[boolean] operator[SEP] identifier[Stack] operator[<] identifier[Object] operator[>] identifier[stack] operator[=] Keyword[new] identifier[Stack] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[index] operator[<] identifier[length] operator[SEP] {
Keyword[char] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[ch] operator[SEP] {
Keyword[case] literal[String] operator[:] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[switch] operator[SEP] identifier[ch] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] Other[27] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[ch] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[ch] operator[-] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[ch] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[params] operator[SEP] identifier[ch] operator[-] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[dv] operator[SEP] identifier[ch] operator[-] literal[String] operator[SEP] operator[=] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[sv] operator[SEP] identifier[ch] operator[-] literal[String] operator[SEP] operator[=] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[dv] operator[SEP] identifier[ch] operator[-] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[sv] operator[SEP] identifier[ch] operator[-] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[stack] operator[SEP] identifier[push] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[ch] operator[SEP] operator[SEP]
}
identifier[ch] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[!=] literal[String] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[int] identifier[start] operator[=] identifier[index] operator[SEP] Keyword[while] operator[SEP] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[!=] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[index] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[+] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[-] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[*] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[/] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[%] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[&] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[|] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[^] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[==] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[>] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[<] identifier[v2] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[!=] Other[0] operator[&&] identifier[v2] operator[!=] Other[0] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[==] Other[0] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] operator[~] identifier[v1] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
Keyword[int] identifier[v2] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v1] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[v1] operator[!=] Other[0] operator[||] identifier[v2] operator[!=] Other[0] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[ifte] operator[!=] identifier[IFTE_NONE] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ifte] operator[=] identifier[IFTE_IF] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[ifte] operator[!=] identifier[IFTE_IF] operator[&&] identifier[ifte] operator[!=] identifier[IFTE_ELSE] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ifte] operator[=] identifier[IFTE_THEN] operator[SEP]
}
identifier[exec] operator[=] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[ifte] operator[!=] identifier[IFTE_THEN] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ifte] operator[=] identifier[IFTE_ELSE] operator[SEP]
}
identifier[exec] operator[=] operator[!] identifier[exec] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[ifte] operator[==] identifier[IFTE_NONE] operator[||] identifier[ifte] operator[==] identifier[IFTE_IF] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ifte] operator[=] identifier[IFTE_NONE] operator[SEP]
}
identifier[exec] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[length] operator[>=] Other[1] operator[SEP] {
identifier[params] operator[SEP] Other[0] operator[SEP] operator[=] identifier[toInteger] operator[SEP] identifier[params] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP]
}
Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[length] operator[>=] Other[2] operator[SEP] {
identifier[params] operator[SEP] Other[1] operator[SEP] operator[=] identifier[toInteger] operator[SEP] identifier[params] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[toInteger] operator[SEP] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[SEP] operator[==] literal[String] operator[SEP] {
Keyword[while] operator[SEP] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[++] operator[SEP] operator[!=] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[ch] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[exec] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[ch] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
}
}
|
protected JsonWriter value(@NonNull Object[] array) throws IOException {
return value(Arrays.asList(array));
} | class class_name[name] begin[{]
method[value, return_type[type[JsonWriter]], modifier[protected], parameter[array]] begin[{]
return[call[.value, parameter[call[Arrays.asList, parameter[member[.array]]]]]]
end[}]
END[}] | Keyword[protected] identifier[JsonWriter] identifier[value] operator[SEP] annotation[@] identifier[NonNull] identifier[Object] operator[SEP] operator[SEP] identifier[array] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[value] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public final void onOpen( @Nonnull final WebSocket webSocket )
{
_eventBus.fireEventFromSource( new OpenEvent( webSocket ), webSocket );
} | class class_name[name] begin[{]
method[onOpen, return_type[void], modifier[final public], parameter[webSocket]] begin[{]
call[_eventBus.fireEventFromSource, parameter[ClassCreator(arguments=[MemberReference(member=webSocket, 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=OpenEvent, sub_type=None)), member[.webSocket]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[onOpen] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[WebSocket] identifier[webSocket] operator[SEP] {
identifier[_eventBus] operator[SEP] identifier[fireEventFromSource] operator[SEP] Keyword[new] identifier[OpenEvent] operator[SEP] identifier[webSocket] operator[SEP] , identifier[webSocket] operator[SEP] operator[SEP]
}
|
public void setAccountIdsToRemove(java.util.Collection<String> accountIdsToRemove) {
if (accountIdsToRemove == null) {
this.accountIdsToRemove = null;
return;
}
this.accountIdsToRemove = new com.amazonaws.internal.SdkInternalList<String>(accountIdsToRemove);
} | class class_name[name] begin[{]
method[setAccountIdsToRemove, return_type[void], modifier[public], parameter[accountIdsToRemove]] begin[{]
if[binary_operation[member[.accountIdsToRemove], ==, literal[null]]] begin[{]
assign[THIS[member[None.accountIdsToRemove]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.accountIdsToRemove]], ClassCreator(arguments=[MemberReference(member=accountIdsToRemove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setAccountIdsToRemove] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[accountIdsToRemove] operator[SEP] {
Keyword[if] operator[SEP] identifier[accountIdsToRemove] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[accountIdsToRemove] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[accountIdsToRemove] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[accountIdsToRemove] operator[SEP] operator[SEP]
}
|
@UiThread
public T create(S options) {
T t = options.build(currentId, this);
annotations.put(t.getId(), t);
currentId++;
updateSource();
return t;
} | class class_name[name] begin[{]
method[create, return_type[type[T]], modifier[public], parameter[options]] begin[{]
local_variable[type[T], t]
call[annotations.put, parameter[call[t.getId, parameter[]], member[.t]]]
member[.currentId]
call[.updateSource, parameter[]]
return[member[.t]]
end[}]
END[}] | annotation[@] identifier[UiThread] Keyword[public] identifier[T] identifier[create] operator[SEP] identifier[S] identifier[options] operator[SEP] {
identifier[T] identifier[t] operator[=] identifier[options] operator[SEP] identifier[build] operator[SEP] identifier[currentId] , Keyword[this] operator[SEP] operator[SEP] identifier[annotations] operator[SEP] identifier[put] operator[SEP] identifier[t] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[t] operator[SEP] operator[SEP] identifier[currentId] operator[++] operator[SEP] identifier[updateSource] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP]
}
|
@SuppressWarnings("rawtypes")
protected List cacheLoadOrStore(List<Object> loadedObjects) {
if (loadedObjects.isEmpty()) {
return loadedObjects;
}
if (!(loadedObjects.get(0) instanceof Entity)) {
return loadedObjects;
}
List<Entity> filteredObjects = new ArrayList<Entity>(loadedObjects.size());
for (Object loadedObject : loadedObjects) {
Entity cachedEntity = cacheLoadOrStore((Entity) loadedObject);
filteredObjects.add(cachedEntity);
}
return filteredObjects;
} | class class_name[name] begin[{]
method[cacheLoadOrStore, return_type[type[List]], modifier[protected], parameter[loadedObjects]] begin[{]
if[call[loadedObjects.isEmpty, parameter[]]] begin[{]
return[member[.loadedObjects]]
else begin[{]
None
end[}]
if[binary_operation[call[loadedObjects.get, parameter[literal[0]]], instanceof, type[Entity]]] begin[{]
return[member[.loadedObjects]]
else begin[{]
None
end[}]
local_variable[type[List], filteredObjects]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=loadedObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Entity, sub_type=None))], member=cacheLoadOrStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=cachedEntity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entity, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cachedEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=filteredObjects, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=loadedObjects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=loadedObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[member[.filteredObjects]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] identifier[List] identifier[cacheLoadOrStore] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] identifier[loadedObjects] operator[SEP] {
Keyword[if] operator[SEP] identifier[loadedObjects] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[loadedObjects] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[loadedObjects] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Entity] operator[SEP] operator[SEP] {
Keyword[return] identifier[loadedObjects] operator[SEP]
}
identifier[List] operator[<] identifier[Entity] operator[>] identifier[filteredObjects] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Entity] operator[>] operator[SEP] identifier[loadedObjects] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[loadedObject] operator[:] identifier[loadedObjects] operator[SEP] {
identifier[Entity] identifier[cachedEntity] operator[=] identifier[cacheLoadOrStore] operator[SEP] operator[SEP] identifier[Entity] operator[SEP] identifier[loadedObject] operator[SEP] operator[SEP] identifier[filteredObjects] operator[SEP] identifier[add] operator[SEP] identifier[cachedEntity] operator[SEP] operator[SEP]
}
Keyword[return] identifier[filteredObjects] operator[SEP]
}
|
@Override
public <T2, R1, R2, R3, R> Future<R> forEach4(Function<? super T, ? extends MonadicValue<R1>> value1,
BiFunction<? super T, ? super R1, ? extends MonadicValue<R2>> value2,
Function3<? super T, ? super R1, ? super R2, ? extends MonadicValue<R3>> value3,
Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {
return (Future<R>)MonadicValue.super.forEach4(value1, value2, value3, yieldingFunction);
} | class class_name[name] begin[{]
method[forEach4, return_type[type[Future]], modifier[public], parameter[value1, value2, value3, yieldingFunction]] begin[{]
return[Cast(expression=MemberReference(member=MonadicValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[SuperMethodInvocation(arguments=[MemberReference(member=value1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=yieldingFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forEach4, 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=R, sub_type=None))], dimensions=[], name=Future, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T2] , identifier[R1] , identifier[R2] , identifier[R3] , identifier[R] operator[>] identifier[Future] operator[<] identifier[R] operator[>] identifier[forEach4] operator[SEP] identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[MonadicValue] operator[<] identifier[R1] operator[>] operator[>] identifier[value1] , identifier[BiFunction] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[super] identifier[R1] , operator[?] Keyword[extends] identifier[MonadicValue] operator[<] identifier[R2] operator[>] operator[>] identifier[value2] , identifier[Function3] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[super] identifier[R1] , operator[?] Keyword[super] identifier[R2] , operator[?] Keyword[extends] identifier[MonadicValue] operator[<] identifier[R3] operator[>] operator[>] identifier[value3] , identifier[Function4] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[super] identifier[R1] , operator[?] Keyword[super] identifier[R2] , operator[?] Keyword[super] identifier[R3] , operator[?] Keyword[extends] identifier[R] operator[>] identifier[yieldingFunction] operator[SEP] {
Keyword[return] operator[SEP] identifier[Future] operator[<] identifier[R] operator[>] operator[SEP] identifier[MonadicValue] operator[SEP] Keyword[super] operator[SEP] identifier[forEach4] operator[SEP] identifier[value1] , identifier[value2] , identifier[value3] , identifier[yieldingFunction] operator[SEP] operator[SEP]
}
|
public static Path removeExtension(Path path, String... extensions) {
String pathString = path.toString();
for (String extension : extensions) {
pathString = StringUtils.remove(pathString, extension);
}
return new Path(pathString);
} | class class_name[name] begin[{]
method[removeExtension, return_type[type[Path]], modifier[public static], parameter[path, extensions]] begin[{]
local_variable[type[String], pathString]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pathString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=pathString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=extension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=extensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=extension)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[ClassCreator(arguments=[MemberReference(member=pathString, 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=Path, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Path] identifier[removeExtension] operator[SEP] identifier[Path] identifier[path] , identifier[String] operator[...] identifier[extensions] operator[SEP] {
identifier[String] identifier[pathString] operator[=] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[extension] operator[:] identifier[extensions] operator[SEP] {
identifier[pathString] operator[=] identifier[StringUtils] operator[SEP] identifier[remove] operator[SEP] identifier[pathString] , identifier[extension] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[Path] operator[SEP] identifier[pathString] operator[SEP] operator[SEP]
}
|
@Pure
@Inline(value="$1.pow($2)")
public static BigDecimal operator_power(BigDecimal a, int exponent) {
return a.pow(exponent);
} | class class_name[name] begin[{]
method[operator_power, return_type[type[BigDecimal]], modifier[public static], parameter[a, exponent]] begin[{]
return[call[a.pow, parameter[member[.exponent]]]]
end[}]
END[}] | annotation[@] identifier[Pure] annotation[@] identifier[Inline] operator[SEP] identifier[value] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[BigDecimal] identifier[operator_power] operator[SEP] identifier[BigDecimal] identifier[a] , Keyword[int] identifier[exponent] operator[SEP] {
Keyword[return] identifier[a] operator[SEP] identifier[pow] operator[SEP] identifier[exponent] operator[SEP] operator[SEP]
}
|
private int findChild(L child, float depth) {
// findInsertion will find us some element with the same depth as the to-be-removed child
int startIdx = findInsertion(depth);
// search down for our child
for (int ii = startIdx-1; ii >= 0; ii--) {
L c = children.get(ii);
if (c == child) {
return ii;
}
if (c.depth() != depth) {
break;
}
}
// search up for our child
for (int ii = startIdx, ll = children.size(); ii < ll; ii++) {
L c = children.get(ii);
if (c == child) {
return ii;
}
if (c.depth() != depth) {
break;
}
}
return -1;
} | class class_name[name] begin[{]
method[findChild, return_type[type[int]], modifier[private], parameter[child, depth]] begin[{]
local_variable[type[int], startIdx]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=L, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=depth, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operandr=MemberReference(member=depth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, 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=MemberReference(member=startIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=L, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=depth, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operandr=MemberReference(member=depth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=startIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=ii), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=ll)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[1]]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[findChild] operator[SEP] identifier[L] identifier[child] , Keyword[float] identifier[depth] operator[SEP] {
Keyword[int] identifier[startIdx] operator[=] identifier[findInsertion] operator[SEP] identifier[depth] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] identifier[startIdx] operator[-] Other[1] operator[SEP] identifier[ii] operator[>=] Other[0] operator[SEP] identifier[ii] operator[--] operator[SEP] {
identifier[L] identifier[c] operator[=] identifier[children] operator[SEP] identifier[get] operator[SEP] identifier[ii] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[child] operator[SEP] {
Keyword[return] identifier[ii] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[depth] operator[SEP] operator[SEP] operator[!=] identifier[depth] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] identifier[startIdx] , identifier[ll] operator[=] identifier[children] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[ii] operator[<] identifier[ll] operator[SEP] identifier[ii] operator[++] operator[SEP] {
identifier[L] identifier[c] operator[=] identifier[children] operator[SEP] identifier[get] operator[SEP] identifier[ii] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[child] operator[SEP] {
Keyword[return] identifier[ii] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[depth] operator[SEP] operator[SEP] operator[!=] identifier[depth] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[return] operator[-] Other[1] operator[SEP]
}
|
public static Map<URLParts, String> splitURL(String URLString) {
try {
return splitURL(new URL(URLString));
}
catch (MalformedURLException ex) {
throw new RuntimeException(ex);
}
} | class class_name[name] begin[{]
method[splitURL, return_type[type[Map]], modifier[public static], parameter[URLString]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=URLString, 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=URL, sub_type=None))], member=splitURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['MalformedURLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[URLParts] , identifier[String] operator[>] identifier[splitURL] operator[SEP] identifier[String] identifier[URLString] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[splitURL] operator[SEP] Keyword[new] identifier[URL] operator[SEP] identifier[URLString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
}
|
public static base_response update(nitro_service client, vridparam resource) throws Exception {
vridparam updateresource = new vridparam();
updateresource.sendtomaster = resource.sendtomaster;
return updateresource.update_resource(client);
} | class class_name[name] begin[{]
method[update, return_type[type[base_response]], modifier[public static], parameter[client, resource]] begin[{]
local_variable[type[vridparam], updateresource]
assign[member[updateresource.sendtomaster], member[resource.sendtomaster]]
return[call[updateresource.update_resource, parameter[member[.client]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[base_response] identifier[update] operator[SEP] identifier[nitro_service] identifier[client] , identifier[vridparam] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[vridparam] identifier[updateresource] operator[=] Keyword[new] identifier[vridparam] operator[SEP] operator[SEP] operator[SEP] identifier[updateresource] operator[SEP] identifier[sendtomaster] operator[=] identifier[resource] operator[SEP] identifier[sendtomaster] operator[SEP] Keyword[return] identifier[updateresource] operator[SEP] identifier[update_resource] operator[SEP] identifier[client] operator[SEP] operator[SEP]
}
|
public static final Function<Double,String> toCurrencyStr() {
return (Function<Double,String>)((Function)FnNumber.toCurrencyStr());
} | class class_name[name] begin[{]
method[toCurrencyStr, return_type[type[Function]], modifier[final public static], parameter[]] begin[{]
return[Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=toCurrencyStr, postfix_operators=[], prefix_operators=[], qualifier=FnNumber, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Function, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Function, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[Function] operator[<] identifier[Double] , identifier[String] operator[>] identifier[toCurrencyStr] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[Function] operator[<] identifier[Double] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Function] operator[SEP] identifier[FnNumber] operator[SEP] identifier[toCurrencyStr] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Matrix4x3f translationRotate(float tx, float ty, float tz, Quaternionfc quat) {
float dqx = quat.x() + quat.x();
float dqy = quat.y() + quat.y();
float dqz = quat.z() + quat.z();
float q00 = dqx * quat.x();
float q11 = dqy * quat.y();
float q22 = dqz * quat.z();
float q01 = dqx * quat.y();
float q02 = dqx * quat.z();
float q03 = dqx * quat.w();
float q12 = dqy * quat.z();
float q13 = dqy * quat.w();
float q23 = dqz * quat.w();
m00 = 1.0f - (q11 + q22);
m01 = q01 + q23;
m02 = q02 - q13;
m10 = q01 - q23;
m11 = 1.0f - (q22 + q00);
m12 = q12 + q03;
m20 = q02 + q13;
m21 = q12 - q03;
m22 = 1.0f - (q11 + q00);
m30 = tx;
m31 = ty;
m32 = tz;
properties = PROPERTY_ORTHONORMAL;
return this;
} | class class_name[name] begin[{]
method[translationRotate, return_type[type[Matrix4x3f]], modifier[public], parameter[tx, ty, tz, quat]] begin[{]
local_variable[type[float], dqx]
local_variable[type[float], dqy]
local_variable[type[float], dqz]
local_variable[type[float], q00]
local_variable[type[float], q11]
local_variable[type[float], q22]
local_variable[type[float], q01]
local_variable[type[float], q02]
local_variable[type[float], q03]
local_variable[type[float], q12]
local_variable[type[float], q13]
local_variable[type[float], q23]
assign[member[.m00], binary_operation[literal[1.0f], -, binary_operation[member[.q11], +, member[.q22]]]]
assign[member[.m01], binary_operation[member[.q01], +, member[.q23]]]
assign[member[.m02], binary_operation[member[.q02], -, member[.q13]]]
assign[member[.m10], binary_operation[member[.q01], -, member[.q23]]]
assign[member[.m11], binary_operation[literal[1.0f], -, binary_operation[member[.q22], +, member[.q00]]]]
assign[member[.m12], binary_operation[member[.q12], +, member[.q03]]]
assign[member[.m20], binary_operation[member[.q02], +, member[.q13]]]
assign[member[.m21], binary_operation[member[.q12], -, member[.q03]]]
assign[member[.m22], binary_operation[literal[1.0f], -, binary_operation[member[.q11], +, member[.q00]]]]
assign[member[.m30], member[.tx]]
assign[member[.m31], member[.ty]]
assign[member[.m32], member[.tz]]
assign[member[.properties], member[.PROPERTY_ORTHONORMAL]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Matrix4x3f] identifier[translationRotate] operator[SEP] Keyword[float] identifier[tx] , Keyword[float] identifier[ty] , Keyword[float] identifier[tz] , identifier[Quaternionfc] identifier[quat] operator[SEP] {
Keyword[float] identifier[dqx] operator[=] identifier[quat] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[+] identifier[quat] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[dqy] operator[=] identifier[quat] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[+] identifier[quat] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[dqz] operator[=] identifier[quat] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[+] identifier[quat] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q00] operator[=] identifier[dqx] operator[*] identifier[quat] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q11] operator[=] identifier[dqy] operator[*] identifier[quat] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q22] operator[=] identifier[dqz] operator[*] identifier[quat] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q01] operator[=] identifier[dqx] operator[*] identifier[quat] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q02] operator[=] identifier[dqx] operator[*] identifier[quat] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q03] operator[=] identifier[dqx] operator[*] identifier[quat] operator[SEP] identifier[w] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q12] operator[=] identifier[dqy] operator[*] identifier[quat] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q13] operator[=] identifier[dqy] operator[*] identifier[quat] operator[SEP] identifier[w] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[q23] operator[=] identifier[dqz] operator[*] identifier[quat] operator[SEP] identifier[w] operator[SEP] operator[SEP] operator[SEP] identifier[m00] operator[=] literal[Float] operator[-] operator[SEP] identifier[q11] operator[+] identifier[q22] operator[SEP] operator[SEP] identifier[m01] operator[=] identifier[q01] operator[+] identifier[q23] operator[SEP] identifier[m02] operator[=] identifier[q02] operator[-] identifier[q13] operator[SEP] identifier[m10] operator[=] identifier[q01] operator[-] identifier[q23] operator[SEP] identifier[m11] operator[=] literal[Float] operator[-] operator[SEP] identifier[q22] operator[+] identifier[q00] operator[SEP] operator[SEP] identifier[m12] operator[=] identifier[q12] operator[+] identifier[q03] operator[SEP] identifier[m20] operator[=] identifier[q02] operator[+] identifier[q13] operator[SEP] identifier[m21] operator[=] identifier[q12] operator[-] identifier[q03] operator[SEP] identifier[m22] operator[=] literal[Float] operator[-] operator[SEP] identifier[q11] operator[+] identifier[q00] operator[SEP] operator[SEP] identifier[m30] operator[=] identifier[tx] operator[SEP] identifier[m31] operator[=] identifier[ty] operator[SEP] identifier[m32] operator[=] identifier[tz] operator[SEP] identifier[properties] operator[=] identifier[PROPERTY_ORTHONORMAL] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public ResumeAppStreamResponse resumeAppStream(String app, String stream) {
ResumeAppStreamRequest request = new ResumeAppStreamRequest();
request.setApp(app);
request.setStream(stream);
return resumeAppStream(request);
} | class class_name[name] begin[{]
method[resumeAppStream, return_type[type[ResumeAppStreamResponse]], modifier[public], parameter[app, stream]] begin[{]
local_variable[type[ResumeAppStreamRequest], request]
call[request.setApp, parameter[member[.app]]]
call[request.setStream, parameter[member[.stream]]]
return[call[.resumeAppStream, parameter[member[.request]]]]
end[}]
END[}] | Keyword[public] identifier[ResumeAppStreamResponse] identifier[resumeAppStream] operator[SEP] identifier[String] identifier[app] , identifier[String] identifier[stream] operator[SEP] {
identifier[ResumeAppStreamRequest] identifier[request] operator[=] Keyword[new] identifier[ResumeAppStreamRequest] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setApp] operator[SEP] identifier[app] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setStream] operator[SEP] identifier[stream] operator[SEP] operator[SEP] Keyword[return] identifier[resumeAppStream] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
@SuppressWarnings({ "rawtypes", "unchecked" })
private void writeComponent(ICalComponent component) throws IOException {
ICalComponentScribe componentScribe = index.getComponentScribe(component);
writer.writeStartComponent(componentScribe.getComponentName().toLowerCase());
List propertyObjs = componentScribe.getProperties(component);
if (component instanceof ICalendar && component.getProperty(Version.class) == null) {
propertyObjs.add(0, new Version(targetVersion));
}
//write properties
for (Object propertyObj : propertyObjs) {
context.setParent(component); //set parent here incase a scribe resets the parent
ICalProperty property = (ICalProperty) propertyObj;
ICalPropertyScribe propertyScribe = index.getPropertyScribe(property);
//marshal property
ICalParameters parameters;
JCalValue value;
try {
parameters = propertyScribe.prepareParameters(property, context);
value = propertyScribe.writeJson(property, context);
} catch (SkipMeException e) {
continue;
}
//write property
String propertyName = propertyScribe.getPropertyName(targetVersion).toLowerCase();
ICalDataType dataType = propertyScribe.dataType(property, targetVersion);
writer.writeProperty(propertyName, parameters, dataType, value);
}
//write sub-components
List subComponents = componentScribe.getComponents(component);
if (component instanceof ICalendar) {
//add the VTIMEZONE components that were auto-generated by TimezoneOptions
Collection<VTimezone> tzs = getTimezoneComponents();
for (VTimezone tz : tzs) {
if (!subComponents.contains(tz)) {
subComponents.add(0, tz);
}
}
}
for (Object subComponentObj : subComponents) {
ICalComponent subComponent = (ICalComponent) subComponentObj;
writeComponent(subComponent);
}
writer.writeEndComponent();
} | class class_name[name] begin[{]
method[writeComponent, return_type[void], modifier[private], parameter[component]] begin[{]
local_variable[type[ICalComponentScribe], componentScribe]
call[writer.writeStartComponent, parameter[call[componentScribe.getComponentName, parameter[]]]]
local_variable[type[List], propertyObjs]
if[binary_operation[binary_operation[member[.component], instanceof, type[ICalendar]], &&, binary_operation[call[component.getProperty, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Version, sub_type=None))]], ==, literal[null]]]] begin[{]
call[propertyObjs.add, parameter[literal[0], ClassCreator(arguments=[MemberReference(member=targetVersion, 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=Version, sub_type=None))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=propertyObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ICalProperty, sub_type=None)), name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ICalProperty, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyScribe, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), name=propertyScribe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ICalPropertyScribe, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=parameters)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ICalParameters, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JCalValue, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareParameters, postfix_operators=[], prefix_operators=[], qualifier=propertyScribe, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeJson, postfix_operators=[], prefix_operators=[], qualifier=propertyScribe, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SkipMeException']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=targetVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyName, postfix_operators=[], prefix_operators=[], qualifier=propertyScribe, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=propertyName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dataType, postfix_operators=[], prefix_operators=[], qualifier=propertyScribe, selectors=[], type_arguments=None), name=dataType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ICalDataType, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeProperty, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=propertyObjs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propertyObj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
local_variable[type[List], subComponents]
if[binary_operation[member[.component], instanceof, type[ICalendar]]] begin[{]
local_variable[type[Collection], tzs]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=subComponents, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=tz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=subComponents, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=tzs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tz)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VTimezone, sub_type=None))), label=None)
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=subComponentObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ICalComponent, sub_type=None)), name=subComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ICalComponent, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=subComponents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subComponentObj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
call[writer.writeEndComponent, parameter[]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[private] Keyword[void] identifier[writeComponent] operator[SEP] identifier[ICalComponent] identifier[component] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ICalComponentScribe] identifier[componentScribe] operator[=] identifier[index] operator[SEP] identifier[getComponentScribe] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[writeStartComponent] operator[SEP] identifier[componentScribe] operator[SEP] identifier[getComponentName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] identifier[propertyObjs] operator[=] identifier[componentScribe] operator[SEP] identifier[getProperties] operator[SEP] identifier[component] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[component] Keyword[instanceof] identifier[ICalendar] operator[&&] identifier[component] operator[SEP] identifier[getProperty] operator[SEP] identifier[Version] operator[SEP] Keyword[class] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[propertyObjs] operator[SEP] identifier[add] operator[SEP] Other[0] , Keyword[new] identifier[Version] operator[SEP] identifier[targetVersion] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Object] identifier[propertyObj] operator[:] identifier[propertyObjs] operator[SEP] {
identifier[context] operator[SEP] identifier[setParent] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[ICalProperty] identifier[property] operator[=] operator[SEP] identifier[ICalProperty] operator[SEP] identifier[propertyObj] operator[SEP] identifier[ICalPropertyScribe] identifier[propertyScribe] operator[=] identifier[index] operator[SEP] identifier[getPropertyScribe] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[ICalParameters] identifier[parameters] operator[SEP] identifier[JCalValue] identifier[value] operator[SEP] Keyword[try] {
identifier[parameters] operator[=] identifier[propertyScribe] operator[SEP] identifier[prepareParameters] operator[SEP] identifier[property] , identifier[context] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[propertyScribe] operator[SEP] identifier[writeJson] operator[SEP] identifier[property] , identifier[context] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SkipMeException] identifier[e] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] identifier[propertyName] operator[=] identifier[propertyScribe] operator[SEP] identifier[getPropertyName] operator[SEP] identifier[targetVersion] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[ICalDataType] identifier[dataType] operator[=] identifier[propertyScribe] operator[SEP] identifier[dataType] operator[SEP] identifier[property] , identifier[targetVersion] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[writeProperty] operator[SEP] identifier[propertyName] , identifier[parameters] , identifier[dataType] , identifier[value] operator[SEP] operator[SEP]
}
identifier[List] identifier[subComponents] operator[=] identifier[componentScribe] operator[SEP] identifier[getComponents] operator[SEP] identifier[component] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[component] Keyword[instanceof] identifier[ICalendar] operator[SEP] {
identifier[Collection] operator[<] identifier[VTimezone] operator[>] identifier[tzs] operator[=] identifier[getTimezoneComponents] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[VTimezone] identifier[tz] operator[:] identifier[tzs] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[subComponents] operator[SEP] identifier[contains] operator[SEP] identifier[tz] operator[SEP] operator[SEP] {
identifier[subComponents] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[tz] operator[SEP] operator[SEP]
}
}
}
Keyword[for] operator[SEP] identifier[Object] identifier[subComponentObj] operator[:] identifier[subComponents] operator[SEP] {
identifier[ICalComponent] identifier[subComponent] operator[=] operator[SEP] identifier[ICalComponent] operator[SEP] identifier[subComponentObj] operator[SEP] identifier[writeComponent] operator[SEP] identifier[subComponent] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[writeEndComponent] operator[SEP] operator[SEP] operator[SEP]
}
|
private void setIsAsyncDeletionThreadStartable(boolean isStartable)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setIsAsyncDeletionThreadStartable", new Boolean(isStartable));
synchronized (deletionThreadLock)
{
_isAsyncDeletionThreadStartable = isStartable;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "setIsAsyncDeletionThreadStartable");
} | class class_name[name] begin[{]
method[setIsAsyncDeletionThreadStartable, return_type[void], modifier[private], parameter[isStartable]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["setIsAsyncDeletionThreadStartable"], ClassCreator(arguments=[MemberReference(member=isStartable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]]
else begin[{]
None
end[}]
SYNCHRONIZED[member[.deletionThreadLock]] BEGIN[{]
assign[member[._isAsyncDeletionThreadStartable], member[.isStartable]]
END[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["setIsAsyncDeletionThreadStartable"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[setIsAsyncDeletionThreadStartable] operator[SEP] Keyword[boolean] identifier[isStartable] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Boolean] operator[SEP] identifier[isStartable] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[deletionThreadLock] operator[SEP] {
identifier[_isAsyncDeletionThreadStartable] operator[=] identifier[isStartable] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
@Override
protected void process(@NotNull WireIn inWire,
@NotNull WireOut outWire,
@NotNull SessionDetailsProvider sd) {
inWire.readDocument(m -> {
long tid = inWire.read(() -> "tid").int64();
outWire.writeDocument(true, meta -> meta.write(() -> "tid")
.int64(tid));
}, d -> {
outWire.writeDocument(false, data -> data.write(() -> "payloadResponse")
.text(inWire.read(() -> "payload").text()));
});
} | class class_name[name] begin[{]
method[process, return_type[void], modifier[protected], parameter[inWire, outWire, sd]] begin[{]
call[inWire.readDocument, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[LambdaExpression(body=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="tid"), parameters=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=inWire, selectors=[MethodInvocation(arguments=[], member=int64, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=tid)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), LambdaExpression(body=MethodInvocation(arguments=[LambdaExpression(body=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="tid"), parameters=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=meta, selectors=[MethodInvocation(arguments=[MemberReference(member=tid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=int64, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=writeDocument, postfix_operators=[], prefix_operators=[], qualifier=outWire, selectors=[], type_arguments=None), label=None)], parameters=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), LambdaExpression(body=MethodInvocation(arguments=[LambdaExpression(body=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="payloadResponse"), parameters=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[LambdaExpression(body=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="payload"), parameters=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=inWire, selectors=[MethodInvocation(arguments=[], member=text, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=text, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=writeDocument, postfix_operators=[], prefix_operators=[], qualifier=outWire, selectors=[], type_arguments=None), label=None)], parameters=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[process] operator[SEP] annotation[@] identifier[NotNull] identifier[WireIn] identifier[inWire] , annotation[@] identifier[NotNull] identifier[WireOut] identifier[outWire] , annotation[@] identifier[NotNull] identifier[SessionDetailsProvider] identifier[sd] operator[SEP] {
identifier[inWire] operator[SEP] identifier[readDocument] operator[SEP] identifier[m] operator[->] {
Keyword[long] identifier[tid] operator[=] identifier[inWire] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[->] literal[String] operator[SEP] operator[SEP] identifier[int64] operator[SEP] operator[SEP] operator[SEP] identifier[outWire] operator[SEP] identifier[writeDocument] operator[SEP] literal[boolean] , identifier[meta] operator[->] identifier[meta] operator[SEP] identifier[write] operator[SEP] operator[SEP] operator[SEP] operator[->] literal[String] operator[SEP] operator[SEP] identifier[int64] operator[SEP] identifier[tid] operator[SEP] operator[SEP] operator[SEP]
} , identifier[d] operator[->] {
identifier[outWire] operator[SEP] identifier[writeDocument] operator[SEP] literal[boolean] , identifier[data] operator[->] identifier[data] operator[SEP] identifier[write] operator[SEP] operator[SEP] operator[SEP] operator[->] literal[String] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[inWire] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[->] literal[String] operator[SEP] operator[SEP] identifier[text] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP]
}
|
public static List<Refund> create(Map<String, Object> params) throws EasyPostException {
return create(params, null);
} | class class_name[name] begin[{]
method[create, return_type[type[List]], modifier[public static], parameter[params]] begin[{]
return[call[.create, parameter[member[.params], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Refund] operator[>] identifier[create] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[SEP] Keyword[throws] identifier[EasyPostException] {
Keyword[return] identifier[create] operator[SEP] identifier[params] , Other[null] operator[SEP] operator[SEP]
}
|
SubString getParenSubString(int i)
{
if (parens != null && i < parens.length) {
SubString parsub = parens[i];
if (parsub != null) {
return parsub;
}
}
return new SubString();
} | class class_name[name] begin[{]
method[getParenSubString, return_type[type[SubString]], modifier[default], parameter[i]] begin[{]
if[binary_operation[binary_operation[member[.parens], !=, literal[null]], &&, binary_operation[member[.i], <, member[parens.length]]]] begin[{]
local_variable[type[SubString], parsub]
if[binary_operation[member[.parsub], !=, literal[null]]] begin[{]
return[member[.parsub]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SubString, sub_type=None))]
end[}]
END[}] | identifier[SubString] identifier[getParenSubString] operator[SEP] Keyword[int] identifier[i] operator[SEP] {
Keyword[if] operator[SEP] identifier[parens] operator[!=] Other[null] operator[&&] identifier[i] operator[<] identifier[parens] operator[SEP] identifier[length] operator[SEP] {
identifier[SubString] identifier[parsub] operator[=] identifier[parens] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parsub] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[parsub] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[SubString] operator[SEP] operator[SEP] operator[SEP]
}
|
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException {
MetadataList mdl = (MetadataList) parentSAMLObject;
if (childSAMLObject instanceof MetadataLocation) {
mdl.getMetadataLocations().add((MetadataLocation) childSAMLObject);
}
else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
} | class class_name[name] begin[{]
method[processChildElement, return_type[void], modifier[protected], parameter[parentSAMLObject, childSAMLObject]] begin[{]
local_variable[type[MetadataList], mdl]
if[binary_operation[member[.childSAMLObject], instanceof, type[MetadataLocation]]] begin[{]
call[mdl.getMetadataLocations, parameter[]]
else begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=parentSAMLObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=childSAMLObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processChildElement, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[processChildElement] operator[SEP] identifier[XMLObject] identifier[parentSAMLObject] , identifier[XMLObject] identifier[childSAMLObject] operator[SEP] Keyword[throws] identifier[UnmarshallingException] {
identifier[MetadataList] identifier[mdl] operator[=] operator[SEP] identifier[MetadataList] operator[SEP] identifier[parentSAMLObject] operator[SEP] Keyword[if] operator[SEP] identifier[childSAMLObject] Keyword[instanceof] identifier[MetadataLocation] operator[SEP] {
identifier[mdl] operator[SEP] identifier[getMetadataLocations] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[MetadataLocation] operator[SEP] identifier[childSAMLObject] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[super] operator[SEP] identifier[processChildElement] operator[SEP] identifier[parentSAMLObject] , identifier[childSAMLObject] operator[SEP] operator[SEP]
}
}
|
@Override
public ConsumerSession createConsumerSessionForDurableSubscription(String subscriptionName,
String durableSubscriptionHome,
SIDestinationAddress destinationAddress,
SelectionCriteria criteria,
boolean supportsMultipleConsumers,
boolean nolocal,
Reliability reliability,
boolean enableReadAhead,
Reliability unrecoverableReliability,
boolean bifurcatable,
String alternateUser)
throws SIConnectionUnavailableException, SIConnectionDroppedException,
SIErrorException,
SIDurableSubscriptionNotFoundException, SIDurableSubscriptionMismatchException,
SIDestinationLockedException, SIIncorrectCallException, SIResourceException, SINotAuthorizedException
{
//liberty code change : chetan
//Since there is no ME-ME communication the durableSubscriptionHome is always the local ME
durableSubscriptionHome = _messageProcessor.getMessagingEngineName();
if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
SibTr.entry(
CoreSPIConnection.tc,
"createConsumerSessionForDurableSubscription",
new Object[] {
this,
subscriptionName,
durableSubscriptionHome,
destinationAddress,
criteria,
Boolean.valueOf(supportsMultipleConsumers),
Boolean.valueOf(nolocal),
reliability,
Boolean.valueOf(enableReadAhead),
unrecoverableReliability,
Boolean.valueOf(bifurcatable),
alternateUser });
ConsumerSession session =
internalCreateConsumerSessionForDurableSubscription(subscriptionName,
durableSubscriptionHome,
destinationAddress,
criteria,
supportsMultipleConsumers,
nolocal,
reliability,
enableReadAhead,
unrecoverableReliability,
bifurcatable,
alternateUser,
false);
if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
SibTr.exit(CoreSPIConnection.tc, "createConsumerSessionForDurableSubscription", session);
return session;
} | class class_name[name] begin[{]
method[createConsumerSessionForDurableSubscription, return_type[type[ConsumerSession]], modifier[public], parameter[subscriptionName, durableSubscriptionHome, destinationAddress, criteria, supportsMultipleConsumers, nolocal, reliability, enableReadAhead, unrecoverableReliability, bifurcatable, alternateUser]] begin[{]
assign[member[.durableSubscriptionHome], call[_messageProcessor.getMessagingEngineName, parameter[]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[CoreSPIConnection.tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[CoreSPIConnection.tc], literal["createConsumerSessionForDurableSubscription"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=subscriptionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=durableSubscriptionHome, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=criteria, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=supportsMultipleConsumers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=nolocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MemberReference(member=reliability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=enableReadAhead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MemberReference(member=unrecoverableReliability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=bifurcatable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MemberReference(member=alternateUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[ConsumerSession], session]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[CoreSPIConnection.tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[CoreSPIConnection.tc], literal["createConsumerSessionForDurableSubscription"], member[.session]]]
else begin[{]
None
end[}]
return[member[.session]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ConsumerSession] identifier[createConsumerSessionForDurableSubscription] operator[SEP] identifier[String] identifier[subscriptionName] , identifier[String] identifier[durableSubscriptionHome] , identifier[SIDestinationAddress] identifier[destinationAddress] , identifier[SelectionCriteria] identifier[criteria] , Keyword[boolean] identifier[supportsMultipleConsumers] , Keyword[boolean] identifier[nolocal] , identifier[Reliability] identifier[reliability] , Keyword[boolean] identifier[enableReadAhead] , identifier[Reliability] identifier[unrecoverableReliability] , Keyword[boolean] identifier[bifurcatable] , identifier[String] identifier[alternateUser] operator[SEP] Keyword[throws] identifier[SIConnectionUnavailableException] , identifier[SIConnectionDroppedException] , identifier[SIErrorException] , identifier[SIDurableSubscriptionNotFoundException] , identifier[SIDurableSubscriptionMismatchException] , identifier[SIDestinationLockedException] , identifier[SIIncorrectCallException] , identifier[SIResourceException] , identifier[SINotAuthorizedException] {
identifier[durableSubscriptionHome] operator[=] identifier[_messageProcessor] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[CoreSPIConnection] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[CoreSPIConnection] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
Keyword[this] , identifier[subscriptionName] , identifier[durableSubscriptionHome] , identifier[destinationAddress] , identifier[criteria] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[supportsMultipleConsumers] operator[SEP] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[nolocal] operator[SEP] , identifier[reliability] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[enableReadAhead] operator[SEP] , identifier[unrecoverableReliability] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[bifurcatable] operator[SEP] , identifier[alternateUser]
} operator[SEP] operator[SEP] identifier[ConsumerSession] identifier[session] operator[=] identifier[internalCreateConsumerSessionForDurableSubscription] operator[SEP] identifier[subscriptionName] , identifier[durableSubscriptionHome] , identifier[destinationAddress] , identifier[criteria] , identifier[supportsMultipleConsumers] , identifier[nolocal] , identifier[reliability] , identifier[enableReadAhead] , identifier[unrecoverableReliability] , identifier[bifurcatable] , identifier[alternateUser] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[CoreSPIConnection] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[CoreSPIConnection] operator[SEP] identifier[tc] , literal[String] , identifier[session] operator[SEP] operator[SEP] Keyword[return] identifier[session] operator[SEP]
}
|
String getTargetInternalName(String sourceInternalName, String targetPackage) {
StringBuilder targetInternalName = new StringBuilder();
targetInternalName.append(targetPackage.replaceAll("\\.", "/"));
int lastSlashIndex = sourceInternalName.lastIndexOf('/');
targetInternalName.append(sourceInternalName.substring(lastSlashIndex));
return targetInternalName.toString();
} | class class_name[name] begin[{]
method[getTargetInternalName, return_type[type[String]], modifier[default], parameter[sourceInternalName, targetPackage]] begin[{]
local_variable[type[StringBuilder], targetInternalName]
call[targetInternalName.append, parameter[call[targetPackage.replaceAll, parameter[literal["\\."], literal["/"]]]]]
local_variable[type[int], lastSlashIndex]
call[targetInternalName.append, parameter[call[sourceInternalName.substring, parameter[member[.lastSlashIndex]]]]]
return[call[targetInternalName.toString, parameter[]]]
end[}]
END[}] | identifier[String] identifier[getTargetInternalName] operator[SEP] identifier[String] identifier[sourceInternalName] , identifier[String] identifier[targetPackage] operator[SEP] {
identifier[StringBuilder] identifier[targetInternalName] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[targetInternalName] operator[SEP] identifier[append] operator[SEP] identifier[targetPackage] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lastSlashIndex] operator[=] identifier[sourceInternalName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[targetInternalName] operator[SEP] identifier[append] operator[SEP] identifier[sourceInternalName] operator[SEP] identifier[substring] operator[SEP] identifier[lastSlashIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[targetInternalName] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <K, V> HashMap<K, V> newHashMap(@NotNull final List<K> keys, @NotNull final List<V> values) {
Validate.isTrue(keys.size() == values.size(), "keys.length is %s but values.length is %s", keys.size(),
values.size());
HashMap<K, V> map = new HashMap<K, V>(keys.size() * 2);
Iterator<K> keyIt = keys.iterator();
Iterator<V> valueIt = values.iterator();
while (keyIt.hasNext()) {
map.put(keyIt.next(), valueIt.next());
}
return map;
} | class class_name[name] begin[{]
method[newHashMap, return_type[type[HashMap]], modifier[public static], parameter[keys, values]] begin[{]
call[Validate.isTrue, parameter[binary_operation[call[keys.size, parameter[]], ==, call[values.size, parameter[]]], literal["keys.length is %s but values.length is %s"], call[keys.size, parameter[]], call[values.size, parameter[]]]]
local_variable[type[HashMap], map]
local_variable[type[Iterator], keyIt]
local_variable[type[Iterator], valueIt]
while[call[keyIt.hasNext, parameter[]]] begin[{]
call[map.put, parameter[call[keyIt.next, parameter[]], call[valueIt.next, parameter[]]]]
end[}]
return[member[.map]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[HashMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[newHashMap] operator[SEP] annotation[@] identifier[NotNull] Keyword[final] identifier[List] operator[<] identifier[K] operator[>] identifier[keys] , annotation[@] identifier[NotNull] Keyword[final] identifier[List] operator[<] identifier[V] operator[>] identifier[values] operator[SEP] {
identifier[Validate] operator[SEP] identifier[isTrue] operator[SEP] identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] , literal[String] , identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[K] operator[>] identifier[keyIt] operator[=] identifier[keys] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[V] operator[>] identifier[valueIt] operator[=] identifier[values] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[keyIt] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[keyIt] operator[SEP] identifier[next] operator[SEP] operator[SEP] , identifier[valueIt] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[map] operator[SEP]
}
|
private void addDescendantElements() throws NodeSelectorException {
for (Node node : nodes) {
List<Node> nl;
if (node instanceof Document || node instanceof Element) {
nl = DOMHelper.getElementsByTagName(node, selector.getTagName());
} else {
throw new NodeSelectorException("Only document and element nodes allowed!");
}
result.addAll(nl);
}
} | class class_name[name] begin[{]
method[addDescendantElements, return_type[void], modifier[private], parameter[]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=nl)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Document, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None), operator=instanceof), operator=||), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only document and element nodes allowed!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeSelectorException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTagName, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None)], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=DOMHelper, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addDescendantElements] operator[SEP] operator[SEP] Keyword[throws] identifier[NodeSelectorException] {
Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[nodes] operator[SEP] {
identifier[List] operator[<] identifier[Node] operator[>] identifier[nl] operator[SEP] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[Document] operator[||] identifier[node] Keyword[instanceof] identifier[Element] operator[SEP] {
identifier[nl] operator[=] identifier[DOMHelper] operator[SEP] identifier[getElementsByTagName] operator[SEP] identifier[node] , identifier[selector] operator[SEP] identifier[getTagName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[NodeSelectorException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[nl] operator[SEP] operator[SEP]
}
}
|
public Map<String, EntityDocument> getEntityDocumentsByTitle(
String siteKey, String... titles) throws MediaWikiApiErrorException, IOException {
return getEntityDocumentsByTitle(siteKey, Arrays.asList(titles));
} | class class_name[name] begin[{]
method[getEntityDocumentsByTitle, return_type[type[Map]], modifier[public], parameter[siteKey, titles]] begin[{]
return[call[.getEntityDocumentsByTitle, parameter[member[.siteKey], call[Arrays.asList, parameter[member[.titles]]]]]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[EntityDocument] operator[>] identifier[getEntityDocumentsByTitle] operator[SEP] identifier[String] identifier[siteKey] , identifier[String] operator[...] identifier[titles] operator[SEP] Keyword[throws] identifier[MediaWikiApiErrorException] , identifier[IOException] {
Keyword[return] identifier[getEntityDocumentsByTitle] operator[SEP] identifier[siteKey] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[titles] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("WeakerAccess")
@Internal
protected final Optional findBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, MethodInjectionPoint injectionPoint, Argument argument) {
return resolveBeanWithGenericsFromMethodArgument(resolutionContext, injectionPoint, argument, (beanType, qualifier) ->
((DefaultBeanContext) context).findBean(resolutionContext, beanType, qualifier)
);
} | class class_name[name] begin[{]
method[findBeanForMethodArgument, return_type[type[Optional]], modifier[final protected], parameter[resolutionContext, context, injectionPoint, argument]] begin[{]
return[call[.resolveBeanWithGenericsFromMethodArgument, parameter[member[.resolutionContext], member[.injectionPoint], member[.argument], LambdaExpression(body=Cast(expression=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DefaultBeanContext, sub_type=None)), parameters=[InferredFormalParameter(name=beanType), InferredFormalParameter(name=qualifier)])]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Internal] Keyword[protected] Keyword[final] identifier[Optional] identifier[findBeanForMethodArgument] operator[SEP] identifier[BeanResolutionContext] identifier[resolutionContext] , identifier[BeanContext] identifier[context] , identifier[MethodInjectionPoint] identifier[injectionPoint] , identifier[Argument] identifier[argument] operator[SEP] {
Keyword[return] identifier[resolveBeanWithGenericsFromMethodArgument] operator[SEP] identifier[resolutionContext] , identifier[injectionPoint] , identifier[argument] , operator[SEP] identifier[beanType] , identifier[qualifier] operator[SEP] operator[->] operator[SEP] operator[SEP] identifier[DefaultBeanContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[findBean] operator[SEP] identifier[resolutionContext] , identifier[beanType] , identifier[qualifier] operator[SEP] operator[SEP] operator[SEP]
}
|
public Template getTemplate(final String name) throws ResourceNotFoundException {
final Template template = this.cachedTemplates.get(name);
if (template != null) {
return template;
}
return createTemplateIfAbsent(name);
} | class class_name[name] begin[{]
method[getTemplate, return_type[type[Template]], modifier[public], parameter[name]] begin[{]
local_variable[type[Template], template]
if[binary_operation[member[.template], !=, literal[null]]] begin[{]
return[member[.template]]
else begin[{]
None
end[}]
return[call[.createTemplateIfAbsent, parameter[member[.name]]]]
end[}]
END[}] | Keyword[public] identifier[Template] identifier[getTemplate] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[ResourceNotFoundException] {
Keyword[final] identifier[Template] identifier[template] operator[=] Keyword[this] operator[SEP] identifier[cachedTemplates] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[template] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[template] operator[SEP]
}
Keyword[return] identifier[createTemplateIfAbsent] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
|
public PreparedStatement getSelectByPKStatement(ClassDescriptor cds) throws PersistenceBrokerSQLException, PersistenceBrokerException
{
try
{
return cds.getStatementsForClass(m_conMan).getSelectByPKStmt(m_conMan.getConnection());
}
catch (SQLException e)
{
throw new PersistenceBrokerSQLException("Could not build statement ask for", e);
}
catch (LookupException e)
{
throw new PersistenceBrokerException("Used ConnectionManager instance could not obtain a connection", e);
}
} | class class_name[name] begin[{]
method[getSelectByPKStatement, return_type[type[PreparedStatement]], modifier[public], parameter[cds]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=m_conMan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStatementsForClass, postfix_operators=[], prefix_operators=[], qualifier=cds, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=m_conMan, selectors=[], type_arguments=None)], member=getSelectByPKStmt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not build statement ask for"), 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=PersistenceBrokerSQLException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Used ConnectionManager instance could not obtain a connection"), 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=PersistenceBrokerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LookupException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[PreparedStatement] identifier[getSelectByPKStatement] operator[SEP] identifier[ClassDescriptor] identifier[cds] operator[SEP] Keyword[throws] identifier[PersistenceBrokerSQLException] , identifier[PersistenceBrokerException] {
Keyword[try] {
Keyword[return] identifier[cds] operator[SEP] identifier[getStatementsForClass] operator[SEP] identifier[m_conMan] operator[SEP] operator[SEP] identifier[getSelectByPKStmt] operator[SEP] identifier[m_conMan] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[PersistenceBrokerSQLException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[LookupException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[PersistenceBrokerException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public boolean matches(IAtomContainer targetContainer, IAtom targetAtom) {
if (smartQueryAtom != null && qAtom == null) {
if (!smartQueryAtom.matches(targetAtom)) {
return false;
}
} else {
if (!matchSymbol(targetAtom)) {
return false;
}
if (!matchMaximumNeighbors(targetContainer, targetAtom)) {
return false;
}
}
return true;
} | class class_name[name] begin[{]
method[matches, return_type[type[boolean]], modifier[public], parameter[targetContainer, targetAtom]] begin[{]
if[binary_operation[binary_operation[member[.smartQueryAtom], !=, literal[null]], &&, binary_operation[member[.qAtom], ==, literal[null]]]] begin[{]
if[call[smartQueryAtom.matches, parameter[member[.targetAtom]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
else begin[{]
if[call[.matchSymbol, parameter[member[.targetAtom]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[.matchMaximumNeighbors, parameter[member[.targetContainer], member[.targetAtom]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
end[}]
return[literal[true]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[IAtomContainer] identifier[targetContainer] , identifier[IAtom] identifier[targetAtom] operator[SEP] {
Keyword[if] operator[SEP] identifier[smartQueryAtom] operator[!=] Other[null] operator[&&] identifier[qAtom] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[smartQueryAtom] operator[SEP] identifier[matches] operator[SEP] identifier[targetAtom] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] operator[!] identifier[matchSymbol] operator[SEP] identifier[targetAtom] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[matchMaximumNeighbors] operator[SEP] identifier[targetContainer] , identifier[targetAtom] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public RunList<R> limit(final int n) {
return limit(new CountingPredicate<R>() {
public boolean apply(int index, R input) {
return index<n;
}
});
} | class class_name[name] begin[{]
method[limit, return_type[type[RunList]], modifier[public], parameter[n]] begin[{]
return[call[.limit, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=index, type=BasicType(dimensions=[], name=int), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=input, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=CountingPredicate, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[RunList] operator[<] identifier[R] operator[>] identifier[limit] operator[SEP] Keyword[final] Keyword[int] identifier[n] operator[SEP] {
Keyword[return] identifier[limit] operator[SEP] Keyword[new] identifier[CountingPredicate] operator[<] identifier[R] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] Keyword[int] identifier[index] , identifier[R] identifier[input] operator[SEP] {
Keyword[return] identifier[index] operator[<] identifier[n] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public List<RpcResponse> request(List<RpcRequest> reqList) {
List<RpcResponse> respList = new ArrayList<RpcResponse>();
List<Map> marshaledReqs = new ArrayList<Map>();
Map<String,RpcRequest> byReqId = new HashMap<String,RpcRequest>();
for (RpcRequest req : reqList) {
try {
marshaledReqs.add(req.marshal(contract));
byReqId.put(req.getId(), req);
}
catch (RpcException e) {
respList.add(new RpcResponse(req, e));
}
}
InputStream is = null;
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
serializer.write(marshaledReqs, bos);
bos.close();
byte[] data = bos.toByteArray();
is = requestRaw(data);
List<Map> responses = serializer.readList(is);
for (Map map : responses) {
String id = (String)map.get("id");
if (id != null) {
RpcRequest req = byReqId.get(id);
if (req == null) {
// TODO: ?? log error?
}
else {
byReqId.remove(id);
respList.add(unmarshal(req, map));
}
}
else {
// TODO: ?? log error?
}
}
if (byReqId.size() > 0) {
for (RpcRequest req : byReqId.values()) {
String msg = "No response in batch for request " + req.getId();
RpcException exc = RpcException.Error.INVALID_RESP.exc(msg);
RpcResponse resp = new RpcResponse(req, exc);
respList.add(resp);
}
}
}
catch (IOException e) {
String msg = "IOException requesting batch " +
" from: " + endpoint + " - " + e.getMessage();
RpcException exc = RpcException.Error.INTERNAL.exc(msg);
respList.add(new RpcResponse(null, exc));
}
finally {
closeQuietly(is);
}
return respList;
} | class class_name[name] begin[{]
method[request, return_type[type[List]], modifier[public], parameter[reqList]] begin[{]
local_variable[type[List], respList]
local_variable[type[List], marshaledReqs]
local_variable[type[Map], byReqId]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=contract, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshal, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=marshaledReqs, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=byReqId, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RpcResponse, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=respList, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RpcException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=reqList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=req)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RpcRequest, sub_type=None))), label=None)
local_variable[type[InputStream], is]
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)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=marshaledReqs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=serializer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None), name=data)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requestRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readList, postfix_operators=[], prefix_operators=[], qualifier=serializer, selectors=[], type_arguments=None), name=responses)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="id")], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=byReqId, selectors=[], type_arguments=None), name=req)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RpcRequest, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=byReqId, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmarshal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=respList, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[]))]))]), control=EnhancedForControl(iterable=MemberReference(member=responses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=map)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=byReqId, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No response in batch for request "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exc, postfix_operators=[], prefix_operators=[], qualifier=RpcException.Error.INVALID_RESP, selectors=[], type_arguments=None), name=exc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RpcException, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RpcResponse, sub_type=None)), name=resp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RpcResponse, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=respList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=byReqId, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=req)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RpcRequest, sub_type=None))), label=None)]))], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException requesting batch "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from: "), operator=+), operandr=MemberReference(member=endpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exc, postfix_operators=[], prefix_operators=[], qualifier=RpcException.Error.INTERNAL, selectors=[], type_arguments=None), name=exc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RpcException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RpcResponse, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=respList, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[member[.respList]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[List] operator[<] identifier[RpcResponse] operator[>] identifier[request] operator[SEP] identifier[List] operator[<] identifier[RpcRequest] operator[>] identifier[reqList] operator[SEP] {
identifier[List] operator[<] identifier[RpcResponse] operator[>] identifier[respList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[RpcResponse] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Map] operator[>] identifier[marshaledReqs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Map] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[RpcRequest] operator[>] identifier[byReqId] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[RpcRequest] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[RpcRequest] identifier[req] operator[:] identifier[reqList] operator[SEP] {
Keyword[try] {
identifier[marshaledReqs] operator[SEP] identifier[add] operator[SEP] identifier[req] operator[SEP] identifier[marshal] operator[SEP] identifier[contract] operator[SEP] operator[SEP] operator[SEP] identifier[byReqId] operator[SEP] identifier[put] operator[SEP] identifier[req] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[req] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RpcException] identifier[e] operator[SEP] {
identifier[respList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[RpcResponse] operator[SEP] identifier[req] , identifier[e] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[InputStream] identifier[is] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[ByteArrayOutputStream] identifier[bos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[write] operator[SEP] identifier[marshaledReqs] , identifier[bos] operator[SEP] operator[SEP] identifier[bos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[bos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[=] identifier[requestRaw] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Map] operator[>] identifier[responses] operator[=] identifier[serializer] operator[SEP] identifier[readList] operator[SEP] identifier[is] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] identifier[map] operator[:] identifier[responses] operator[SEP] {
identifier[String] identifier[id] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[SEP] {
identifier[RpcRequest] identifier[req] operator[=] identifier[byReqId] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[req] operator[==] Other[null] operator[SEP] {
}
Keyword[else] {
identifier[byReqId] operator[SEP] identifier[remove] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[respList] operator[SEP] identifier[add] operator[SEP] identifier[unmarshal] operator[SEP] identifier[req] , identifier[map] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
}
}
Keyword[if] operator[SEP] identifier[byReqId] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] identifier[RpcRequest] identifier[req] operator[:] identifier[byReqId] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[req] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[RpcException] identifier[exc] operator[=] identifier[RpcException] operator[SEP] identifier[Error] operator[SEP] identifier[INVALID_RESP] operator[SEP] identifier[exc] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[RpcResponse] identifier[resp] operator[=] Keyword[new] identifier[RpcResponse] operator[SEP] identifier[req] , identifier[exc] operator[SEP] operator[SEP] identifier[respList] operator[SEP] identifier[add] operator[SEP] identifier[resp] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] literal[String] operator[+] identifier[endpoint] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] identifier[RpcException] identifier[exc] operator[=] identifier[RpcException] operator[SEP] identifier[Error] operator[SEP] identifier[INTERNAL] operator[SEP] identifier[exc] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[respList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[RpcResponse] operator[SEP] Other[null] , identifier[exc] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[closeQuietly] operator[SEP] identifier[is] operator[SEP] operator[SEP]
}
Keyword[return] identifier[respList] operator[SEP]
}
|
private void convertConditionRecord(List<Condition> conditions,
String conditionType, JsonNode conditionNode) {
Iterator<Map.Entry<String, JsonNode>> mapOfFields = conditionNode
.fields();
List<String> values;
Entry<String, JsonNode> field;
JsonNode fieldValue;
Iterator<JsonNode> elements;
while (mapOfFields.hasNext()) {
values = new LinkedList<String>();
field = mapOfFields.next();
fieldValue = field.getValue();
if (fieldValue.isArray()) {
elements = fieldValue.elements();
while (elements.hasNext()) {
values.add(elements.next().asText());
}
} else {
values.add(fieldValue.asText());
}
conditions.add(new Condition().withType(conditionType)
.withConditionKey(field.getKey()).withValues(values));
}
} | class class_name[name] begin[{]
method[convertConditionRecord, return_type[void], modifier[private], parameter[conditions, conditionType, conditionNode]] begin[{]
local_variable[type[Iterator], mapOfFields]
local_variable[type[List], values]
local_variable[type[Entry], field]
local_variable[type[JsonNode], fieldValue]
local_variable[type[Iterator], elements]
while[call[mapOfFields.hasNext, parameter[]]] begin[{]
assign[member[.values], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))]
assign[member[.field], call[mapOfFields.next, parameter[]]]
assign[member[.fieldValue], call[field.getValue, parameter[]]]
if[call[fieldValue.isArray, parameter[]]] begin[{]
assign[member[.elements], call[fieldValue.elements, parameter[]]]
while[call[elements.hasNext, parameter[]]] begin[{]
call[values.add, parameter[call[elements.next, parameter[]]]]
end[}]
else begin[{]
call[values.add, parameter[call[fieldValue.asText, parameter[]]]]
end[}]
call[conditions.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=conditionType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=withConditionKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withValues, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Condition, sub_type=None))]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[convertConditionRecord] operator[SEP] identifier[List] operator[<] identifier[Condition] operator[>] identifier[conditions] , identifier[String] identifier[conditionType] , identifier[JsonNode] identifier[conditionNode] operator[SEP] {
identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[JsonNode] operator[>] operator[>] identifier[mapOfFields] operator[=] identifier[conditionNode] operator[SEP] identifier[fields] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[JsonNode] operator[>] identifier[field] operator[SEP] identifier[JsonNode] identifier[fieldValue] operator[SEP] identifier[Iterator] operator[<] identifier[JsonNode] operator[>] identifier[elements] operator[SEP] Keyword[while] operator[SEP] identifier[mapOfFields] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[values] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[=] identifier[mapOfFields] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[fieldValue] operator[=] identifier[field] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldValue] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] {
identifier[elements] operator[=] identifier[fieldValue] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[elements] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[elements] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[asText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[fieldValue] operator[SEP] identifier[asText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[conditions] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Condition] operator[SEP] operator[SEP] operator[SEP] identifier[withType] operator[SEP] identifier[conditionType] operator[SEP] operator[SEP] identifier[withConditionKey] operator[SEP] identifier[field] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[withValues] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void onSelectionChanged(SelectionEvent event) {
Record record = event.getRecord();
String featureId = record.getAttribute(FIELD_NAME_FEATURE_ID);
// Check if selection and deselection are really necessary, to avoid useless events.
if (event.getState()) {
// Only select a feature if it is not yet selected:
if (!layer.isFeatureSelected(featureId)) {
layer.getFeatureStore().getFeature(featureId, GeomajasConstant.FEATURE_INCLUDE_ALL,
new LazyLoadCallback() {
public void execute(List<Feature> response) {
layer.selectFeature(response.get(0));
}
});
}
} else {
// Only deselect a feature if it is not yet deselected:
if (layer.isFeatureSelected(featureId)) {
layer.getFeatureStore().getFeature(featureId, GeomajasConstant.FEATURE_INCLUDE_ALL,
new LazyLoadCallback() {
public void execute(List<Feature> response) {
layer.deselectFeature(response.get(0));
}
});
}
}
} | class class_name[name] begin[{]
method[onSelectionChanged, return_type[void], modifier[public], parameter[event]] begin[{]
local_variable[type[Record], record]
local_variable[type[String], featureId]
if[call[event.getState, parameter[]]] begin[{]
if[call[layer.isFeatureSelected, parameter[member[.featureId]]]] begin[{]
call[layer.getFeatureStore, parameter[]]
else begin[{]
None
end[}]
else begin[{]
if[call[layer.isFeatureSelected, parameter[member[.featureId]]]] begin[{]
call[layer.getFeatureStore, parameter[]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[onSelectionChanged] operator[SEP] identifier[SelectionEvent] identifier[event] operator[SEP] {
identifier[Record] identifier[record] operator[=] identifier[event] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[featureId] operator[=] identifier[record] operator[SEP] identifier[getAttribute] operator[SEP] identifier[FIELD_NAME_FEATURE_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[layer] operator[SEP] identifier[isFeatureSelected] operator[SEP] identifier[featureId] operator[SEP] operator[SEP] {
identifier[layer] operator[SEP] identifier[getFeatureStore] operator[SEP] operator[SEP] operator[SEP] identifier[getFeature] operator[SEP] identifier[featureId] , identifier[GeomajasConstant] operator[SEP] identifier[FEATURE_INCLUDE_ALL] , Keyword[new] identifier[LazyLoadCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[List] operator[<] identifier[Feature] operator[>] identifier[response] operator[SEP] {
identifier[layer] operator[SEP] identifier[selectFeature] operator[SEP] identifier[response] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[layer] operator[SEP] identifier[isFeatureSelected] operator[SEP] identifier[featureId] operator[SEP] operator[SEP] {
identifier[layer] operator[SEP] identifier[getFeatureStore] operator[SEP] operator[SEP] operator[SEP] identifier[getFeature] operator[SEP] identifier[featureId] , identifier[GeomajasConstant] operator[SEP] identifier[FEATURE_INCLUDE_ALL] , Keyword[new] identifier[LazyLoadCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[List] operator[<] identifier[Feature] operator[>] identifier[response] operator[SEP] {
identifier[layer] operator[SEP] identifier[deselectFeature] operator[SEP] identifier[response] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
}
}
|
public void addMonomer(Monomer monomer, boolean dbChanged)
throws IOException, MonomerException {
Map<String, Monomer> monomerMap = monomerDB.get(monomer.getPolymerType());
String polymerType = monomer.getPolymerType();
String alternateId = monomer.getAlternateId();
String smilesString = monomer.getCanSMILES();
try {
smilesString = SMILES.getUniqueExtendedSMILES(smilesString);
} catch (Exception e) {
smilesString = monomer.getCanSMILES();
}
boolean hasSmilesString = (smilesString != null && smilesString.length() > 0);
if (null == monomerMap) {
monomerMap = new TreeMap<String, Monomer>(String.CASE_INSENSITIVE_ORDER);
monomerDB.put(polymerType, monomerMap);
}
Monomer copyMonomer = DeepCopy.copy(monomer);
// ensure the canonical SMILES is indexed in the monomer store
if (hasSmilesString) {
copyMonomer.setCanSMILES(smilesString);
}
boolean alreadyAdded = false;
alreadyAdded = monomerMap.containsKey(alternateId);
if (!alreadyAdded) {
monomerMap.put(alternateId, copyMonomer);
boolean alreadyInSMILESMap = hasSmilesString
&& (smilesMonomerDB.containsKey(smilesString));
if (!alreadyInSMILESMap) {
smilesMonomerDB.put(smilesString, copyMonomer);
}
}
if (dbChanged) {
MonomerFactory.setDBChanged(true);
}
} | class class_name[name] begin[{]
method[addMonomer, return_type[void], modifier[public], parameter[monomer, dbChanged]] begin[{]
local_variable[type[Map], monomerMap]
local_variable[type[String], polymerType]
local_variable[type[String], alternateId]
local_variable[type[String], smilesString]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=smilesString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=smilesString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUniqueExtendedSMILES, postfix_operators=[], prefix_operators=[], qualifier=SMILES, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=smilesString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getCanSMILES, postfix_operators=[], prefix_operators=[], qualifier=monomer, 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)
local_variable[type[boolean], hasSmilesString]
if[binary_operation[literal[null], ==, member[.monomerMap]]] begin[{]
assign[member[.monomerMap], ClassCreator(arguments=[MemberReference(member=CASE_INSENSITIVE_ORDER, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Monomer, sub_type=None))], dimensions=None, name=TreeMap, sub_type=None))]
call[monomerDB.put, parameter[member[.polymerType], member[.monomerMap]]]
else begin[{]
None
end[}]
local_variable[type[Monomer], copyMonomer]
if[member[.hasSmilesString]] begin[{]
call[copyMonomer.setCanSMILES, parameter[member[.smilesString]]]
else begin[{]
None
end[}]
local_variable[type[boolean], alreadyAdded]
assign[member[.alreadyAdded], call[monomerMap.containsKey, parameter[member[.alternateId]]]]
if[member[.alreadyAdded]] begin[{]
call[monomerMap.put, parameter[member[.alternateId], member[.copyMonomer]]]
local_variable[type[boolean], alreadyInSMILESMap]
if[member[.alreadyInSMILESMap]] begin[{]
call[smilesMonomerDB.put, parameter[member[.smilesString], member[.copyMonomer]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[member[.dbChanged]] begin[{]
call[MonomerFactory.setDBChanged, parameter[literal[true]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addMonomer] operator[SEP] identifier[Monomer] identifier[monomer] , Keyword[boolean] identifier[dbChanged] operator[SEP] Keyword[throws] identifier[IOException] , identifier[MonomerException] {
identifier[Map] operator[<] identifier[String] , identifier[Monomer] operator[>] identifier[monomerMap] operator[=] identifier[monomerDB] operator[SEP] identifier[get] operator[SEP] identifier[monomer] operator[SEP] identifier[getPolymerType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[polymerType] operator[=] identifier[monomer] operator[SEP] identifier[getPolymerType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[alternateId] operator[=] identifier[monomer] operator[SEP] identifier[getAlternateId] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[smilesString] operator[=] identifier[monomer] operator[SEP] identifier[getCanSMILES] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[smilesString] operator[=] identifier[SMILES] operator[SEP] identifier[getUniqueExtendedSMILES] operator[SEP] identifier[smilesString] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[smilesString] operator[=] identifier[monomer] operator[SEP] identifier[getCanSMILES] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[hasSmilesString] operator[=] operator[SEP] identifier[smilesString] operator[!=] Other[null] operator[&&] identifier[smilesString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[monomerMap] operator[SEP] {
identifier[monomerMap] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[String] , identifier[Monomer] operator[>] operator[SEP] identifier[String] operator[SEP] identifier[CASE_INSENSITIVE_ORDER] operator[SEP] operator[SEP] identifier[monomerDB] operator[SEP] identifier[put] operator[SEP] identifier[polymerType] , identifier[monomerMap] operator[SEP] operator[SEP]
}
identifier[Monomer] identifier[copyMonomer] operator[=] identifier[DeepCopy] operator[SEP] identifier[copy] operator[SEP] identifier[monomer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasSmilesString] operator[SEP] {
identifier[copyMonomer] operator[SEP] identifier[setCanSMILES] operator[SEP] identifier[smilesString] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[alreadyAdded] operator[=] literal[boolean] operator[SEP] identifier[alreadyAdded] operator[=] identifier[monomerMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[alternateId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[alreadyAdded] operator[SEP] {
identifier[monomerMap] operator[SEP] identifier[put] operator[SEP] identifier[alternateId] , identifier[copyMonomer] operator[SEP] operator[SEP] Keyword[boolean] identifier[alreadyInSMILESMap] operator[=] identifier[hasSmilesString] operator[&&] operator[SEP] identifier[smilesMonomerDB] operator[SEP] identifier[containsKey] operator[SEP] identifier[smilesString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[alreadyInSMILESMap] operator[SEP] {
identifier[smilesMonomerDB] operator[SEP] identifier[put] operator[SEP] identifier[smilesString] , identifier[copyMonomer] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[dbChanged] operator[SEP] {
identifier[MonomerFactory] operator[SEP] identifier[setDBChanged] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
|
public static JournalManager createJournal(Configuration conf, URI uri,
NamespaceInfo nsInfo, NameNodeMetrics metrics) {
Class<? extends JournalManager> clazz = getJournalClass(conf,
uri.getScheme());
try {
Constructor<? extends JournalManager> cons = clazz.getConstructor(
Configuration.class, URI.class, NamespaceInfo.class,
NameNodeMetrics.class);
return cons.newInstance(conf, uri, nsInfo, metrics);
} catch (Exception e) {
throw new IllegalArgumentException("Unable to construct journal, " + uri,
e);
}
} | class class_name[name] begin[{]
method[createJournal, return_type[type[JournalManager]], modifier[public static], parameter[conf, uri, nsInfo, metrics]] begin[{]
local_variable[type[Class], clazz]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Configuration, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NamespaceInfo, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NameNodeMetrics, sub_type=None))], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), name=cons)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=JournalManager, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nsInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metrics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=cons, 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 construct journal, "), operandr=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=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[}] | Keyword[public] Keyword[static] identifier[JournalManager] identifier[createJournal] operator[SEP] identifier[Configuration] identifier[conf] , identifier[URI] identifier[uri] , identifier[NamespaceInfo] identifier[nsInfo] , identifier[NameNodeMetrics] identifier[metrics] operator[SEP] {
identifier[Class] operator[<] operator[?] Keyword[extends] identifier[JournalManager] operator[>] identifier[clazz] operator[=] identifier[getJournalClass] operator[SEP] identifier[conf] , identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[JournalManager] operator[>] identifier[cons] operator[=] identifier[clazz] operator[SEP] identifier[getConstructor] operator[SEP] identifier[Configuration] operator[SEP] Keyword[class] , identifier[URI] operator[SEP] Keyword[class] , identifier[NamespaceInfo] operator[SEP] Keyword[class] , identifier[NameNodeMetrics] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[cons] operator[SEP] identifier[newInstance] operator[SEP] identifier[conf] , identifier[uri] , identifier[nsInfo] , identifier[metrics] 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[+] identifier[uri] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static <T, PT extends ObjectIntProcedure<? super T>> void forEachWithIndex(
Iterable<T> iterable,
PT procedure,
int minForkSize,
int taskCount)
{
PassThruObjectIntProcedureFactory<PT> procedureFactory = new PassThruObjectIntProcedureFactory<>(procedure);
PassThruCombiner<PT> combiner = new PassThruCombiner<>();
FJIterate.forEachWithIndex(iterable, procedureFactory, combiner, minForkSize, taskCount);
} | class class_name[name] begin[{]
method[forEachWithIndex, return_type[void], modifier[public static], parameter[iterable, procedure, minForkSize, taskCount]] begin[{]
local_variable[type[PassThruObjectIntProcedureFactory], procedureFactory]
local_variable[type[PassThruCombiner], combiner]
call[FJIterate.forEachWithIndex, parameter[member[.iterable], member[.procedureFactory], member[.combiner], member[.minForkSize], member[.taskCount]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[PT] Keyword[extends] identifier[ObjectIntProcedure] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] Keyword[void] identifier[forEachWithIndex] operator[SEP] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[iterable] , identifier[PT] identifier[procedure] , Keyword[int] identifier[minForkSize] , Keyword[int] identifier[taskCount] operator[SEP] {
identifier[PassThruObjectIntProcedureFactory] operator[<] identifier[PT] operator[>] identifier[procedureFactory] operator[=] Keyword[new] identifier[PassThruObjectIntProcedureFactory] operator[<] operator[>] operator[SEP] identifier[procedure] operator[SEP] operator[SEP] identifier[PassThruCombiner] operator[<] identifier[PT] operator[>] identifier[combiner] operator[=] Keyword[new] identifier[PassThruCombiner] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[FJIterate] operator[SEP] identifier[forEachWithIndex] operator[SEP] identifier[iterable] , identifier[procedureFactory] , identifier[combiner] , identifier[minForkSize] , identifier[taskCount] operator[SEP] operator[SEP]
}
|
public static void readStartObjectToken(JsonParser jsonParser,
String parentFieldName)
throws IOException {
readToken(jsonParser, parentFieldName, JsonToken.START_OBJECT);
} | class class_name[name] begin[{]
method[readStartObjectToken, return_type[void], modifier[public static], parameter[jsonParser, parentFieldName]] begin[{]
call[.readToken, parameter[member[.jsonParser], member[.parentFieldName], member[JsonToken.START_OBJECT]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[readStartObjectToken] operator[SEP] identifier[JsonParser] identifier[jsonParser] , identifier[String] identifier[parentFieldName] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[readToken] operator[SEP] identifier[jsonParser] , identifier[parentFieldName] , identifier[JsonToken] operator[SEP] identifier[START_OBJECT] operator[SEP] operator[SEP]
}
|
@Override
public UpdateJobExecutionResult updateJobExecution(UpdateJobExecutionRequest request) {
request = beforeClientExecution(request);
return executeUpdateJobExecution(request);
} | class class_name[name] begin[{]
method[updateJobExecution, return_type[type[UpdateJobExecutionResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeUpdateJobExecution, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[UpdateJobExecutionResult] identifier[updateJobExecution] operator[SEP] identifier[UpdateJobExecutionRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateJobExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void setSelectedTime(int hour, int minute) {
final int count = getAdapter().getCount() - 1;
int itemPosition = -1;
for(int i=0; i<count; i++) {
final TimeItem item = ((TimeItem) getAdapter().getItem(i));
if(item.getHour() == hour && item.getMinute() == minute) {
itemPosition = i;
break;
}
}
if(itemPosition >= 0)
setSelection(itemPosition);
else {
// create a temporary TimeItem to select:
selectTemporary(new TimeItem(formatTime(hour, minute), hour, minute, NO_ID));
}
} | class class_name[name] begin[{]
method[setSelectedTime, return_type[void], modifier[public], parameter[hour, minute]] begin[{]
local_variable[type[int], count]
local_variable[type[int], itemPosition]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getAdapter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getItem, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TimeItem, sub_type=None)), name=item)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TimeItem, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHour, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=MemberReference(member=hour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMinute, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=MemberReference(member=minute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=itemPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.itemPosition], >=, literal[0]]] begin[{]
call[.setSelection, parameter[member[.itemPosition]]]
else begin[{]
call[.selectTemporary, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=hour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formatTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=hour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NO_ID, 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=TimeItem, sub_type=None))]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSelectedTime] operator[SEP] Keyword[int] identifier[hour] , Keyword[int] identifier[minute] operator[SEP] {
Keyword[final] Keyword[int] identifier[count] operator[=] identifier[getAdapter] operator[SEP] operator[SEP] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[int] identifier[itemPosition] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] identifier[TimeItem] identifier[item] operator[=] operator[SEP] operator[SEP] identifier[TimeItem] operator[SEP] identifier[getAdapter] operator[SEP] operator[SEP] operator[SEP] identifier[getItem] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[getHour] operator[SEP] operator[SEP] operator[==] identifier[hour] operator[&&] identifier[item] operator[SEP] identifier[getMinute] operator[SEP] operator[SEP] operator[==] identifier[minute] operator[SEP] {
identifier[itemPosition] operator[=] identifier[i] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[itemPosition] operator[>=] Other[0] operator[SEP] identifier[setSelection] operator[SEP] identifier[itemPosition] operator[SEP] operator[SEP] Keyword[else] {
identifier[selectTemporary] operator[SEP] Keyword[new] identifier[TimeItem] operator[SEP] identifier[formatTime] operator[SEP] identifier[hour] , identifier[minute] operator[SEP] , identifier[hour] , identifier[minute] , identifier[NO_ID] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public Set<String> patterns() {
return patterns(file -> aggregators.stream()
.noneMatch(it -> it.fileset().contains(file)))
.map(v -> "/" + v + "/**")
.collect(Collectors.toCollection(LinkedHashSet::new));
} | class class_name[name] begin[{]
method[patterns, return_type[type[Set]], modifier[public], parameter[]] begin[{]
return[call[.patterns, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=aggregators, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=fileset, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=it, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=noneMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}] | Keyword[public] identifier[Set] operator[<] identifier[String] operator[>] identifier[patterns] operator[SEP] operator[SEP] {
Keyword[return] identifier[patterns] operator[SEP] identifier[file] operator[->] identifier[aggregators] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[noneMatch] operator[SEP] identifier[it] operator[->] identifier[it] operator[SEP] identifier[fileset] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[v] operator[->] literal[String] operator[+] identifier[v] operator[+] literal[String] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toCollection] operator[SEP] identifier[LinkedHashSet] operator[::] Keyword[new] operator[SEP] operator[SEP] operator[SEP]
}
|
private static int getMainNumber(int mainNumber, String dptID)
{
return mainNumber != 0 ? mainNumber : Integer.parseInt(dptID.substring(0, dptID
.indexOf('.')));
} | class class_name[name] begin[{]
method[getMainNumber, return_type[type[int]], modifier[private static], parameter[mainNumber, dptID]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=mainNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=dptID, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=dptID, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), if_true=MemberReference(member=mainNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[int] identifier[getMainNumber] operator[SEP] Keyword[int] identifier[mainNumber] , identifier[String] identifier[dptID] operator[SEP] {
Keyword[return] identifier[mainNumber] operator[!=] Other[0] operator[?] identifier[mainNumber] operator[:] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[dptID] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[dptID] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public WebSocket onCompleted() throws Exception {
logger.trace("onCompleted {}", webSocket);
if (webSocket == null) {
logger.error("WebSocket Handshake Failed");
status = Socket.STATUS.ERROR;
return null;
}
TransportsUtil.invokeFunction(TRANSPORT, decoders, functions, Request.TRANSPORT.class, name(), TRANSPORT.name(), resolver);
return webSocket;
} | class class_name[name] begin[{]
method[onCompleted, return_type[type[WebSocket]], modifier[public], parameter[]] begin[{]
call[logger.trace, parameter[literal["onCompleted {}"], member[.webSocket]]]
if[binary_operation[member[.webSocket], ==, literal[null]]] begin[{]
call[logger.error, parameter[literal["WebSocket Handshake Failed"]]]
assign[member[.status], member[Socket.STATUS.ERROR]]
return[literal[null]]
else begin[{]
None
end[}]
call[TransportsUtil.invokeFunction, parameter[member[.TRANSPORT], member[.decoders], member[.functions], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=Request, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TRANSPORT, sub_type=None)), call[.name, parameter[]], call[TRANSPORT.name, parameter[]], member[.resolver]]]
return[member[.webSocket]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[WebSocket] identifier[onCompleted] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[webSocket] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[webSocket] operator[==] Other[null] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[status] operator[=] identifier[Socket] operator[SEP] identifier[STATUS] operator[SEP] identifier[ERROR] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[TransportsUtil] operator[SEP] identifier[invokeFunction] operator[SEP] identifier[TRANSPORT] , identifier[decoders] , identifier[functions] , identifier[Request] operator[SEP] identifier[TRANSPORT] operator[SEP] Keyword[class] , identifier[name] operator[SEP] operator[SEP] , identifier[TRANSPORT] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[resolver] operator[SEP] operator[SEP] Keyword[return] identifier[webSocket] operator[SEP]
}
|
private static File[] classPath() {
final String[] fileNames =
System.getProperty("java.class.path").split(File.pathSeparator);
final File[] files = new File[fileNames.length];
for (int i = 0; i < files.length; ++i) {
files[i] = new File(fileNames[i]);
}
return files;
} | class class_name[name] begin[{]
method[classPath, return_type[type[File]], modifier[private static], parameter[]] begin[{]
local_variable[type[String], fileNames]
local_variable[type[File], files]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=fileNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=File, sub_type=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=files, 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[.files]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[File] operator[SEP] operator[SEP] identifier[classPath] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[fileNames] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[File] operator[SEP] identifier[pathSeparator] operator[SEP] operator[SEP] Keyword[final] identifier[File] operator[SEP] operator[SEP] identifier[files] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[fileNames] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[files] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[files] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[fileNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[files] operator[SEP]
}
|
public static String unicodeCodePoint2PercentHexString(int codePoint, String charsetName) {
if (!Character.isDefined(codePoint))
throw new IllegalArgumentException(String.format("Given code point [U+%1$04X - %1$d] not assigned to an abstract character.", codePoint));
if (Character.getType(codePoint) == Character.SURROGATE)
throw new IllegalArgumentException(String.format("Given code point [U+%1$04X - %1$d] is an unencodable (by itself) surrogate character.", codePoint));
Charset charset = Charset.availableCharsets().get(charsetName);
if (charset == null)
throw new IllegalArgumentException(String.format("Unsupported charset [%s].", charsetName));
char[] chars = Character.toChars(codePoint);
ByteBuffer byteBuffer = null;
try {
byteBuffer = charset.newEncoder().encode(CharBuffer.wrap(chars));
} catch (CharacterCodingException e) {
String message = String.format("Given code point [U+%1$04X - %1$d] cannot be encode in given charset [%2$s].", codePoint, charsetName);
throw new IllegalArgumentException(message, e);
}
byteBuffer.rewind();
StringBuilder encodedString = new StringBuilder();
for (int i = 0; i < byteBuffer.limit(); i++) {
String asHex = Integer.toHexString(byteBuffer.get() & 0xFF);
encodedString.append("%").append(asHex.length() == 1 ? "0" : "").append(asHex);
}
return encodedString.toString();
} | class class_name[name] begin[{]
method[unicodeCodePoint2PercentHexString, return_type[type[String]], modifier[public static], parameter[codePoint, charsetName]] begin[{]
if[call[Character.isDefined, parameter[member[.codePoint]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Given code point [U+%1$04X - %1$d] not assigned to an abstract character."), MemberReference(member=codePoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[Character.getType, parameter[member[.codePoint]]], ==, member[Character.SURROGATE]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Given code point [U+%1$04X - %1$d] is an unencodable (by itself) surrogate character."), MemberReference(member=codePoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Charset], charset]
if[binary_operation[member[.charset], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported charset [%s]."), MemberReference(member=charsetName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[char], chars]
local_variable[type[ByteBuffer], byteBuffer]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=byteBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newEncoder, postfix_operators=[], prefix_operators=[], qualifier=charset, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=CharBuffer, selectors=[], type_arguments=None)], member=encode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Given code point [U+%1$04X - %1$d] cannot be encode in given charset [%2$s]."), MemberReference(member=codePoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charsetName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CharacterCodingException']))], finally_block=None, label=None, resources=None)
call[byteBuffer.rewind, parameter[]]
local_variable[type[StringBuilder], encodedString]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=byteBuffer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=asHex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%")], member=append, postfix_operators=[], prefix_operators=[], qualifier=encodedString, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=asHex, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0"))], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=asHex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=limit, postfix_operators=[], prefix_operators=[], qualifier=byteBuffer, 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[call[encodedString.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[unicodeCodePoint2PercentHexString] operator[SEP] Keyword[int] identifier[codePoint] , identifier[String] identifier[charsetName] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[Character] operator[SEP] identifier[isDefined] operator[SEP] identifier[codePoint] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[codePoint] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[getType] operator[SEP] identifier[codePoint] operator[SEP] operator[==] identifier[Character] operator[SEP] identifier[SURROGATE] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[codePoint] operator[SEP] operator[SEP] operator[SEP] identifier[Charset] identifier[charset] operator[=] identifier[Charset] operator[SEP] identifier[availableCharsets] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[charsetName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[charset] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[charsetName] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[chars] operator[=] identifier[Character] operator[SEP] identifier[toChars] operator[SEP] identifier[codePoint] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[byteBuffer] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[byteBuffer] operator[=] identifier[charset] operator[SEP] identifier[newEncoder] operator[SEP] operator[SEP] operator[SEP] identifier[encode] operator[SEP] identifier[CharBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[chars] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CharacterCodingException] identifier[e] operator[SEP] {
identifier[String] identifier[message] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[codePoint] , identifier[charsetName] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[message] , identifier[e] operator[SEP] operator[SEP]
}
identifier[byteBuffer] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[encodedString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[byteBuffer] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[asHex] operator[=] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[byteBuffer] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[encodedString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[asHex] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[asHex] operator[SEP] operator[SEP]
}
Keyword[return] identifier[encodedString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public Type skipTypeVars(Type site, boolean capture) {
while (site.hasTag(TYPEVAR)) {
site = site.getUpperBound();
}
return capture ? capture(site) : site;
} | class class_name[name] begin[{]
method[skipTypeVars, return_type[type[Type]], modifier[public], parameter[site, capture]] begin[{]
while[call[site.hasTag, parameter[member[.TYPEVAR]]]] begin[{]
assign[member[.site], call[site.getUpperBound, parameter[]]]
end[}]
return[TernaryExpression(condition=MemberReference(member=capture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=site, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=site, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=capture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] identifier[Type] identifier[skipTypeVars] operator[SEP] identifier[Type] identifier[site] , Keyword[boolean] identifier[capture] operator[SEP] {
Keyword[while] operator[SEP] identifier[site] operator[SEP] identifier[hasTag] operator[SEP] identifier[TYPEVAR] operator[SEP] operator[SEP] {
identifier[site] operator[=] identifier[site] operator[SEP] identifier[getUpperBound] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[capture] operator[?] identifier[capture] operator[SEP] identifier[site] operator[SEP] operator[:] identifier[site] operator[SEP]
}
|
public void marshall(ActivityTypeConfiguration activityTypeConfiguration, ProtocolMarshaller protocolMarshaller) {
if (activityTypeConfiguration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(activityTypeConfiguration.getDefaultTaskStartToCloseTimeout(), DEFAULTTASKSTARTTOCLOSETIMEOUT_BINDING);
protocolMarshaller.marshall(activityTypeConfiguration.getDefaultTaskHeartbeatTimeout(), DEFAULTTASKHEARTBEATTIMEOUT_BINDING);
protocolMarshaller.marshall(activityTypeConfiguration.getDefaultTaskList(), DEFAULTTASKLIST_BINDING);
protocolMarshaller.marshall(activityTypeConfiguration.getDefaultTaskPriority(), DEFAULTTASKPRIORITY_BINDING);
protocolMarshaller.marshall(activityTypeConfiguration.getDefaultTaskScheduleToStartTimeout(), DEFAULTTASKSCHEDULETOSTARTTIMEOUT_BINDING);
protocolMarshaller.marshall(activityTypeConfiguration.getDefaultTaskScheduleToCloseTimeout(), DEFAULTTASKSCHEDULETOCLOSETIMEOUT_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[activityTypeConfiguration, protocolMarshaller]] begin[{]
if[binary_operation[member[.activityTypeConfiguration], ==, 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=getDefaultTaskStartToCloseTimeout, postfix_operators=[], prefix_operators=[], qualifier=activityTypeConfiguration, selectors=[], type_arguments=None), MemberReference(member=DEFAULTTASKSTARTTOCLOSETIMEOUT_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=getDefaultTaskHeartbeatTimeout, postfix_operators=[], prefix_operators=[], qualifier=activityTypeConfiguration, selectors=[], type_arguments=None), MemberReference(member=DEFAULTTASKHEARTBEATTIMEOUT_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=getDefaultTaskList, postfix_operators=[], prefix_operators=[], qualifier=activityTypeConfiguration, selectors=[], type_arguments=None), MemberReference(member=DEFAULTTASKLIST_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=getDefaultTaskPriority, postfix_operators=[], prefix_operators=[], qualifier=activityTypeConfiguration, selectors=[], type_arguments=None), MemberReference(member=DEFAULTTASKPRIORITY_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=getDefaultTaskScheduleToStartTimeout, postfix_operators=[], prefix_operators=[], qualifier=activityTypeConfiguration, selectors=[], type_arguments=None), MemberReference(member=DEFAULTTASKSCHEDULETOSTARTTIMEOUT_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=getDefaultTaskScheduleToCloseTimeout, postfix_operators=[], prefix_operators=[], qualifier=activityTypeConfiguration, selectors=[], type_arguments=None), MemberReference(member=DEFAULTTASKSCHEDULETOCLOSETIMEOUT_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[ActivityTypeConfiguration] identifier[activityTypeConfiguration] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[activityTypeConfiguration] 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[activityTypeConfiguration] operator[SEP] identifier[getDefaultTaskStartToCloseTimeout] operator[SEP] operator[SEP] , identifier[DEFAULTTASKSTARTTOCLOSETIMEOUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTypeConfiguration] operator[SEP] identifier[getDefaultTaskHeartbeatTimeout] operator[SEP] operator[SEP] , identifier[DEFAULTTASKHEARTBEATTIMEOUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTypeConfiguration] operator[SEP] identifier[getDefaultTaskList] operator[SEP] operator[SEP] , identifier[DEFAULTTASKLIST_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTypeConfiguration] operator[SEP] identifier[getDefaultTaskPriority] operator[SEP] operator[SEP] , identifier[DEFAULTTASKPRIORITY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTypeConfiguration] operator[SEP] identifier[getDefaultTaskScheduleToStartTimeout] operator[SEP] operator[SEP] , identifier[DEFAULTTASKSCHEDULETOSTARTTIMEOUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTypeConfiguration] operator[SEP] identifier[getDefaultTaskScheduleToCloseTimeout] operator[SEP] operator[SEP] , identifier[DEFAULTTASKSCHEDULETOCLOSETIMEOUT_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]
}
}
|
@SuppressWarnings("unchecked")
public static Collection<PluginDefinition> loadFromXmlPluginPackageDefinitions(final ClassLoader cl, final InputStream in)
throws PluginConfigurationException {
List<PluginDefinition> res = new ArrayList<PluginDefinition>();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
Document document;
try {
DocumentBuilder loader = factory.newDocumentBuilder();
DOMReader reader = new DOMReader();
document = reader.read(loader.parse(in));
} catch (Exception e) {
throw new PluginConfigurationException(e.getMessage(), e);
}
Element plugins = document.getRootElement();
// TODO : validate against schema
// iterate through child elements of root
for (Iterator<Element> i = plugins.elementIterator(); i.hasNext();) {
res.add(parsePluginDefinition(cl, i.next()));
}
return res;
} | class class_name[name] begin[{]
method[loadFromXmlPluginPackageDefinitions, return_type[type[Collection]], modifier[public static], parameter[cl, in]] begin[{]
local_variable[type[List], res]
local_variable[type[DocumentBuilderFactory], factory]
local_variable[type[Document], document]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newDocumentBuilder, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=loader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DocumentBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMReader, sub_type=None)), name=reader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DOMReader, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[], type_arguments=None)], member=read, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=PluginConfigurationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
local_variable[type[Element], plugins]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None)], member=parsePluginDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=elementIterator, postfix_operators=[], prefix_operators=[], qualifier=plugins, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[member[.res]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[PluginDefinition] operator[>] identifier[loadFromXmlPluginPackageDefinitions] operator[SEP] Keyword[final] identifier[ClassLoader] identifier[cl] , Keyword[final] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[PluginConfigurationException] {
identifier[List] operator[<] identifier[PluginDefinition] operator[>] identifier[res] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[PluginDefinition] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[DocumentBuilderFactory] identifier[factory] operator[=] identifier[DocumentBuilderFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[Document] identifier[document] operator[SEP] Keyword[try] {
identifier[DocumentBuilder] identifier[loader] operator[=] identifier[factory] operator[SEP] identifier[newDocumentBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[DOMReader] identifier[reader] operator[=] Keyword[new] identifier[DOMReader] operator[SEP] operator[SEP] operator[SEP] identifier[document] operator[=] identifier[reader] operator[SEP] identifier[read] operator[SEP] identifier[loader] operator[SEP] identifier[parse] operator[SEP] identifier[in] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[PluginConfigurationException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
identifier[Element] identifier[plugins] operator[=] identifier[document] operator[SEP] identifier[getRootElement] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Element] operator[>] identifier[i] operator[=] identifier[plugins] operator[SEP] identifier[elementIterator] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[res] operator[SEP] identifier[add] operator[SEP] identifier[parsePluginDefinition] operator[SEP] identifier[cl] , identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[res] operator[SEP]
}
|
public PubsubFuture<Topic> getTopic(final String canonicalTopic) {
validateCanonicalTopic(canonicalTopic);
return get("get topic", canonicalTopic, readJson(Topic.class));
} | class class_name[name] begin[{]
method[getTopic, return_type[type[PubsubFuture]], modifier[public], parameter[canonicalTopic]] begin[{]
call[.validateCanonicalTopic, parameter[member[.canonicalTopic]]]
return[call[.get, parameter[literal["get topic"], member[.canonicalTopic], call[.readJson, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Topic, sub_type=None))]]]]]
end[}]
END[}] | Keyword[public] identifier[PubsubFuture] operator[<] identifier[Topic] operator[>] identifier[getTopic] operator[SEP] Keyword[final] identifier[String] identifier[canonicalTopic] operator[SEP] {
identifier[validateCanonicalTopic] operator[SEP] identifier[canonicalTopic] operator[SEP] operator[SEP] Keyword[return] identifier[get] operator[SEP] literal[String] , identifier[canonicalTopic] , identifier[readJson] operator[SEP] identifier[Topic] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public double getAttributeAsDbl(int semantics, int offset, int ordinate) {
if (offset < 0 || offset >= m_pointCount)
throw new IndexOutOfBoundsException();
int ncomps = VertexDescription.getComponentCount(semantics);
if (ordinate >= ncomps)
throw new IndexOutOfBoundsException();
_verifyAllStreams();
int attributeIndex = m_description.getAttributeIndex(semantics);
// TODO check if statement
if (attributeIndex >= 0)// && m_vertexAttributes[attributeIndex] !=
// null) {
{
return m_vertexAttributes[attributeIndex].readAsDbl(offset * ncomps
+ ordinate);
}
return VertexDescription.getDefaultValue(semantics);
} | class class_name[name] begin[{]
method[getAttributeAsDbl, return_type[type[double]], modifier[public], parameter[semantics, offset, ordinate]] begin[{]
if[binary_operation[binary_operation[member[.offset], <, literal[0]], ||, binary_operation[member[.offset], >=, member[.m_pointCount]]]] 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[}]
local_variable[type[int], ncomps]
if[binary_operation[member[.ordinate], >=, member[.ncomps]]] 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[}]
call[._verifyAllStreams, parameter[]]
local_variable[type[int], attributeIndex]
if[binary_operation[member[.attributeIndex], >=, literal[0]]] begin[{]
return[member[.m_vertexAttributes]]
else begin[{]
None
end[}]
return[call[VertexDescription.getDefaultValue, parameter[member[.semantics]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[double] identifier[getAttributeAsDbl] operator[SEP] Keyword[int] identifier[semantics] , Keyword[int] identifier[offset] , Keyword[int] identifier[ordinate] operator[SEP] {
Keyword[if] operator[SEP] identifier[offset] operator[<] Other[0] operator[||] identifier[offset] operator[>=] identifier[m_pointCount] operator[SEP] Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ncomps] operator[=] identifier[VertexDescription] operator[SEP] identifier[getComponentCount] operator[SEP] identifier[semantics] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ordinate] operator[>=] identifier[ncomps] operator[SEP] Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] identifier[_verifyAllStreams] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[attributeIndex] operator[=] identifier[m_description] operator[SEP] identifier[getAttributeIndex] operator[SEP] identifier[semantics] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributeIndex] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[m_vertexAttributes] operator[SEP] identifier[attributeIndex] operator[SEP] operator[SEP] identifier[readAsDbl] operator[SEP] identifier[offset] operator[*] identifier[ncomps] operator[+] identifier[ordinate] operator[SEP] operator[SEP]
}
Keyword[return] identifier[VertexDescription] operator[SEP] identifier[getDefaultValue] operator[SEP] identifier[semantics] operator[SEP] operator[SEP]
}
|
public void authenticate(Activity activity) {
activity.startActivityForResult(EvernoteLoginActivity.createIntent(activity, mConsumerKey, mConsumerSecret, mSupportAppLinkedNotebooks, mLocale), REQUEST_CODE_LOGIN);
} | class class_name[name] begin[{]
method[authenticate, return_type[void], modifier[public], parameter[activity]] begin[{]
call[activity.startActivityForResult, parameter[call[EvernoteLoginActivity.createIntent, parameter[member[.activity], member[.mConsumerKey], member[.mConsumerSecret], member[.mSupportAppLinkedNotebooks], member[.mLocale]]], member[.REQUEST_CODE_LOGIN]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[authenticate] operator[SEP] identifier[Activity] identifier[activity] operator[SEP] {
identifier[activity] operator[SEP] identifier[startActivityForResult] operator[SEP] identifier[EvernoteLoginActivity] operator[SEP] identifier[createIntent] operator[SEP] identifier[activity] , identifier[mConsumerKey] , identifier[mConsumerSecret] , identifier[mSupportAppLinkedNotebooks] , identifier[mLocale] operator[SEP] , identifier[REQUEST_CODE_LOGIN] operator[SEP] operator[SEP]
}
|
public static void safeRenameRecursively(FileSystem fileSystem, Path from, Path to) throws IOException {
for (FileStatus fromFile : FileListUtils.listFilesRecursively(fileSystem, from)) {
Path relativeFilePath =
new Path(StringUtils.substringAfter(fromFile.getPath().toString(), from.toString() + Path.SEPARATOR));
Path toFilePath = new Path(to, relativeFilePath);
if (!fileSystem.exists(toFilePath)) {
boolean renamed = false;
// underlying file open can fail with file not found error due to some race condition
// when the parent directory is created in another thread, so retry a few times
for (int i = 0; !renamed && i < MAX_RENAME_TRIES; i++) {
try {
renamed = fileSystem.rename(fromFile.getPath(), toFilePath);
break;
} catch (FileNotFoundException e) {
if (i + 1 >= MAX_RENAME_TRIES) {
throw e;
}
}
}
if (!renamed) {
throw new IOException(String.format("Failed to rename %s to %s.", fromFile.getPath(), toFilePath));
}
log.info(String.format("Renamed %s to %s", fromFile.getPath(), toFilePath));
} else {
log.info(String.format("File already exists %s. Will not rewrite", toFilePath));
}
}
} | class class_name[name] begin[{]
method[safeRenameRecursively, return_type[void], modifier[public static], parameter[fileSystem, from, to]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=fromFile, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=from, selectors=[], type_arguments=None), operandr=MemberReference(member=SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=Path, selectors=[]), operator=+)], member=substringAfter, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), name=relativeFilePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relativeFilePath, 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=Path, sub_type=None)), name=toFilePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=toFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=fileSystem, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File already exists %s. Will not rewrite"), MemberReference(member=toFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=renamed)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=renamed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=fromFile, selectors=[], type_arguments=None), MemberReference(member=toFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rename, postfix_operators=[], prefix_operators=[], qualifier=fileSystem, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[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=MAX_RENAME_TRIES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=renamed, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_RENAME_TRIES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=MemberReference(member=renamed, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to rename %s to %s."), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=fromFile, selectors=[], type_arguments=None), MemberReference(member=toFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Renamed %s to %s"), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=fromFile, selectors=[], type_arguments=None), MemberReference(member=toFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=fileSystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listFilesRecursively, postfix_operators=[], prefix_operators=[], qualifier=FileListUtils, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fromFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileStatus, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[safeRenameRecursively] operator[SEP] identifier[FileSystem] identifier[fileSystem] , identifier[Path] identifier[from] , identifier[Path] identifier[to] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[for] operator[SEP] identifier[FileStatus] identifier[fromFile] operator[:] identifier[FileListUtils] operator[SEP] identifier[listFilesRecursively] operator[SEP] identifier[fileSystem] , identifier[from] operator[SEP] operator[SEP] {
identifier[Path] identifier[relativeFilePath] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[StringUtils] operator[SEP] identifier[substringAfter] operator[SEP] identifier[fromFile] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[from] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] identifier[Path] operator[SEP] identifier[SEPARATOR] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[toFilePath] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[to] , identifier[relativeFilePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[fileSystem] operator[SEP] identifier[exists] operator[SEP] identifier[toFilePath] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[renamed] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] operator[!] identifier[renamed] operator[&&] identifier[i] operator[<] identifier[MAX_RENAME_TRIES] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[try] {
identifier[renamed] operator[=] identifier[fileSystem] operator[SEP] identifier[rename] operator[SEP] identifier[fromFile] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[toFilePath] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[>=] identifier[MAX_RENAME_TRIES] operator[SEP] {
Keyword[throw] identifier[e] operator[SEP]
}
}
}
Keyword[if] operator[SEP] operator[!] identifier[renamed] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[fromFile] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[toFilePath] operator[SEP] operator[SEP] operator[SEP]
}
identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[fromFile] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[toFilePath] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[toFilePath] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public String getDatanodeReport() {
StringBuffer buffer = new StringBuffer();
long c = getCapacity();
long r = getRemaining();
long u = getDfsUsed();
long nonDFSUsed = getNonDfsUsed();
float usedPercent = getDfsUsedPercent();
float remainingPercent = getRemainingPercent();
buffer.append("Name: "+name+"\n");
if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
buffer.append("Rack: "+location+"\n");
}
buffer.append("Decommission Status : ");
if (isDecommissioned()) {
buffer.append("Decommissioned\n");
} else if (isDecommissionInProgress()) {
buffer.append("Decommission in progress\n");
} else {
buffer.append("Normal\n");
}
buffer.append("Configured Capacity: "+c+" ("+StringUtils.byteDesc(c)+")"+"\n");
buffer.append("DFS Used: "+u+" ("+StringUtils.byteDesc(u)+")"+"\n");
buffer.append("Non DFS Used: "+nonDFSUsed+" ("+StringUtils.byteDesc(nonDFSUsed)+")"+"\n");
buffer.append("DFS Remaining: " +r+ "("+StringUtils.byteDesc(r)+")"+"\n");
buffer.append("DFS Used%: "+StringUtils.limitDecimalTo2(usedPercent)+"%\n");
buffer.append("DFS Remaining%: "+StringUtils.limitDecimalTo2(remainingPercent)+"%\n");
buffer.append("Last contact: "+new Date(lastUpdate)+"\n");
return buffer.toString();
} | class class_name[name] begin[{]
method[getDatanodeReport, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[StringBuffer], buffer]
local_variable[type[long], c]
local_variable[type[long], r]
local_variable[type[long], u]
local_variable[type[long], nonDFSUsed]
local_variable[type[float], usedPercent]
local_variable[type[float], remainingPercent]
call[buffer.append, parameter[binary_operation[binary_operation[literal["Name: "], +, member[.name]], +, literal["\n"]]]]
if[call[NetworkTopology.DEFAULT_RACK.equals, parameter[member[.location]]]] begin[{]
call[buffer.append, parameter[binary_operation[binary_operation[literal["Rack: "], +, member[.location]], +, literal["\n"]]]]
else begin[{]
None
end[}]
call[buffer.append, parameter[literal["Decommission Status : "]]]
if[call[.isDecommissioned, parameter[]]] begin[{]
call[buffer.append, parameter[literal["Decommissioned\n"]]]
else begin[{]
if[call[.isDecommissionInProgress, parameter[]]] begin[{]
call[buffer.append, parameter[literal["Decommission in progress\n"]]]
else begin[{]
call[buffer.append, parameter[literal["Normal\n"]]]
end[}]
end[}]
call[buffer.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Configured Capacity: "], +, member[.c]], +, literal[" ("]], +, call[StringUtils.byteDesc, parameter[member[.c]]]], +, literal[")"]], +, literal["\n"]]]]
call[buffer.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["DFS Used: "], +, member[.u]], +, literal[" ("]], +, call[StringUtils.byteDesc, parameter[member[.u]]]], +, literal[")"]], +, literal["\n"]]]]
call[buffer.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Non DFS Used: "], +, member[.nonDFSUsed]], +, literal[" ("]], +, call[StringUtils.byteDesc, parameter[member[.nonDFSUsed]]]], +, literal[")"]], +, literal["\n"]]]]
call[buffer.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["DFS Remaining: "], +, member[.r]], +, literal["("]], +, call[StringUtils.byteDesc, parameter[member[.r]]]], +, literal[")"]], +, literal["\n"]]]]
call[buffer.append, parameter[binary_operation[binary_operation[literal["DFS Used%: "], +, call[StringUtils.limitDecimalTo2, parameter[member[.usedPercent]]]], +, literal["%\n"]]]]
call[buffer.append, parameter[binary_operation[binary_operation[literal["DFS Remaining%: "], +, call[StringUtils.limitDecimalTo2, parameter[member[.remainingPercent]]]], +, literal["%\n"]]]]
call[buffer.append, parameter[binary_operation[binary_operation[literal["Last contact: "], +, ClassCreator(arguments=[MemberReference(member=lastUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))], +, literal["\n"]]]]
return[call[buffer.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getDatanodeReport] operator[SEP] operator[SEP] {
identifier[StringBuffer] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[c] operator[=] identifier[getCapacity] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[r] operator[=] identifier[getRemaining] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[u] operator[=] identifier[getDfsUsed] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[nonDFSUsed] operator[=] identifier[getNonDfsUsed] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[usedPercent] operator[=] identifier[getDfsUsedPercent] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[remainingPercent] operator[=] identifier[getRemainingPercent] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[NetworkTopology] operator[SEP] identifier[DEFAULT_RACK] operator[SEP] identifier[equals] operator[SEP] identifier[location] operator[SEP] operator[SEP] {
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[location] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isDecommissioned] operator[SEP] operator[SEP] operator[SEP] {
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[isDecommissionInProgress] operator[SEP] operator[SEP] operator[SEP] {
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[c] operator[+] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[byteDesc] operator[SEP] identifier[c] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[u] operator[+] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[byteDesc] operator[SEP] identifier[u] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[nonDFSUsed] operator[+] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[byteDesc] operator[SEP] identifier[nonDFSUsed] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[r] operator[+] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[byteDesc] operator[SEP] identifier[r] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[limitDecimalTo2] operator[SEP] identifier[usedPercent] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[limitDecimalTo2] operator[SEP] identifier[remainingPercent] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] identifier[lastUpdate] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static final void appendValueToSql(StringBuilder sql, Object value) {
if (value == null) {
sql.append("NULL");
} else if (value instanceof Boolean) {
Boolean bool = (Boolean)value;
if (bool) {
sql.append('1');
} else {
sql.append('0');
}
} else {
appendEscapedSQLString(sql, value.toString());
}
} | class class_name[name] begin[{]
method[appendValueToSql, return_type[void], modifier[final public static], parameter[sql, value]] begin[{]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
call[sql.append, parameter[literal["NULL"]]]
else begin[{]
if[binary_operation[member[.value], instanceof, type[Boolean]]] begin[{]
local_variable[type[Boolean], bool]
if[member[.bool]] begin[{]
call[sql.append, parameter[literal['1']]]
else begin[{]
call[sql.append, parameter[literal['0']]]
end[}]
else begin[{]
call[.appendEscapedSQLString, parameter[member[.sql], call[value.toString, parameter[]]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] Keyword[void] identifier[appendValueToSql] operator[SEP] identifier[StringBuilder] identifier[sql] , identifier[Object] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Boolean] operator[SEP] {
identifier[Boolean] identifier[bool] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[bool] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[appendEscapedSQLString] operator[SEP] identifier[sql] , identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.BDA__FLAGS:
setFlags((Integer)newValue);
return;
case AfplibPackage.BDA__XOFFSET:
setXoffset((Integer)newValue);
return;
case AfplibPackage.BDA__YOFFSET:
setYoffset((Integer)newValue);
return;
case AfplibPackage.BDA__DATA:
setData((byte[])newValue);
return;
}
super.eSet(featureID, newValue);
} | class class_name[name] begin[{]
method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BDA__FLAGS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setFlags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=BDA__XOFFSET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setXoffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=BDA__YOFFSET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setYoffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=BDA__DATA, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=byte))], member=setData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BDA__FLAGS] operator[:] identifier[setFlags] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BDA__XOFFSET] operator[:] identifier[setXoffset] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BDA__YOFFSET] operator[:] identifier[setYoffset] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BDA__DATA] operator[:] identifier[setData] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.