code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
protected void updateGroups(final LoginContext _login,
final Person _person)
throws EFapsException
{
for (final JAASSystem system : JAASSystem.getAllJAASSystems()) {
if (system.getGroupJAASPrincipleClass() != null) {
final Set<?> groupsJaas = _login.getSubject().getPrincipals(system.getGroupJAASPrincipleClass());
final Set<Group> groupsEfaps = new HashSet<>();
for (final Object groupObj : groupsJaas) {
try {
final String groupKey = (String) system.getGroupMethodKey().invoke(groupObj);
final Group groupEfaps = Group.getWithJAASKey(system, groupKey);
if (groupEfaps != null) {
groupsEfaps.add(groupEfaps);
}
} catch (final IllegalAccessException e) {
LoginHandler.LOG.error("could not execute group key method for system " + system.getName(), e);
} catch (final IllegalArgumentException e) {
LoginHandler.LOG.error("could not execute group key method for system " + system.getName(), e);
} catch (final InvocationTargetException e) {
LoginHandler.LOG.error("could not execute group key method for system " + system.getName(), e);
}
}
_person.setGroups(system, groupsEfaps);
}
}
} | class class_name[name] begin[{]
method[updateGroups, return_type[void], modifier[protected], parameter[_login, _person]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getGroupJAASPrincipleClass, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSubject, postfix_operators=[], prefix_operators=[], qualifier=_login, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGroupJAASPrincipleClass, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None)], member=getPrincipals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=groupsJaas)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Set, 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=[], dimensions=None, name=HashSet, sub_type=None)), name=groupsEfaps)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getGroupMethodKey, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[MethodInvocation(arguments=[MemberReference(member=groupObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=groupKey)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=system, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWithJAASKey, postfix_operators=[], prefix_operators=[], qualifier=Group, selectors=[], type_arguments=None), name=groupEfaps)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=groupEfaps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groupEfaps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=groupsEfaps, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not execute group key method for system "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LoginHandler.LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not execute group key method for system "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LoginHandler.LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not execute group key method for system "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LoginHandler.LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=groupsJaas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=groupObj)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=system, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupsEfaps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setGroups, postfix_operators=[], prefix_operators=[], qualifier=_person, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAllJAASSystems, postfix_operators=[], prefix_operators=[], qualifier=JAASSystem, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=system)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=JAASSystem, sub_type=None))), label=None)
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[updateGroups] operator[SEP] Keyword[final] identifier[LoginContext] identifier[_login] , Keyword[final] identifier[Person] identifier[_person] operator[SEP] Keyword[throws] identifier[EFapsException] {
Keyword[for] operator[SEP] Keyword[final] identifier[JAASSystem] identifier[system] operator[:] identifier[JAASSystem] operator[SEP] identifier[getAllJAASSystems] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[system] operator[SEP] identifier[getGroupJAASPrincipleClass] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[Set] operator[<] operator[?] operator[>] identifier[groupsJaas] operator[=] identifier[_login] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] operator[SEP] identifier[getPrincipals] operator[SEP] identifier[system] operator[SEP] identifier[getGroupJAASPrincipleClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Group] operator[>] identifier[groupsEfaps] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Object] identifier[groupObj] operator[:] identifier[groupsJaas] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[String] identifier[groupKey] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[system] operator[SEP] identifier[getGroupMethodKey] operator[SEP] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[groupObj] operator[SEP] operator[SEP] Keyword[final] identifier[Group] identifier[groupEfaps] operator[=] identifier[Group] operator[SEP] identifier[getWithJAASKey] operator[SEP] identifier[system] , identifier[groupKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groupEfaps] operator[!=] Other[null] operator[SEP] {
identifier[groupsEfaps] operator[SEP] identifier[add] operator[SEP] identifier[groupEfaps] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IllegalAccessException] identifier[e] operator[SEP] {
identifier[LoginHandler] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[system] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IllegalArgumentException] identifier[e] operator[SEP] {
identifier[LoginHandler] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[system] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[InvocationTargetException] identifier[e] operator[SEP] {
identifier[LoginHandler] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[system] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[_person] operator[SEP] identifier[setGroups] operator[SEP] identifier[system] , identifier[groupsEfaps] operator[SEP] operator[SEP]
}
}
}
|
public static byte[] decode(final char[] data) {
final int len = data.length;
final byte[] out = new byte[len >> 1];
// two characters form the hex value.
for (int i = 0, j = 0; j < len; i++) {
int f = toDigit(data[j], j) << 4;
j++;
f = f | toDigit(data[j], j);
j++;
out[i] = (byte) (f & 0xFF);
}
return out;
} | class class_name[name] begin[{]
method[decode, return_type[type[byte]], modifier[public static], parameter[data]] begin[{]
local_variable[type[int], len]
local_variable[type[byte], out]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toDigit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=<<), name=f)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toDigit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=|)), label=None), StatementExpression(expression=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.out]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[decode] operator[SEP] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[data] operator[SEP] {
Keyword[final] Keyword[int] identifier[len] operator[=] identifier[data] operator[SEP] identifier[length] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[out] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[len] operator[>] operator[>] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[f] operator[=] identifier[toDigit] operator[SEP] identifier[data] operator[SEP] identifier[j] operator[SEP] , identifier[j] operator[SEP] operator[<<] Other[4] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[f] operator[=] identifier[f] operator[|] identifier[toDigit] operator[SEP] identifier[data] operator[SEP] identifier[j] operator[SEP] , identifier[j] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[out] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[f] operator[&] literal[Integer] operator[SEP] operator[SEP]
}
Keyword[return] identifier[out] operator[SEP]
}
|
public static Document parseDocument(String url) throws IOException {
return Jsoup
.connect(url)
.timeout(Constants.PARSING_TIMEOUT)
.userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
.referrer("http://www.google.com")
.get();
} | class class_name[name] begin[{]
method[parseDocument, return_type[type[Document]], modifier[public static], parameter[url]] begin[{]
return[call[Jsoup.connect, parameter[member[.url]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Document] identifier[parseDocument] operator[SEP] identifier[String] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[Jsoup] operator[SEP] identifier[connect] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[timeout] operator[SEP] identifier[Constants] operator[SEP] identifier[PARSING_TIMEOUT] operator[SEP] operator[SEP] identifier[userAgent] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[referrer] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
|
static public String relpath(String path)
{
if(path == null) return null;
StringBuilder b = new StringBuilder(path);
canonicalpath(b);
if(b.length() > 0) {
if(b.charAt(0) == '/')
b.deleteCharAt(0);
if(hasDriveLetter(b))
b.delete(0, 2);
}
return b.toString();
} | class class_name[name] begin[{]
method[relpath, return_type[type[String]], modifier[public static], parameter[path]] begin[{]
if[binary_operation[member[.path], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], b]
call[.canonicalpath, parameter[member[.b]]]
if[binary_operation[call[b.length, parameter[]], >, literal[0]]] begin[{]
if[binary_operation[call[b.charAt, parameter[literal[0]]], ==, literal['/']]] begin[{]
call[b.deleteCharAt, parameter[literal[0]]]
else begin[{]
None
end[}]
if[call[.hasDriveLetter, parameter[member[.b]]]] begin[{]
call[b.delete, parameter[literal[0], literal[2]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[call[b.toString, parameter[]]]
end[}]
END[}] | Keyword[static] Keyword[public] identifier[String] identifier[relpath] operator[SEP] identifier[String] identifier[path] operator[SEP] {
Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[StringBuilder] identifier[b] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[canonicalpath] operator[SEP] identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] identifier[b] operator[SEP] identifier[deleteCharAt] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasDriveLetter] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[delete] operator[SEP] Other[0] , Other[2] operator[SEP] operator[SEP]
}
Keyword[return] identifier[b] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static PartitionReader createReader(Settings settings, PartitionDefinition partition, Log log) {
if (!SettingsUtils.hasPinnedNode(settings) && partition.getLocations().length > 0) {
String pinAddress = checkLocality(partition.getLocations(), log);
if (pinAddress != null) {
if (log.isDebugEnabled()) {
log.debug(String.format("Partition reader instance [%s] assigned to [%s]", partition, pinAddress));
}
SettingsUtils.pinNode(settings, pinAddress);
}
}
ClusterInfo clusterInfo = InitializationUtils.discoverClusterInfo(settings, log);
ValueReader reader = ObjectUtils.instantiate(settings.getSerializerValueReaderClassName(), settings);
// initialize REST client
RestRepository repository = new RestRepository(settings);
Mapping fieldMapping = null;
if (StringUtils.hasText(partition.getSerializedMapping())) {
fieldMapping = IOUtils.deserializeFromBase64(partition.getSerializedMapping());
}
else {
log.warn(String.format("No mapping found for [%s] - either no index exists or the partition configuration has been corrupted", partition));
}
ScrollReader scrollReader = new ScrollReader(ScrollReaderConfigBuilder.builder(reader, fieldMapping, settings));
if (settings.getNodesClientOnly()) {
String clientNode = repository.getRestClient().getCurrentNode();
if (log.isDebugEnabled()) {
log.debug(String.format("Client-node routing detected; partition reader instance [%s] assigned to [%s]",
partition, clientNode));
}
SettingsUtils.pinNode(settings, clientNode);
}
// take into account client node routing
boolean includeVersion = settings.getReadMetadata() && settings.getReadMetadataVersion();
Resource read = new Resource(settings, true);
SearchRequestBuilder requestBuilder =
new SearchRequestBuilder(clusterInfo.getMajorVersion(), includeVersion)
.resource(read)
// Overwrite the index name from the resource to be that of the concrete index in the partition definition
.indices(partition.getIndex())
.query(QueryUtils.parseQuery(settings))
.scroll(settings.getScrollKeepAlive())
.size(settings.getScrollSize())
.limit(settings.getScrollLimit())
.fields(SettingsUtils.determineSourceFields(settings))
.filters(QueryUtils.parseFilters(settings))
.shard(Integer.toString(partition.getShardId()))
.readMetadata(settings.getReadMetadata())
.local(true)
.preference(settings.getShardPreference())
.excludeSource(settings.getExcludeSource());
if (partition.getSlice() != null && partition.getSlice().max > 1) {
requestBuilder.slice(partition.getSlice().id, partition.getSlice().max);
}
String[] indices = read.index().split(",");
if (QueryUtils.isExplicitlyRequested(partition.getIndex(), indices) == false) {
IndicesAliases indicesAliases =
new GetAliasesRequestBuilder(repository.getRestClient())
.indices(partition.getIndex())
.execute().getIndices();
Map<String, IndicesAliases.Alias> aliases = indicesAliases.getAliases(partition.getIndex());
if (aliases != null && aliases.size() > 0) {
requestBuilder = applyAliasMetadata(clusterInfo.getMajorVersion(), aliases, requestBuilder, partition.getIndex(), indices);
}
}
return new PartitionReader(scrollReader, repository, requestBuilder);
} | class class_name[name] begin[{]
method[createReader, return_type[type[PartitionReader]], modifier[public static], parameter[settings, partition, log]] begin[{]
if[binary_operation[call[SettingsUtils.hasPinnedNode, parameter[member[.settings]]], &&, binary_operation[call[partition.getLocations, parameter[]], >, literal[0]]]] begin[{]
local_variable[type[String], pinAddress]
if[binary_operation[member[.pinAddress], !=, literal[null]]] begin[{]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[call[String.format, parameter[literal["Partition reader instance [%s] assigned to [%s]"], member[.partition], member[.pinAddress]]]]]
else begin[{]
None
end[}]
call[SettingsUtils.pinNode, parameter[member[.settings], member[.pinAddress]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[ClusterInfo], clusterInfo]
local_variable[type[ValueReader], reader]
local_variable[type[RestRepository], repository]
local_variable[type[Mapping], fieldMapping]
if[call[StringUtils.hasText, parameter[call[partition.getSerializedMapping, parameter[]]]]] begin[{]
assign[member[.fieldMapping], call[IOUtils.deserializeFromBase64, parameter[call[partition.getSerializedMapping, parameter[]]]]]
else begin[{]
call[log.warn, parameter[call[String.format, parameter[literal["No mapping found for [%s] - either no index exists or the partition configuration has been corrupted"], member[.partition]]]]]
end[}]
local_variable[type[ScrollReader], scrollReader]
if[call[settings.getNodesClientOnly, parameter[]]] begin[{]
local_variable[type[String], clientNode]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[call[String.format, parameter[literal["Client-node routing detected; partition reader instance [%s] assigned to [%s]"], member[.partition], member[.clientNode]]]]]
else begin[{]
None
end[}]
call[SettingsUtils.pinNode, parameter[member[.settings], member[.clientNode]]]
else begin[{]
None
end[}]
local_variable[type[boolean], includeVersion]
local_variable[type[Resource], read]
local_variable[type[SearchRequestBuilder], requestBuilder]
if[binary_operation[binary_operation[call[partition.getSlice, parameter[]], !=, literal[null]], &&, binary_operation[call[partition.getSlice, parameter[]], >, literal[1]]]] begin[{]
call[requestBuilder.slice, parameter[call[partition.getSlice, parameter[]], call[partition.getSlice, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[String], indices]
if[binary_operation[call[QueryUtils.isExplicitlyRequested, parameter[call[partition.getIndex, parameter[]], member[.indices]]], ==, literal[false]]] begin[{]
local_variable[type[IndicesAliases], indicesAliases]
local_variable[type[Map], aliases]
if[binary_operation[binary_operation[member[.aliases], !=, literal[null]], &&, binary_operation[call[aliases.size, parameter[]], >, literal[0]]]] begin[{]
assign[member[.requestBuilder], call[.applyAliasMetadata, parameter[call[clusterInfo.getMajorVersion, parameter[]], member[.aliases], member[.requestBuilder], call[partition.getIndex, parameter[]], member[.indices]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=scrollReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=repository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requestBuilder, 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=PartitionReader, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PartitionReader] identifier[createReader] operator[SEP] identifier[Settings] identifier[settings] , identifier[PartitionDefinition] identifier[partition] , identifier[Log] identifier[log] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[SettingsUtils] operator[SEP] identifier[hasPinnedNode] operator[SEP] identifier[settings] operator[SEP] operator[&&] identifier[partition] operator[SEP] identifier[getLocations] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[String] identifier[pinAddress] operator[=] identifier[checkLocality] operator[SEP] identifier[partition] operator[SEP] identifier[getLocations] operator[SEP] operator[SEP] , identifier[log] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pinAddress] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[partition] , identifier[pinAddress] operator[SEP] operator[SEP] operator[SEP]
}
identifier[SettingsUtils] operator[SEP] identifier[pinNode] operator[SEP] identifier[settings] , identifier[pinAddress] operator[SEP] operator[SEP]
}
}
identifier[ClusterInfo] identifier[clusterInfo] operator[=] identifier[InitializationUtils] operator[SEP] identifier[discoverClusterInfo] operator[SEP] identifier[settings] , identifier[log] operator[SEP] operator[SEP] identifier[ValueReader] identifier[reader] operator[=] identifier[ObjectUtils] operator[SEP] identifier[instantiate] operator[SEP] identifier[settings] operator[SEP] identifier[getSerializerValueReaderClassName] operator[SEP] operator[SEP] , identifier[settings] operator[SEP] operator[SEP] identifier[RestRepository] identifier[repository] operator[=] Keyword[new] identifier[RestRepository] operator[SEP] identifier[settings] operator[SEP] operator[SEP] identifier[Mapping] identifier[fieldMapping] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[partition] operator[SEP] identifier[getSerializedMapping] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[fieldMapping] operator[=] identifier[IOUtils] operator[SEP] identifier[deserializeFromBase64] operator[SEP] identifier[partition] operator[SEP] identifier[getSerializedMapping] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[partition] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ScrollReader] identifier[scrollReader] operator[=] Keyword[new] identifier[ScrollReader] operator[SEP] identifier[ScrollReaderConfigBuilder] operator[SEP] identifier[builder] operator[SEP] identifier[reader] , identifier[fieldMapping] , identifier[settings] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[settings] operator[SEP] identifier[getNodesClientOnly] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[clientNode] operator[=] identifier[repository] operator[SEP] identifier[getRestClient] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[partition] , identifier[clientNode] operator[SEP] operator[SEP] operator[SEP]
}
identifier[SettingsUtils] operator[SEP] identifier[pinNode] operator[SEP] identifier[settings] , identifier[clientNode] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[includeVersion] operator[=] identifier[settings] operator[SEP] identifier[getReadMetadata] operator[SEP] operator[SEP] operator[&&] identifier[settings] operator[SEP] identifier[getReadMetadataVersion] operator[SEP] operator[SEP] operator[SEP] identifier[Resource] identifier[read] operator[=] Keyword[new] identifier[Resource] operator[SEP] identifier[settings] , literal[boolean] operator[SEP] operator[SEP] identifier[SearchRequestBuilder] identifier[requestBuilder] operator[=] Keyword[new] identifier[SearchRequestBuilder] operator[SEP] identifier[clusterInfo] operator[SEP] identifier[getMajorVersion] operator[SEP] operator[SEP] , identifier[includeVersion] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[read] operator[SEP] operator[SEP] identifier[indices] operator[SEP] identifier[partition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[QueryUtils] operator[SEP] identifier[parseQuery] operator[SEP] identifier[settings] operator[SEP] operator[SEP] operator[SEP] identifier[scroll] operator[SEP] identifier[settings] operator[SEP] identifier[getScrollKeepAlive] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] identifier[settings] operator[SEP] identifier[getScrollSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[limit] operator[SEP] identifier[settings] operator[SEP] identifier[getScrollLimit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[SettingsUtils] operator[SEP] identifier[determineSourceFields] operator[SEP] identifier[settings] operator[SEP] operator[SEP] operator[SEP] identifier[filters] operator[SEP] identifier[QueryUtils] operator[SEP] identifier[parseFilters] operator[SEP] identifier[settings] operator[SEP] operator[SEP] operator[SEP] identifier[shard] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[partition] operator[SEP] identifier[getShardId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[readMetadata] operator[SEP] identifier[settings] operator[SEP] identifier[getReadMetadata] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[local] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[preference] operator[SEP] identifier[settings] operator[SEP] identifier[getShardPreference] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[excludeSource] operator[SEP] identifier[settings] operator[SEP] identifier[getExcludeSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[partition] operator[SEP] identifier[getSlice] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[partition] operator[SEP] identifier[getSlice] operator[SEP] operator[SEP] operator[SEP] identifier[max] operator[>] Other[1] operator[SEP] {
identifier[requestBuilder] operator[SEP] identifier[slice] operator[SEP] identifier[partition] operator[SEP] identifier[getSlice] operator[SEP] operator[SEP] operator[SEP] identifier[id] , identifier[partition] operator[SEP] identifier[getSlice] operator[SEP] operator[SEP] operator[SEP] identifier[max] operator[SEP] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[indices] operator[=] identifier[read] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[QueryUtils] operator[SEP] identifier[isExplicitlyRequested] operator[SEP] identifier[partition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] , identifier[indices] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[IndicesAliases] identifier[indicesAliases] operator[=] Keyword[new] identifier[GetAliasesRequestBuilder] operator[SEP] identifier[repository] operator[SEP] identifier[getRestClient] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[indices] operator[SEP] identifier[partition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] identifier[getIndices] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[IndicesAliases] operator[SEP] identifier[Alias] operator[>] identifier[aliases] operator[=] identifier[indicesAliases] operator[SEP] identifier[getAliases] operator[SEP] identifier[partition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aliases] operator[!=] Other[null] operator[&&] identifier[aliases] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[requestBuilder] operator[=] identifier[applyAliasMetadata] operator[SEP] identifier[clusterInfo] operator[SEP] identifier[getMajorVersion] operator[SEP] operator[SEP] , identifier[aliases] , identifier[requestBuilder] , identifier[partition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] , identifier[indices] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[PartitionReader] operator[SEP] identifier[scrollReader] , identifier[repository] , identifier[requestBuilder] operator[SEP] operator[SEP]
}
|
static List<String> stringsWithEq(String name, @Nullable List<String> values) {
List<String> result = new ArrayList<>();
if (values != null) {
for (String value : values) {
result.addAll(stringWithEq(name, value));
}
}
return result;
} | class class_name[name] begin[{]
method[stringsWithEq, return_type[type[List]], modifier[static], parameter[name, values]] begin[{]
local_variable[type[List], result]
if[binary_operation[member[.values], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stringWithEq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[stringsWithEq] operator[SEP] identifier[String] identifier[name] , annotation[@] identifier[Nullable] identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[value] operator[:] identifier[values] operator[SEP] {
identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[stringWithEq] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
private void updateDate(Date updateDate) {
if (updateDate != null && (timeStamp == null || updateDate.after(timeStamp))) {
this.timeStamp = updateDate;
}
} | class class_name[name] begin[{]
method[updateDate, return_type[void], modifier[private], parameter[updateDate]] begin[{]
if[binary_operation[binary_operation[member[.updateDate], !=, literal[null]], &&, binary_operation[binary_operation[member[.timeStamp], ==, literal[null]], ||, call[updateDate.after, parameter[member[.timeStamp]]]]]] begin[{]
assign[THIS[member[None.timeStamp]], member[.updateDate]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateDate] operator[SEP] identifier[Date] identifier[updateDate] operator[SEP] {
Keyword[if] operator[SEP] identifier[updateDate] operator[!=] Other[null] operator[&&] operator[SEP] identifier[timeStamp] operator[==] Other[null] operator[||] identifier[updateDate] operator[SEP] identifier[after] operator[SEP] identifier[timeStamp] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[timeStamp] operator[=] identifier[updateDate] operator[SEP]
}
}
|
public void write(Parameters parameters) throws IOException {
if (parameters != null) {
for (Parameter pv : parameters.getParameterValueMap().values()) {
if (pv.isAssigned()) {
write(pv);
}
}
}
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[parameters]] begin[{]
if[binary_operation[member[.parameters], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isAssigned, postfix_operators=[], prefix_operators=[], qualifier=pv, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getParameterValueMap, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Parameter, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[Parameters] identifier[parameters] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[parameters] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Parameter] identifier[pv] operator[:] identifier[parameters] operator[SEP] identifier[getParameterValueMap] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[pv] operator[SEP] identifier[isAssigned] operator[SEP] operator[SEP] operator[SEP] {
identifier[write] operator[SEP] identifier[pv] operator[SEP] operator[SEP]
}
}
}
}
|
public static ConfigParams mergeConfigs(ConfigParams... configs) {
StringValueMap map = StringValueMap.fromMaps(configs);
return new ConfigParams(map);
} | class class_name[name] begin[{]
method[mergeConfigs, return_type[type[ConfigParams]], modifier[public static], parameter[configs]] begin[{]
local_variable[type[StringValueMap], map]
return[ClassCreator(arguments=[MemberReference(member=map, 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=ConfigParams, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ConfigParams] identifier[mergeConfigs] operator[SEP] identifier[ConfigParams] operator[...] identifier[configs] operator[SEP] {
identifier[StringValueMap] identifier[map] operator[=] identifier[StringValueMap] operator[SEP] identifier[fromMaps] operator[SEP] identifier[configs] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ConfigParams] operator[SEP] identifier[map] operator[SEP] operator[SEP]
}
|
@Override
public void setInterpolator(/*Time*/Interpolator value) {
if (value != null) {
mInterpolator = value;
} else {
mInterpolator = new LinearInterpolator();
}
} | class class_name[name] begin[{]
method[setInterpolator, return_type[void], modifier[public], parameter[value]] begin[{]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
assign[member[.mInterpolator], member[.value]]
else begin[{]
assign[member[.mInterpolator], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LinearInterpolator, sub_type=None))]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setInterpolator] operator[SEP] identifier[Interpolator] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[mInterpolator] operator[=] identifier[value] operator[SEP]
}
Keyword[else] {
identifier[mInterpolator] operator[=] Keyword[new] identifier[LinearInterpolator] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public boolean hasPermission(AccessControlList acl, String[] permission, Identity user)
{
String userId = user.getUserId();
if (userId.equals(IdentityConstants.SYSTEM))
{
// SYSTEM has permission everywhere
return true;
}
else if (userId.equals(acl.getOwner()))
{
// Current user is owner of node so has all privileges
return true;
}
else if (userId.equals(IdentityConstants.ANONIM))
{
List<String> anyPermissions = acl.getPermissions(IdentityConstants.ANY);
if (anyPermissions.size() < permission.length)
return false;
for (int i = 0; i < permission.length; i++)
{
if (!anyPermissions.contains(permission[i]))
return false;
}
return true;
}
else
{
if (acl.getPermissionsSize() > 0 && permission.length > 0)
{
// check permission to perform all of the listed actions
for (int i = 0; i < permission.length; i++)
{
// check specific actions
if (!isPermissionMatch(acl.getPermissionsList(), permission[i], user))
return false;
}
return true;
}
return false;
}
} | class class_name[name] begin[{]
method[hasPermission, return_type[type[boolean]], modifier[public], parameter[acl, permission, user]] begin[{]
local_variable[type[String], userId]
if[call[userId.equals, parameter[member[IdentityConstants.SYSTEM]]]] begin[{]
return[literal[true]]
else begin[{]
if[call[userId.equals, parameter[call[acl.getOwner, parameter[]]]]] begin[{]
return[literal[true]]
else begin[{]
if[call[userId.equals, parameter[member[IdentityConstants.ANONIM]]]] begin[{]
local_variable[type[List], anyPermissions]
if[binary_operation[call[anyPermissions.size, parameter[]], <, member[permission.length]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=permission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=anyPermissions, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=permission, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
else begin[{]
if[binary_operation[binary_operation[call[acl.getPermissionsSize, parameter[]], >, literal[0]], &&, binary_operation[member[permission.length], >, literal[0]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPermissionsList, postfix_operators=[], prefix_operators=[], qualifier=acl, selectors=[], type_arguments=None), MemberReference(member=permission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPermissionMatch, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=permission, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[hasPermission] operator[SEP] identifier[AccessControlList] identifier[acl] , identifier[String] operator[SEP] operator[SEP] identifier[permission] , identifier[Identity] identifier[user] operator[SEP] {
identifier[String] identifier[userId] operator[=] identifier[user] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userId] operator[SEP] identifier[equals] operator[SEP] identifier[IdentityConstants] operator[SEP] identifier[SYSTEM] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[userId] operator[SEP] identifier[equals] operator[SEP] identifier[acl] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[userId] operator[SEP] identifier[equals] operator[SEP] identifier[IdentityConstants] operator[SEP] identifier[ANONIM] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[anyPermissions] operator[=] identifier[acl] operator[SEP] identifier[getPermissions] operator[SEP] identifier[IdentityConstants] operator[SEP] identifier[ANY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[anyPermissions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[permission] operator[SEP] identifier[length] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[permission] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[anyPermissions] operator[SEP] identifier[contains] operator[SEP] identifier[permission] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[acl] operator[SEP] identifier[getPermissionsSize] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[permission] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[permission] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isPermissionMatch] operator[SEP] identifier[acl] operator[SEP] identifier[getPermissionsList] operator[SEP] operator[SEP] , identifier[permission] operator[SEP] identifier[i] operator[SEP] , identifier[user] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
}
|
public void setOptNoAbbrev(boolean optNoAbbrev) {
if (optVerbose) {
if (optAbbrev && optNoAbbrev) {
throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000120")
+ " --no-abbrev cannot be used with --abbrev.");
}
this.optNoAbbrev = optNoAbbrev;
}
} | class class_name[name] begin[{]
method[setOptNoAbbrev, return_type[void], modifier[public], parameter[optNoAbbrev]] begin[{]
if[member[.optVerbose]] begin[{]
if[binary_operation[member[.optAbbrev], &&, member[.optNoAbbrev]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="000120")], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ExceptionMessageMap, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" --no-abbrev cannot be used with --abbrev."), 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[}]
assign[THIS[member[None.optNoAbbrev]], member[.optNoAbbrev]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setOptNoAbbrev] operator[SEP] Keyword[boolean] identifier[optNoAbbrev] operator[SEP] {
Keyword[if] operator[SEP] identifier[optVerbose] operator[SEP] {
Keyword[if] operator[SEP] identifier[optAbbrev] operator[&&] identifier[optNoAbbrev] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[ExceptionMessageMap] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[optNoAbbrev] operator[=] identifier[optNoAbbrev] operator[SEP]
}
}
|
@Override
public synchronized void reset() throws IOException {
if (this.markedPosition + this.markExpiry < this.currentAbsoluteReadPosition) {
throw new IOException(SR.MARK_EXPIRED);
}
this.validateFileMd5 = false;
this.md5Digest = null;
this.reposition(this.markedPosition);
} | class class_name[name] begin[{]
method[reset, return_type[void], modifier[synchronized public], parameter[]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.markedPosition]], +, THIS[member[None.markExpiry]]], <, THIS[member[None.currentAbsoluteReadPosition]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=MARK_EXPIRED, postfix_operators=[], prefix_operators=[], qualifier=SR, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.validateFileMd5]], literal[false]]
assign[THIS[member[None.md5Digest]], literal[null]]
THIS[call[None.reposition, parameter[THIS[member[None.markedPosition]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[reset] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[markedPosition] operator[+] Keyword[this] operator[SEP] identifier[markExpiry] operator[<] Keyword[this] operator[SEP] identifier[currentAbsoluteReadPosition] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[SR] operator[SEP] identifier[MARK_EXPIRED] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[validateFileMd5] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[md5Digest] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[reposition] operator[SEP] Keyword[this] operator[SEP] identifier[markedPosition] operator[SEP] operator[SEP]
}
|
static String setRegistrationId(Context context, String regId) {
final SharedPreferences prefs = getGCMPreferences(context);
String oldRegistrationId = prefs.getString(PROPERTY_REG_ID, "");
int appVersion = getAppVersion(context);
Log.v(TAG, "Saving regId on app version " + appVersion);
Editor editor = prefs.edit();
editor.putString(PROPERTY_REG_ID, regId);
editor.putInt(PROPERTY_APP_VERSION, appVersion);
editor.commit();
return oldRegistrationId;
} | class class_name[name] begin[{]
method[setRegistrationId, return_type[type[String]], modifier[static], parameter[context, regId]] begin[{]
local_variable[type[SharedPreferences], prefs]
local_variable[type[String], oldRegistrationId]
local_variable[type[int], appVersion]
call[Log.v, parameter[member[.TAG], binary_operation[literal["Saving regId on app version "], +, member[.appVersion]]]]
local_variable[type[Editor], editor]
call[editor.putString, parameter[member[.PROPERTY_REG_ID], member[.regId]]]
call[editor.putInt, parameter[member[.PROPERTY_APP_VERSION], member[.appVersion]]]
call[editor.commit, parameter[]]
return[member[.oldRegistrationId]]
end[}]
END[}] | Keyword[static] identifier[String] identifier[setRegistrationId] operator[SEP] identifier[Context] identifier[context] , identifier[String] identifier[regId] operator[SEP] {
Keyword[final] identifier[SharedPreferences] identifier[prefs] operator[=] identifier[getGCMPreferences] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[String] identifier[oldRegistrationId] operator[=] identifier[prefs] operator[SEP] identifier[getString] operator[SEP] identifier[PROPERTY_REG_ID] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[appVersion] operator[=] identifier[getAppVersion] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[appVersion] operator[SEP] operator[SEP] identifier[Editor] identifier[editor] operator[=] identifier[prefs] operator[SEP] identifier[edit] operator[SEP] operator[SEP] operator[SEP] identifier[editor] operator[SEP] identifier[putString] operator[SEP] identifier[PROPERTY_REG_ID] , identifier[regId] operator[SEP] operator[SEP] identifier[editor] operator[SEP] identifier[putInt] operator[SEP] identifier[PROPERTY_APP_VERSION] , identifier[appVersion] operator[SEP] operator[SEP] identifier[editor] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[oldRegistrationId] operator[SEP]
}
|
public boolean callTarget(Object appleEvent) throws InvocationTargetException, IllegalAccessException {
Object result = targetMethod.invoke(targetObject, (Object[])null);
if (result == null) {
return true;
}
return Boolean.valueOf(result.toString()).booleanValue();
} | class class_name[name] begin[{]
method[callTarget, return_type[type[boolean]], modifier[public], parameter[appleEvent]] begin[{]
local_variable[type[Object], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[call[Boolean.valueOf, parameter[call[result.toString, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[callTarget] operator[SEP] identifier[Object] identifier[appleEvent] operator[SEP] Keyword[throws] identifier[InvocationTargetException] , identifier[IllegalAccessException] {
identifier[Object] identifier[result] operator[=] identifier[targetMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[targetObject] , operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Money of(Number number, String currencyCode, MonetaryContext monetaryContext) {
return new Money(MoneyUtils.getBigDecimal(number), Monetary.getCurrency(currencyCode),
monetaryContext);
} | class class_name[name] begin[{]
method[of, return_type[type[Money]], modifier[public static], parameter[number, currencyCode, monetaryContext]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBigDecimal, postfix_operators=[], prefix_operators=[], qualifier=MoneyUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=currencyCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCurrency, postfix_operators=[], prefix_operators=[], qualifier=Monetary, selectors=[], type_arguments=None), MemberReference(member=monetaryContext, 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=Money, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Money] identifier[of] operator[SEP] identifier[Number] identifier[number] , identifier[String] identifier[currencyCode] , identifier[MonetaryContext] identifier[monetaryContext] operator[SEP] {
Keyword[return] Keyword[new] identifier[Money] operator[SEP] identifier[MoneyUtils] operator[SEP] identifier[getBigDecimal] operator[SEP] identifier[number] operator[SEP] , identifier[Monetary] operator[SEP] identifier[getCurrency] operator[SEP] identifier[currencyCode] operator[SEP] , identifier[monetaryContext] operator[SEP] operator[SEP]
}
|
public String getContext(int wordsLeft, int wordsRight){
final String text = home_cc.getText();
int temp;
// get the left start position
int posLeft = pos.getStart();
temp = posLeft-1;
while( posLeft != 0 && wordsLeft > 0 ){
while( temp > 0 && text.charAt( temp ) < 48 ) {
temp--;
}
while( temp > 0 && text.charAt( temp ) >= 48 ) {
temp--;
}
posLeft = ( temp>0 ? temp+1 : 0 );
wordsLeft--;
}
// get the right end position
int posRight = pos.getEnd();
temp = posRight;
while( posRight != text.length() && wordsRight > 0 ){
while( temp < text.length() && text.charAt( temp ) < 48 ) {
temp++;
}
while( temp < text.length() && text.charAt( temp ) >= 48 ) {
temp++;
}
posRight = temp;
wordsRight--;
}
// retrun a string...
return
text.substring(posLeft, pos.getStart() ) +
text.substring(pos.getEnd(), posRight);
} | class class_name[name] begin[{]
method[getContext, return_type[type[String]], modifier[public], parameter[wordsLeft, wordsRight]] begin[{]
local_variable[type[String], text]
local_variable[type[int], temp]
local_variable[type[int], posLeft]
assign[member[.temp], binary_operation[member[.posLeft], -, literal[1]]]
while[binary_operation[binary_operation[member[.posLeft], !=, literal[0]], &&, binary_operation[member[.wordsLeft], >, literal[0]]]] begin[{]
while[binary_operation[binary_operation[member[.temp], >, literal[0]], &&, binary_operation[call[text.charAt, parameter[member[.temp]]], <, literal[48]]]] begin[{]
member[.temp]
end[}]
while[binary_operation[binary_operation[member[.temp], >, literal[0]], &&, binary_operation[call[text.charAt, parameter[member[.temp]]], >=, literal[48]]]] begin[{]
member[.temp]
end[}]
assign[member[.posLeft], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=BinaryOperation(operandl=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]
member[.wordsLeft]
end[}]
local_variable[type[int], posRight]
assign[member[.temp], member[.posRight]]
while[binary_operation[binary_operation[member[.posRight], !=, call[text.length, parameter[]]], &&, binary_operation[member[.wordsRight], >, literal[0]]]] begin[{]
while[binary_operation[binary_operation[member[.temp], <, call[text.length, parameter[]]], &&, binary_operation[call[text.charAt, parameter[member[.temp]]], <, literal[48]]]] begin[{]
member[.temp]
end[}]
while[binary_operation[binary_operation[member[.temp], <, call[text.length, parameter[]]], &&, binary_operation[call[text.charAt, parameter[member[.temp]]], >=, literal[48]]]] begin[{]
member[.temp]
end[}]
assign[member[.posRight], member[.temp]]
member[.wordsRight]
end[}]
return[binary_operation[call[text.substring, parameter[member[.posLeft], call[pos.getStart, parameter[]]]], +, call[text.substring, parameter[call[pos.getEnd, parameter[]], member[.posRight]]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getContext] operator[SEP] Keyword[int] identifier[wordsLeft] , Keyword[int] identifier[wordsRight] operator[SEP] {
Keyword[final] identifier[String] identifier[text] operator[=] identifier[home_cc] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[temp] operator[SEP] Keyword[int] identifier[posLeft] operator[=] identifier[pos] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[temp] operator[=] identifier[posLeft] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[posLeft] operator[!=] Other[0] operator[&&] identifier[wordsLeft] operator[>] Other[0] operator[SEP] {
Keyword[while] operator[SEP] identifier[temp] operator[>] Other[0] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[temp] operator[SEP] operator[<] Other[48] operator[SEP] {
identifier[temp] operator[--] operator[SEP]
}
Keyword[while] operator[SEP] identifier[temp] operator[>] Other[0] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[temp] operator[SEP] operator[>=] Other[48] operator[SEP] {
identifier[temp] operator[--] operator[SEP]
}
identifier[posLeft] operator[=] operator[SEP] identifier[temp] operator[>] Other[0] operator[?] identifier[temp] operator[+] Other[1] operator[:] Other[0] operator[SEP] operator[SEP] identifier[wordsLeft] operator[--] operator[SEP]
}
Keyword[int] identifier[posRight] operator[=] identifier[pos] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[temp] operator[=] identifier[posRight] operator[SEP] Keyword[while] operator[SEP] identifier[posRight] operator[!=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[wordsRight] operator[>] Other[0] operator[SEP] {
Keyword[while] operator[SEP] identifier[temp] operator[<] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[temp] operator[SEP] operator[<] Other[48] operator[SEP] {
identifier[temp] operator[++] operator[SEP]
}
Keyword[while] operator[SEP] identifier[temp] operator[<] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[temp] operator[SEP] operator[>=] Other[48] operator[SEP] {
identifier[temp] operator[++] operator[SEP]
}
identifier[posRight] operator[=] identifier[temp] operator[SEP] identifier[wordsRight] operator[--] operator[SEP]
}
Keyword[return] identifier[text] operator[SEP] identifier[substring] operator[SEP] identifier[posLeft] , identifier[pos] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[text] operator[SEP] identifier[substring] operator[SEP] identifier[pos] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] , identifier[posRight] operator[SEP] operator[SEP]
}
|
public static RuntimeDelegate getInstance() {
RuntimeDelegate result = RuntimeDelegate.CACHED_DELEGATE.get();
if (result != null) {
return result;
}
synchronized(RuntimeDelegate.CACHED_DELEGATE) {
result=RuntimeDelegate.CACHED_DELEGATE.get();
if(result==null) {
RuntimeDelegate.CACHED_DELEGATE.set(findDelegate());
result=RuntimeDelegate.CACHED_DELEGATE.get();
}
return result;
}
} | class class_name[name] begin[{]
method[getInstance, return_type[type[RuntimeDelegate]], modifier[public static], parameter[]] begin[{]
local_variable[type[RuntimeDelegate], result]
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
return[member[.result]]
else begin[{]
None
end[}]
SYNCHRONIZED[member[RuntimeDelegate.CACHED_DELEGATE]] BEGIN[{]
assign[member[.result], call[RuntimeDelegate.CACHED_DELEGATE.get, parameter[]]]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
call[RuntimeDelegate.CACHED_DELEGATE.set, parameter[call[.findDelegate, parameter[]]]]
assign[member[.result], call[RuntimeDelegate.CACHED_DELEGATE.get, parameter[]]]
else begin[{]
None
end[}]
return[member[.result]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[RuntimeDelegate] identifier[getInstance] operator[SEP] operator[SEP] {
identifier[RuntimeDelegate] identifier[result] operator[=] identifier[RuntimeDelegate] operator[SEP] identifier[CACHED_DELEGATE] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[result] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[RuntimeDelegate] operator[SEP] identifier[CACHED_DELEGATE] operator[SEP] {
identifier[result] operator[=] identifier[RuntimeDelegate] operator[SEP] identifier[CACHED_DELEGATE] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
identifier[RuntimeDelegate] operator[SEP] identifier[CACHED_DELEGATE] operator[SEP] identifier[set] operator[SEP] identifier[findDelegate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[RuntimeDelegate] operator[SEP] identifier[CACHED_DELEGATE] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
}
|
public static Mail buildDynamicTemplate() throws IOException {
Mail mail = new Mail();
Email fromEmail = new Email();
fromEmail.setName("Example User");
fromEmail.setEmail("test@example.com");
mail.setFrom(fromEmail);
mail.setTemplateId("d-c6dcf1f72bdd4beeb15a9aa6c72fcd2c");
Personalization personalization = new Personalization();
personalization.addDynamicTemplateData("name", "Example User");
personalization.addDynamicTemplateData("city", "Denver");
personalization.addTo(new Email("test@example.com"));
mail.addPersonalization(personalization);
return mail;
} | class class_name[name] begin[{]
method[buildDynamicTemplate, return_type[type[Mail]], modifier[public static], parameter[]] begin[{]
local_variable[type[Mail], mail]
local_variable[type[Email], fromEmail]
call[fromEmail.setName, parameter[literal["Example User"]]]
call[fromEmail.setEmail, parameter[literal["test@example.com"]]]
call[mail.setFrom, parameter[member[.fromEmail]]]
call[mail.setTemplateId, parameter[literal["d-c6dcf1f72bdd4beeb15a9aa6c72fcd2c"]]]
local_variable[type[Personalization], personalization]
call[personalization.addDynamicTemplateData, parameter[literal["name"], literal["Example User"]]]
call[personalization.addDynamicTemplateData, parameter[literal["city"], literal["Denver"]]]
call[personalization.addTo, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="test@example.com")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Email, sub_type=None))]]
call[mail.addPersonalization, parameter[member[.personalization]]]
return[member[.mail]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Mail] identifier[buildDynamicTemplate] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Mail] identifier[mail] operator[=] Keyword[new] identifier[Mail] operator[SEP] operator[SEP] operator[SEP] identifier[Email] identifier[fromEmail] operator[=] Keyword[new] identifier[Email] operator[SEP] operator[SEP] operator[SEP] identifier[fromEmail] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fromEmail] operator[SEP] identifier[setEmail] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mail] operator[SEP] identifier[setFrom] operator[SEP] identifier[fromEmail] operator[SEP] operator[SEP] identifier[mail] operator[SEP] identifier[setTemplateId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Personalization] identifier[personalization] operator[=] Keyword[new] identifier[Personalization] operator[SEP] operator[SEP] operator[SEP] identifier[personalization] operator[SEP] identifier[addDynamicTemplateData] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[personalization] operator[SEP] identifier[addDynamicTemplateData] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[personalization] operator[SEP] identifier[addTo] operator[SEP] Keyword[new] identifier[Email] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[mail] operator[SEP] identifier[addPersonalization] operator[SEP] identifier[personalization] operator[SEP] operator[SEP] Keyword[return] identifier[mail] operator[SEP]
}
|
private void writeSimple(String currentIndent, String tagName, StringBuilder attrs, Class<?> declaredType, Object value) throws IOException {
Class<?> effectiveType;
if (declaredType == Object.class) {
Class<?> realType = value.getClass();
if (realType != String.class) {
effectiveType = settings.getConverter().findTypedConverter(realType).getEffectiveType();
String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
appendAttribute(attrs, TYPE, typeStr);
} else {
effectiveType = realType;
}
} else if (settings.getConverter().isConvertible(declaredType) == false) {
effectiveType = settings.getConverter().findTypedConverter(value.getClass()).getEffectiveType();
String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
appendAttribute(attrs, TYPE, typeStr);
} else {
effectiveType = declaredType;
}
try {
String converted = settings.getConverter().convertToString(effectiveType, value);
if (converted == null) {
throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
}
output.append(currentIndent).append('<').append(tagName).append(attrs).append('>');
appendEncoded(converted);
output.append('<').append('/').append(tagName).append('>').append(settings.getNewLine());
} catch (RuntimeException ex) {
throw new IllegalArgumentException("Unable to convert type " + effectiveType.getName() + " declared as " + declaredType.getName(), ex);
}
} | class class_name[name] begin[{]
method[writeSimple, return_type[void], modifier[private], parameter[currentIndent, tagName, attrs, declaredType, value]] begin[{]
local_variable[type[Class], effectiveType]
if[binary_operation[member[.declaredType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] begin[{]
local_variable[type[Class], realType]
if[binary_operation[member[.realType], !=, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] begin[{]
assign[member[.effectiveType], call[settings.getConverter, parameter[]]]
local_variable[type[String], typeStr]
call[.appendAttribute, parameter[member[.attrs], member[.TYPE], member[.typeStr]]]
else begin[{]
assign[member[.effectiveType], member[.realType]]
end[}]
else begin[{]
if[binary_operation[call[settings.getConverter, parameter[]], ==, literal[false]]] begin[{]
assign[member[.effectiveType], call[settings.getConverter, parameter[]]]
local_variable[type[String], typeStr]
call[.appendAttribute, parameter[member[.attrs], member[.TYPE], member[.typeStr]]]
else begin[{]
assign[member[.effectiveType], member[.declaredType]]
end[}]
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConverter, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[MethodInvocation(arguments=[MemberReference(member=effectiveType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertToString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=converted)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=converted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to write because converter returned a null string: "), operandr=MemberReference(member=value, 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)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentIndent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='<')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=attrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=converted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendEncoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='<')], member=append, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNewLine, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[], type_arguments=None)], member=append, 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=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to convert type "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=effectiveType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" declared as "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=declaredType, selectors=[], type_arguments=None), operator=+), 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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['RuntimeException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[writeSimple] operator[SEP] identifier[String] identifier[currentIndent] , identifier[String] identifier[tagName] , identifier[StringBuilder] identifier[attrs] , identifier[Class] operator[<] operator[?] operator[>] identifier[declaredType] , identifier[Object] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Class] operator[<] operator[?] operator[>] identifier[effectiveType] operator[SEP] Keyword[if] operator[SEP] identifier[declaredType] operator[==] identifier[Object] operator[SEP] Keyword[class] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[realType] operator[=] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[realType] operator[!=] identifier[String] operator[SEP] Keyword[class] operator[SEP] {
identifier[effectiveType] operator[=] identifier[settings] operator[SEP] identifier[getConverter] operator[SEP] operator[SEP] operator[SEP] identifier[findTypedConverter] operator[SEP] identifier[realType] operator[SEP] operator[SEP] identifier[getEffectiveType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[typeStr] operator[=] identifier[SerTypeMapper] operator[SEP] identifier[encodeType] operator[SEP] identifier[effectiveType] , identifier[settings] , identifier[basePackage] , identifier[knownTypes] operator[SEP] operator[SEP] identifier[appendAttribute] operator[SEP] identifier[attrs] , identifier[TYPE] , identifier[typeStr] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[effectiveType] operator[=] identifier[realType] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[settings] operator[SEP] identifier[getConverter] operator[SEP] operator[SEP] operator[SEP] identifier[isConvertible] operator[SEP] identifier[declaredType] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[effectiveType] operator[=] identifier[settings] operator[SEP] identifier[getConverter] operator[SEP] operator[SEP] operator[SEP] identifier[findTypedConverter] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getEffectiveType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[typeStr] operator[=] identifier[SerTypeMapper] operator[SEP] identifier[encodeType] operator[SEP] identifier[effectiveType] , identifier[settings] , identifier[basePackage] , identifier[knownTypes] operator[SEP] operator[SEP] identifier[appendAttribute] operator[SEP] identifier[attrs] , identifier[TYPE] , identifier[typeStr] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[effectiveType] operator[=] identifier[declaredType] operator[SEP]
}
Keyword[try] {
identifier[String] identifier[converted] operator[=] identifier[settings] operator[SEP] identifier[getConverter] operator[SEP] operator[SEP] operator[SEP] identifier[convertToString] operator[SEP] identifier[effectiveType] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[converted] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP]
}
identifier[output] operator[SEP] identifier[append] operator[SEP] identifier[currentIndent] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[attrs] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[appendEncoded] operator[SEP] identifier[converted] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[settings] operator[SEP] identifier[getNewLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[effectiveType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[declaredType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP]
}
}
|
protected void snapshotSessionDb(String currentFile, String destFile) throws Exception {
logger.debug("snapshotSessionDb " + currentFile + " -> " + destFile);
// ZAP: Changed to call the method close(boolean, boolean).
getDb().close(false, false);
// copy session related files to the path specified
FileCopier copier = new FileCopier();
// ZAP: Check if files exist.
File fileIn1 = new File(currentFile + ".data");
if (fileIn1.exists()) {
File fileOut1 = new File(destFile + ".data");
copier.copy(fileIn1, fileOut1);
}
File fileIn2 = new File(currentFile + ".script");
if (fileIn2.exists()) {
File fileOut2 = new File(destFile + ".script");
copier.copy(fileIn2, fileOut2);
}
File fileIn3 = new File(currentFile + ".properties");
if (fileIn3.exists()) {
File fileOut3 = new File(destFile + ".properties");
copier.copy(fileIn3, fileOut3);
}
File fileIn4 = new File(currentFile + ".backup");
if (fileIn4.exists()) {
File fileOut4 = new File(destFile + ".backup");
copier.copy(fileIn4, fileOut4);
}
// ZAP: Handle the "lobs" file.
File lobsFile = new File(currentFile + ".lobs");
if (lobsFile.exists()) {
File newLobsFile = new File(destFile + ".lobs");
copier.copy(lobsFile, newLobsFile);
}
if (currentFile.length() == 0) {
logger.debug("snapshotSessionDb using " + currentDBNameUntitled + " -> " + destFile);
currentFile = currentDBNameUntitled;
}
getDb().open(currentFile);
} | class class_name[name] begin[{]
method[snapshotSessionDb, return_type[void], modifier[protected], parameter[currentFile, destFile]] begin[{]
call[logger.debug, parameter[binary_operation[binary_operation[binary_operation[literal["snapshotSessionDb "], +, member[.currentFile]], +, literal[" -> "]], +, member[.destFile]]]]
call[.getDb, parameter[]]
local_variable[type[FileCopier], copier]
local_variable[type[File], fileIn1]
if[call[fileIn1.exists, parameter[]]] begin[{]
local_variable[type[File], fileOut1]
call[copier.copy, parameter[member[.fileIn1], member[.fileOut1]]]
else begin[{]
None
end[}]
local_variable[type[File], fileIn2]
if[call[fileIn2.exists, parameter[]]] begin[{]
local_variable[type[File], fileOut2]
call[copier.copy, parameter[member[.fileIn2], member[.fileOut2]]]
else begin[{]
None
end[}]
local_variable[type[File], fileIn3]
if[call[fileIn3.exists, parameter[]]] begin[{]
local_variable[type[File], fileOut3]
call[copier.copy, parameter[member[.fileIn3], member[.fileOut3]]]
else begin[{]
None
end[}]
local_variable[type[File], fileIn4]
if[call[fileIn4.exists, parameter[]]] begin[{]
local_variable[type[File], fileOut4]
call[copier.copy, parameter[member[.fileIn4], member[.fileOut4]]]
else begin[{]
None
end[}]
local_variable[type[File], lobsFile]
if[call[lobsFile.exists, parameter[]]] begin[{]
local_variable[type[File], newLobsFile]
call[copier.copy, parameter[member[.lobsFile], member[.newLobsFile]]]
else begin[{]
None
end[}]
if[binary_operation[call[currentFile.length, parameter[]], ==, literal[0]]] begin[{]
call[logger.debug, parameter[binary_operation[binary_operation[binary_operation[literal["snapshotSessionDb using "], +, member[.currentDBNameUntitled]], +, literal[" -> "]], +, member[.destFile]]]]
assign[member[.currentFile], member[.currentDBNameUntitled]]
else begin[{]
None
end[}]
call[.getDb, parameter[]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[snapshotSessionDb] operator[SEP] identifier[String] identifier[currentFile] , identifier[String] identifier[destFile] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[currentFile] operator[+] literal[String] operator[+] identifier[destFile] operator[SEP] operator[SEP] identifier[getDb] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[FileCopier] identifier[copier] operator[=] Keyword[new] identifier[FileCopier] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[fileIn1] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[currentFile] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileIn1] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[File] identifier[fileOut1] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP] identifier[copier] operator[SEP] identifier[copy] operator[SEP] identifier[fileIn1] , identifier[fileOut1] operator[SEP] operator[SEP]
}
identifier[File] identifier[fileIn2] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[currentFile] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileIn2] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[File] identifier[fileOut2] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP] identifier[copier] operator[SEP] identifier[copy] operator[SEP] identifier[fileIn2] , identifier[fileOut2] operator[SEP] operator[SEP]
}
identifier[File] identifier[fileIn3] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[currentFile] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileIn3] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[File] identifier[fileOut3] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP] identifier[copier] operator[SEP] identifier[copy] operator[SEP] identifier[fileIn3] , identifier[fileOut3] operator[SEP] operator[SEP]
}
identifier[File] identifier[fileIn4] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[currentFile] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileIn4] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[File] identifier[fileOut4] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP] identifier[copier] operator[SEP] identifier[copy] operator[SEP] identifier[fileIn4] , identifier[fileOut4] operator[SEP] operator[SEP]
}
identifier[File] identifier[lobsFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[currentFile] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lobsFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[File] identifier[newLobsFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[destFile] operator[+] literal[String] operator[SEP] operator[SEP] identifier[copier] operator[SEP] identifier[copy] operator[SEP] identifier[lobsFile] , identifier[newLobsFile] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[currentFile] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[currentDBNameUntitled] operator[+] literal[String] operator[+] identifier[destFile] operator[SEP] operator[SEP] identifier[currentFile] operator[=] identifier[currentDBNameUntitled] operator[SEP]
}
identifier[getDb] operator[SEP] operator[SEP] operator[SEP] identifier[open] operator[SEP] identifier[currentFile] operator[SEP] operator[SEP]
}
|
public static void write(HttpServletResponse response, InputStream in, String contentType, String fileName) {
final String charset = ObjectUtil.defaultIfNull(response.getCharacterEncoding(), CharsetUtil.UTF_8);
response.setHeader("Content-Disposition", StrUtil.format("attachment;filename={}", URLUtil.encode(fileName, charset)));
response.setContentType(contentType);
write(response, in);
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public static], parameter[response, in, contentType, fileName]] begin[{]
local_variable[type[String], charset]
call[response.setHeader, parameter[literal["Content-Disposition"], call[StrUtil.format, parameter[literal["attachment;filename={}"], call[URLUtil.encode, parameter[member[.fileName], member[.charset]]]]]]]
call[response.setContentType, parameter[member[.contentType]]]
call[.write, parameter[member[.response], member[.in]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[write] operator[SEP] identifier[HttpServletResponse] identifier[response] , identifier[InputStream] identifier[in] , identifier[String] identifier[contentType] , identifier[String] identifier[fileName] operator[SEP] {
Keyword[final] identifier[String] identifier[charset] operator[=] identifier[ObjectUtil] operator[SEP] identifier[defaultIfNull] operator[SEP] identifier[response] operator[SEP] identifier[getCharacterEncoding] operator[SEP] operator[SEP] , identifier[CharsetUtil] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , identifier[StrUtil] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[URLUtil] operator[SEP] identifier[encode] operator[SEP] identifier[fileName] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setContentType] operator[SEP] identifier[contentType] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[response] , identifier[in] operator[SEP] operator[SEP]
}
|
private static @Nullable Throwable tryClose(Object o, @Nullable Throwable outer) {
if (o instanceof Closeable) {
try {
((Closeable) o).close();
} catch (Throwable t) {
if (outer == null) {
return t;
}
outer.addSuppressed(t);
return outer;
}
}
return null;
} | class class_name[name] begin[{]
method[tryClose, return_type[type[Throwable]], modifier[private static], parameter[o, outer]] begin[{]
if[binary_operation[member[.o], instanceof, type[Closeable]]] begin[{]
TryStatement(block=[StatementExpression(expression=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Closeable, sub_type=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=outer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSuppressed, postfix_operators=[], prefix_operators=[], qualifier=outer, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=outer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] Keyword[static] annotation[@] identifier[Nullable] identifier[Throwable] identifier[tryClose] operator[SEP] identifier[Object] identifier[o] , annotation[@] identifier[Nullable] identifier[Throwable] identifier[outer] operator[SEP] {
Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Closeable] operator[SEP] {
Keyword[try] {
operator[SEP] operator[SEP] identifier[Closeable] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[if] operator[SEP] identifier[outer] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[t] operator[SEP]
}
identifier[outer] operator[SEP] identifier[addSuppressed] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[return] identifier[outer] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public Observable<ServiceResponse<ResourceHealthMetadataInner>> getBySiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (name == null) {
throw new IllegalArgumentException("Parameter name is required and cannot be null.");
}
if (slot == null) {
throw new IllegalArgumentException("Parameter slot is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.getBySiteSlot(resourceGroupName, name, slot, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceHealthMetadataInner>>>() {
@Override
public Observable<ServiceResponse<ResourceHealthMetadataInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceHealthMetadataInner> clientResponse = getBySiteSlotDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} | class class_name[name] begin[{]
method[getBySiteSlotWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, name, slot]] begin[{]
if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter name is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.slot], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter slot is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[service.getBySiteSlot, parameter[member[.resourceGroupName], member[.name], member[.slot], THIS[member[None.client]call[None.subscriptionId, parameter[]]], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ResourceHealthMetadataInner] operator[>] operator[>] identifier[getBySiteSlotWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[name] , identifier[String] identifier[slot] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[slot] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[service] operator[SEP] identifier[getBySiteSlot] operator[SEP] identifier[resourceGroupName] , identifier[name] , identifier[slot] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ResourceHealthMetadataInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ResourceHealthMetadataInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] {
Keyword[try] {
identifier[ServiceResponse] operator[<] identifier[ResourceHealthMetadataInner] operator[>] identifier[clientResponse] operator[=] identifier[getBySiteSlotDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
@Override
public void sawOpcode(int seen) {
if ((seen == Const.INVOKEINTERFACE) || (seen == Const.INVOKEVIRTUAL) || (seen == Const.INVOKESPECIAL) || (seen == Const.INVOKESTATIC)) {
String clsName = getClassConstantOperand();
String mName = getNameConstantOperand();
String methodInfo = clsName + ':' + mName;
String thisMethodInfo = (clsName.equals(getClassName())) ? (mName + ':' + methodSig) : "0";
if (expensiveCalls.contains(methodInfo) || expensiveThisCalls.contains(thisMethodInfo)) {
if (isListenerMethod) {
bugReporter.reportBug(new BugInstance(this, BugType.SG_SLUGGISH_GUI.name(), NORMAL_PRIORITY).addClass(this)
.addMethod(this.getClassContext().getJavaClass(), listenerCode.get(this.getCode())));
} else {
expensiveThisCalls.add(getMethodName() + ':' + getMethodSig());
}
throw new StopOpcodeParsingException();
}
}
} | class class_name[name] begin[{]
method[sawOpcode, return_type[void], modifier[public], parameter[seen]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.seen], ==, member[Const.INVOKEINTERFACE]], ||, binary_operation[member[.seen], ==, member[Const.INVOKEVIRTUAL]]], ||, binary_operation[member[.seen], ==, member[Const.INVOKESPECIAL]]], ||, binary_operation[member[.seen], ==, member[Const.INVOKESTATIC]]]] begin[{]
local_variable[type[String], clsName]
local_variable[type[String], mName]
local_variable[type[String], methodInfo]
local_variable[type[String], thisMethodInfo]
if[binary_operation[call[expensiveCalls.contains, parameter[member[.methodInfo]]], ||, call[expensiveThisCalls.contains, parameter[member[.thisMethodInfo]]]]] begin[{]
if[member[.isListenerMethod]] begin[{]
call[bugReporter.reportBug, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=BugType.SG_SLUGGISH_GUI, selectors=[], type_arguments=None), MemberReference(member=NORMAL_PRIORITY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClassContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getJavaClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=get, postfix_operators=[], prefix_operators=[], qualifier=listenerCode, selectors=[], type_arguments=None)], member=addMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BugInstance, sub_type=None))]]
else begin[{]
call[expensiveThisCalls.add, parameter[binary_operation[binary_operation[call[.getMethodName, parameter[]], +, literal[':']], +, call[.getMethodSig, parameter[]]]]]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StopOpcodeParsingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[sawOpcode] operator[SEP] Keyword[int] identifier[seen] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[seen] operator[==] identifier[Const] operator[SEP] identifier[INVOKEINTERFACE] operator[SEP] operator[||] operator[SEP] identifier[seen] operator[==] identifier[Const] operator[SEP] identifier[INVOKEVIRTUAL] operator[SEP] operator[||] operator[SEP] identifier[seen] operator[==] identifier[Const] operator[SEP] identifier[INVOKESPECIAL] operator[SEP] operator[||] operator[SEP] identifier[seen] operator[==] identifier[Const] operator[SEP] identifier[INVOKESTATIC] operator[SEP] operator[SEP] {
identifier[String] identifier[clsName] operator[=] identifier[getClassConstantOperand] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[mName] operator[=] identifier[getNameConstantOperand] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[methodInfo] operator[=] identifier[clsName] operator[+] literal[String] operator[+] identifier[mName] operator[SEP] identifier[String] identifier[thisMethodInfo] operator[=] operator[SEP] identifier[clsName] operator[SEP] identifier[equals] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[?] operator[SEP] identifier[mName] operator[+] literal[String] operator[+] identifier[methodSig] operator[SEP] operator[:] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[expensiveCalls] operator[SEP] identifier[contains] operator[SEP] identifier[methodInfo] operator[SEP] operator[||] identifier[expensiveThisCalls] operator[SEP] identifier[contains] operator[SEP] identifier[thisMethodInfo] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isListenerMethod] operator[SEP] {
identifier[bugReporter] operator[SEP] identifier[reportBug] operator[SEP] Keyword[new] identifier[BugInstance] operator[SEP] Keyword[this] , identifier[BugType] operator[SEP] identifier[SG_SLUGGISH_GUI] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[NORMAL_PRIORITY] operator[SEP] operator[SEP] identifier[addClass] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[addMethod] operator[SEP] Keyword[this] operator[SEP] identifier[getClassContext] operator[SEP] operator[SEP] operator[SEP] identifier[getJavaClass] operator[SEP] operator[SEP] , identifier[listenerCode] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[expensiveThisCalls] operator[SEP] identifier[add] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getMethodSig] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[StopOpcodeParsingException] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
private void updateToolTipDialogVisibility() {
// Determine whether tooltip should be/remain visible
boolean shouldBeVisible = isOverDecorationPainter() || isOverToolTipDialog();
// Create tooltip dialog if needed
if (shouldBeVisible) {
createToolTipDialogIfNeeded();
}
// Update tooltip dialog visibility if changed
if ((toolTipDialog != null) && (toolTipDialog.isVisible() != shouldBeVisible)) {
toolTipDialog.setVisible(shouldBeVisible);
}
} | class class_name[name] begin[{]
method[updateToolTipDialogVisibility, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[boolean], shouldBeVisible]
if[member[.shouldBeVisible]] begin[{]
call[.createToolTipDialogIfNeeded, parameter[]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.toolTipDialog], !=, literal[null]], &&, binary_operation[call[toolTipDialog.isVisible, parameter[]], !=, member[.shouldBeVisible]]]] begin[{]
call[toolTipDialog.setVisible, parameter[member[.shouldBeVisible]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateToolTipDialogVisibility] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[shouldBeVisible] operator[=] identifier[isOverDecorationPainter] operator[SEP] operator[SEP] operator[||] identifier[isOverToolTipDialog] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shouldBeVisible] operator[SEP] {
identifier[createToolTipDialogIfNeeded] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[toolTipDialog] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[toolTipDialog] operator[SEP] identifier[isVisible] operator[SEP] operator[SEP] operator[!=] identifier[shouldBeVisible] operator[SEP] operator[SEP] {
identifier[toolTipDialog] operator[SEP] identifier[setVisible] operator[SEP] identifier[shouldBeVisible] operator[SEP] operator[SEP]
}
}
|
public Dimension renameDimension(Group g, String oldName, String newName) {
if (!defineMode) throw new UnsupportedOperationException("not in define mode");
if (!isValidObjectName(newName)) throw new IllegalArgumentException("illegal dimension name " + newName);
if (g == null) g = ncfile.getRootGroup();
Dimension dim = g.findDimension(oldName);
if (null != dim) dim.setName(newName);
return dim;
} | class class_name[name] begin[{]
method[renameDimension, return_type[type[Dimension]], modifier[public], parameter[g, oldName, newName]] 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[call[.isValidObjectName, parameter[member[.newName]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="illegal dimension name "), operandr=MemberReference(member=newName, 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[}]
if[binary_operation[member[.g], ==, literal[null]]] begin[{]
assign[member[.g], call[ncfile.getRootGroup, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[Dimension], dim]
if[binary_operation[literal[null], !=, member[.dim]]] begin[{]
call[dim.setName, parameter[member[.newName]]]
else begin[{]
None
end[}]
return[member[.dim]]
end[}]
END[}] | Keyword[public] identifier[Dimension] identifier[renameDimension] operator[SEP] identifier[Group] identifier[g] , identifier[String] identifier[oldName] , identifier[String] identifier[newName] 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] operator[!] identifier[isValidObjectName] operator[SEP] identifier[newName] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[newName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[g] operator[==] Other[null] operator[SEP] identifier[g] operator[=] identifier[ncfile] operator[SEP] identifier[getRootGroup] operator[SEP] operator[SEP] operator[SEP] identifier[Dimension] identifier[dim] operator[=] identifier[g] operator[SEP] identifier[findDimension] operator[SEP] identifier[oldName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[dim] operator[SEP] identifier[dim] operator[SEP] identifier[setName] operator[SEP] identifier[newName] operator[SEP] operator[SEP] Keyword[return] identifier[dim] operator[SEP]
}
|
public static <O> O deserialise(InputStream input,
Class<O> requestMessageType) throws IOException {
Gson gson = getBuilder().create();
try (InputStreamReader streamReader = new InputStreamReader(input, StandardCharsets.UTF_8)) {
return gson.fromJson(streamReader, requestMessageType);
}
} | class class_name[name] begin[{]
method[deserialise, return_type[type[O]], modifier[public static], parameter[input, requestMessageType]] begin[{]
local_variable[type[Gson], gson]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=streamReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requestMessageType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromJson, postfix_operators=[], prefix_operators=[], qualifier=gson, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=streamReader, type=ReferenceType(arguments=None, dimensions=[], name=InputStreamReader, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None)))])
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[O] operator[>] identifier[O] identifier[deserialise] operator[SEP] identifier[InputStream] identifier[input] , identifier[Class] operator[<] identifier[O] operator[>] identifier[requestMessageType] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Gson] identifier[gson] operator[=] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[InputStreamReader] identifier[streamReader] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[input] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] {
Keyword[return] identifier[gson] operator[SEP] identifier[fromJson] operator[SEP] identifier[streamReader] , identifier[requestMessageType] operator[SEP] operator[SEP]
}
}
|
private static synchronized void trackAllocatedHashinatorBytes(long bytes) {
final long allocated = m_allocatedHashinatorBytes.addAndGet(bytes);
if (allocated > HASHINATOR_GC_THRESHHOLD) {
hostLogger.warn(allocated + " bytes of hashinator data has been allocated");
if (m_emergencyGCThread == null || m_emergencyGCThread.getState() == State.TERMINATED) {
m_emergencyGCThread = new Thread(new Runnable() {
@Override
public void run() {
hostLogger.warn("Invoking System.gc() to recoup hashinator bytes");
System.gc();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {}
hostLogger.info(m_allocatedHashinatorBytes.get() + " bytes of hashinator allocated after GC");
}
}, "Hashinator GC thread");
m_emergencyGCThread.start();
}
}
} | class class_name[name] begin[{]
method[trackAllocatedHashinatorBytes, return_type[void], modifier[synchronized private static], parameter[bytes]] begin[{]
local_variable[type[long], allocated]
if[binary_operation[member[.allocated], >, member[.HASHINATOR_GC_THRESHHOLD]]] begin[{]
call[hostLogger.warn, parameter[binary_operation[member[.allocated], +, literal[" bytes of hashinator data has been allocated"]]]]
if[binary_operation[binary_operation[member[.m_emergencyGCThread], ==, literal[null]], ||, binary_operation[call[m_emergencyGCThread.getState, parameter[]], ==, member[State.TERMINATED]]]] begin[{]
assign[member[.m_emergencyGCThread], ClassCreator(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invoking System.gc() to recoup hashinator bytes")], member=warn, postfix_operators=[], prefix_operators=[], qualifier=hostLogger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=gc, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2000)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=m_allocatedHashinatorBytes, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" bytes of hashinator allocated after GC"), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=hostLogger, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Hashinator GC thread")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Thread, sub_type=None))]
call[m_emergencyGCThread.start, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[synchronized] Keyword[void] identifier[trackAllocatedHashinatorBytes] operator[SEP] Keyword[long] identifier[bytes] operator[SEP] {
Keyword[final] Keyword[long] identifier[allocated] operator[=] identifier[m_allocatedHashinatorBytes] operator[SEP] identifier[addAndGet] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[allocated] operator[>] identifier[HASHINATOR_GC_THRESHHOLD] operator[SEP] {
identifier[hostLogger] operator[SEP] identifier[warn] operator[SEP] identifier[allocated] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_emergencyGCThread] operator[==] Other[null] operator[||] identifier[m_emergencyGCThread] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[==] identifier[State] operator[SEP] identifier[TERMINATED] operator[SEP] {
identifier[m_emergencyGCThread] operator[=] Keyword[new] identifier[Thread] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[hostLogger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[gc] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[2000] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
}
identifier[hostLogger] operator[SEP] identifier[info] operator[SEP] identifier[m_allocatedHashinatorBytes] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
} , literal[String] operator[SEP] operator[SEP] identifier[m_emergencyGCThread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static void validateBroadcastDims(INDArray x, INDArray y, INDArray z, int... dimensions){
Preconditions.checkArgument(x == z || x.equalShapes(z), "X and Z arrays must be equal shape. X shape: %s, Z shape: %s",
x.shape(), z.shape());
long[] sx = x.shape();
long[] sy = y.shape();
//Possibility 1: equal ranks - dimensions must match
if(dimensions.length == 1 && sy.length == 2 && (sy[0] == 1 || sy[1] == 1)) {
//Edge case: x=[a,b,c], y=[1,b], dim=1 etc
int d2 = dimensions[0] < 0 ? dimensions[0] + sx.length : dimensions[0]; //Handle negative dimensions
if (sy[0] == 1) {
Preconditions.checkState(sx[d2] == sy[1], "Shapes do not match: dimensions[0] - x[%s] must match y[%s], x shape %s, y shape %s, dimensions %s",
dimensions[0], 1, sx, sy, dimensions);
} else {
Preconditions.checkState(sx[d2] == sy[0], "Shapes do not match: dimensions[0] - x[%s] must match y[%s], x shape %s, y shape %s, dimensions %s",
dimensions[0], 0, sx, sy, dimensions);
}
} else if(sx.length == sy.length){
for(int d : dimensions){
int d2 = d < 0 ? d + sx.length : d; //Handle negative dimensions
Preconditions.checkState(sx[d2] == sy[d2], "Dimensions mismatch on dimension %s: x shape %s, y shape %s", d, sx, sy);
}
} else if(dimensions.length == sy.length) {
//Possibility 2: different ranks - for example, mul([a,b,c],[a,c], [0,2]) - dimensions refer to x
for (int i = 0; i < dimensions.length; i++) {
int d2 = dimensions[i] < 0 ? dimensions[i] + sx.length : dimensions[i]; //Handle negative dimensions
Preconditions.checkState(sx[d2] == sy[i], "Shapes do not match: dimensions[%s] - x[%s] must match y[%s], x shape %s, y shape %s, dimensions %s",
i, d2, i, sx, sy, dimensions);
}
} else {
throw new IllegalStateException("Invalid broadcast dimensions: x shape " + Arrays.toString(sx) + ", y shape " + Arrays.toString(sy)
+ ", dimensions " + Arrays.toString(dimensions));
}
} | class class_name[name] begin[{]
method[validateBroadcastDims, return_type[void], modifier[public static], parameter[x, y, z, dimensions]] begin[{]
call[Preconditions.checkArgument, parameter[binary_operation[binary_operation[member[.x], ==, member[.z]], ||, call[x.equalShapes, parameter[member[.z]]]], literal["X and Z arrays must be equal shape. X shape: %s, Z shape: %s"], call[x.shape, parameter[]], call[z.shape, parameter[]]]]
local_variable[type[long], sx]
local_variable[type[long], sy]
if[binary_operation[binary_operation[binary_operation[member[dimensions.length], ==, literal[1]], &&, binary_operation[member[sy.length], ==, literal[2]]], &&, binary_operation[binary_operation[member[.sy], ==, literal[1]], ||, binary_operation[member[.sy], ==, literal[1]]]]] begin[{]
local_variable[type[int], d2]
if[binary_operation[member[.sy], ==, literal[1]]] begin[{]
call[Preconditions.checkState, parameter[binary_operation[member[.sx], ==, member[.sy]], literal["Shapes do not match: dimensions[0] - x[%s] must match y[%s], x shape %s, y shape %s, dimensions %s"], member[.dimensions], literal[1], member[.sx], member[.sy], member[.dimensions]]]
else begin[{]
call[Preconditions.checkState, parameter[binary_operation[member[.sx], ==, member[.sy]], literal["Shapes do not match: dimensions[0] - x[%s] must match y[%s], x shape %s, y shape %s, dimensions %s"], member[.dimensions], literal[0], member[.sx], member[.sy], member[.dimensions]]]
end[}]
else begin[{]
if[binary_operation[member[sx.length], ==, member[sy.length]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=sx, selectors=[]), operator=+)), name=d2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=sx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=sy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Dimensions mismatch on dimension %s: x shape %s, y shape %s"), MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkState, postfix_operators=[], prefix_operators=[], qualifier=Preconditions, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=dimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=d)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None)
else begin[{]
if[binary_operation[member[dimensions.length], ==, member[sy.length]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=dimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MemberReference(member=dimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=BinaryOperation(operandl=MemberReference(member=dimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=sx, selectors=[]), operator=+)), name=d2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=sx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=sy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Shapes do not match: dimensions[%s] - x[%s] must match y[%s], x shape %s, y shape %s, dimensions %s"), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=d2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkState, postfix_operators=[], prefix_operators=[], qualifier=Preconditions, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dimensions, 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)
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid broadcast dimensions: x shape "), operandr=MethodInvocation(arguments=[MemberReference(member=sx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", y shape "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=sy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", dimensions "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=dimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[validateBroadcastDims] operator[SEP] identifier[INDArray] identifier[x] , identifier[INDArray] identifier[y] , identifier[INDArray] identifier[z] , Keyword[int] operator[...] identifier[dimensions] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[x] operator[==] identifier[z] operator[||] identifier[x] operator[SEP] identifier[equalShapes] operator[SEP] identifier[z] operator[SEP] , literal[String] , identifier[x] operator[SEP] identifier[shape] operator[SEP] operator[SEP] , identifier[z] operator[SEP] identifier[shape] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[sx] operator[=] identifier[x] operator[SEP] identifier[shape] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[sy] operator[=] identifier[y] operator[SEP] identifier[shape] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dimensions] operator[SEP] identifier[length] operator[==] Other[1] operator[&&] identifier[sy] operator[SEP] identifier[length] operator[==] Other[2] operator[&&] operator[SEP] identifier[sy] operator[SEP] Other[0] operator[SEP] operator[==] Other[1] operator[||] identifier[sy] operator[SEP] Other[1] operator[SEP] operator[==] Other[1] operator[SEP] operator[SEP] {
Keyword[int] identifier[d2] operator[=] identifier[dimensions] operator[SEP] Other[0] operator[SEP] operator[<] Other[0] operator[?] identifier[dimensions] operator[SEP] Other[0] operator[SEP] operator[+] identifier[sx] operator[SEP] identifier[length] operator[:] identifier[dimensions] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sy] operator[SEP] Other[0] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[sx] operator[SEP] identifier[d2] operator[SEP] operator[==] identifier[sy] operator[SEP] Other[1] operator[SEP] , literal[String] , identifier[dimensions] operator[SEP] Other[0] operator[SEP] , Other[1] , identifier[sx] , identifier[sy] , identifier[dimensions] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[sx] operator[SEP] identifier[d2] operator[SEP] operator[==] identifier[sy] operator[SEP] Other[0] operator[SEP] , literal[String] , identifier[dimensions] operator[SEP] Other[0] operator[SEP] , Other[0] , identifier[sx] , identifier[sy] , identifier[dimensions] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[sx] operator[SEP] identifier[length] operator[==] identifier[sy] operator[SEP] identifier[length] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[:] identifier[dimensions] operator[SEP] {
Keyword[int] identifier[d2] operator[=] identifier[d] operator[<] Other[0] operator[?] identifier[d] operator[+] identifier[sx] operator[SEP] identifier[length] operator[:] identifier[d] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[sx] operator[SEP] identifier[d2] operator[SEP] operator[==] identifier[sy] operator[SEP] identifier[d2] operator[SEP] , literal[String] , identifier[d] , identifier[sx] , identifier[sy] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[dimensions] operator[SEP] identifier[length] operator[==] identifier[sy] operator[SEP] identifier[length] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dimensions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[d2] operator[=] identifier[dimensions] operator[SEP] identifier[i] operator[SEP] operator[<] Other[0] operator[?] identifier[dimensions] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[sx] operator[SEP] identifier[length] operator[:] identifier[dimensions] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[sx] operator[SEP] identifier[d2] operator[SEP] operator[==] identifier[sy] operator[SEP] identifier[i] operator[SEP] , literal[String] , identifier[i] , identifier[d2] , identifier[i] , identifier[sx] , identifier[sy] , identifier[dimensions] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[sx] operator[SEP] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[sy] operator[SEP] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[dimensions] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void printIntroduction()
{
System.out.println("| LoJiX Prolog.");
System.out.println("| Copyright The Sett Ltd.");
System.out.println("| Licensed under the Apache License, Version 2.0.");
System.out.println("| //www.apache.org/licenses/LICENSE-2.0");
System.out.println();
} | class class_name[name] begin[{]
method[printIntroduction, return_type[void], modifier[private], parameter[]] begin[{]
call[System.out.println, parameter[literal["| LoJiX Prolog."]]]
call[System.out.println, parameter[literal["| Copyright The Sett Ltd."]]]
call[System.out.println, parameter[literal["| Licensed under the Apache License, Version 2.0."]]]
call[System.out.println, parameter[literal["| //www.apache.org/licenses/LICENSE-2.0"]]]
call[System.out.println, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[printIntroduction] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP]
}
|
public ServiceFuture<PolicyStatesQueryResultsInner> listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String policyAssignmentName, QueryOptions queryOptions, final ServiceCallback<PolicyStatesQueryResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(listQueryResultsForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync(policyStatesResource, subscriptionId, policyAssignmentName, queryOptions), serviceCallback);
} | class class_name[name] begin[{]
method[listQueryResultsForSubscriptionLevelPolicyAssignmentAsync, return_type[type[ServiceFuture]], modifier[public], parameter[policyStatesResource, subscriptionId, policyAssignmentName, queryOptions, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.listQueryResultsForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync, parameter[member[.policyStatesResource], member[.subscriptionId], member[.policyAssignmentName], member[.queryOptions]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[PolicyStatesQueryResultsInner] operator[>] identifier[listQueryResultsForSubscriptionLevelPolicyAssignmentAsync] operator[SEP] identifier[PolicyStatesResource] identifier[policyStatesResource] , identifier[String] identifier[subscriptionId] , identifier[String] identifier[policyAssignmentName] , identifier[QueryOptions] identifier[queryOptions] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[PolicyStatesQueryResultsInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listQueryResultsForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync] operator[SEP] identifier[policyStatesResource] , identifier[subscriptionId] , identifier[policyAssignmentName] , identifier[queryOptions] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public long getLongByTriple(final long[] triple) {
if (n == 0) return defRetValue;
final int[] e = new int[3];
final int chunk = chunkShift == Long.SIZE ? 0 : (int)(triple[0] >>> chunkShift);
final long chunkOffset = offset[chunk];
HypergraphSorter.tripleToEdge(triple, seed[chunk], (int)(offset[chunk + 1] - chunkOffset), e);
if (e[0] == -1) return defRetValue;
final long result = rank(chunkOffset + e[(int)(values.getLong(e[0] + chunkOffset) + values.getLong(e[1] + chunkOffset) + values.getLong(e[2] + chunkOffset)) % 3]);
if (signatureMask != 0) return result >= n || signatures.getLong(result) != (triple[0] & signatureMask) ? defRetValue : result;
// Out-of-set strings can generate bizarre 3-hyperedges.
return result < n ? result : defRetValue;
} | class class_name[name] begin[{]
method[getLongByTriple, return_type[type[long]], modifier[public], parameter[triple]] begin[{]
if[binary_operation[member[.n], ==, literal[0]]] begin[{]
return[member[.defRetValue]]
else begin[{]
None
end[}]
local_variable[type[int], e]
local_variable[type[int], chunk]
local_variable[type[long], chunkOffset]
call[HypergraphSorter.tripleToEdge, parameter[member[.triple], member[.seed], Cast(expression=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=chunk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=MemberReference(member=chunkOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), type=BasicType(dimensions=[], name=int)), member[.e]]]
if[binary_operation[member[.e], ==, literal[1]]] begin[{]
return[member[.defRetValue]]
else begin[{]
None
end[}]
local_variable[type[long], result]
if[binary_operation[member[.signatureMask], !=, literal[0]]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=signatures, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=triple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=signatureMask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operator=!=), operator=||), if_false=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=defRetValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
None
end[}]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=MemberReference(member=defRetValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[getLongByTriple] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[triple] operator[SEP] {
Keyword[if] operator[SEP] identifier[n] operator[==] Other[0] operator[SEP] Keyword[return] identifier[defRetValue] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[e] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[3] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[chunk] operator[=] identifier[chunkShift] operator[==] identifier[Long] operator[SEP] identifier[SIZE] operator[?] Other[0] operator[:] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[triple] operator[SEP] Other[0] operator[SEP] operator[>] operator[>] operator[>] identifier[chunkShift] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[chunkOffset] operator[=] identifier[offset] operator[SEP] identifier[chunk] operator[SEP] operator[SEP] identifier[HypergraphSorter] operator[SEP] identifier[tripleToEdge] operator[SEP] identifier[triple] , identifier[seed] operator[SEP] identifier[chunk] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[offset] operator[SEP] identifier[chunk] operator[+] Other[1] operator[SEP] operator[-] identifier[chunkOffset] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] operator[SEP] Other[0] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] Keyword[return] identifier[defRetValue] operator[SEP] Keyword[final] Keyword[long] identifier[result] operator[=] identifier[rank] operator[SEP] identifier[chunkOffset] operator[+] identifier[e] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[getLong] operator[SEP] identifier[e] operator[SEP] Other[0] operator[SEP] operator[+] identifier[chunkOffset] operator[SEP] operator[+] identifier[values] operator[SEP] identifier[getLong] operator[SEP] identifier[e] operator[SEP] Other[1] operator[SEP] operator[+] identifier[chunkOffset] operator[SEP] operator[+] identifier[values] operator[SEP] identifier[getLong] operator[SEP] identifier[e] operator[SEP] Other[2] operator[SEP] operator[+] identifier[chunkOffset] operator[SEP] operator[SEP] operator[%] Other[3] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[signatureMask] operator[!=] Other[0] operator[SEP] Keyword[return] identifier[result] operator[>=] identifier[n] operator[||] identifier[signatures] operator[SEP] identifier[getLong] operator[SEP] identifier[result] operator[SEP] operator[!=] operator[SEP] identifier[triple] operator[SEP] Other[0] operator[SEP] operator[&] identifier[signatureMask] operator[SEP] operator[?] identifier[defRetValue] operator[:] identifier[result] operator[SEP] Keyword[return] identifier[result] operator[<] identifier[n] operator[?] identifier[result] operator[:] identifier[defRetValue] operator[SEP]
}
|
public final EObject entryRuleXBasicForLoopExpression() throws RecognitionException {
EObject current = null;
EObject iv_ruleXBasicForLoopExpression = null;
try {
// InternalSARL.g:14416:64: (iv_ruleXBasicForLoopExpression= ruleXBasicForLoopExpression EOF )
// InternalSARL.g:14417:2: iv_ruleXBasicForLoopExpression= ruleXBasicForLoopExpression EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getXBasicForLoopExpressionRule());
}
pushFollow(FOLLOW_1);
iv_ruleXBasicForLoopExpression=ruleXBasicForLoopExpression();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleXBasicForLoopExpression;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} | class class_name[name] begin[{]
method[entryRuleXBasicForLoopExpression, return_type[type[EObject]], modifier[final public], parameter[]] begin[{]
local_variable[type[EObject], current]
local_variable[type[EObject], iv_ruleXBasicForLoopExpression]
TryStatement(block=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXBasicForLoopExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=iv_ruleXBasicForLoopExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleXBasicForLoopExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=iv_ruleXBasicForLoopExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.current]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[EObject] identifier[entryRuleXBasicForLoopExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[EObject] identifier[current] operator[=] Other[null] operator[SEP] identifier[EObject] identifier[iv_ruleXBasicForLoopExpression] operator[=] Other[null] operator[SEP] Keyword[try] {
{
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXBasicForLoopExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pushFollow] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[iv_ruleXBasicForLoopExpression] operator[=] identifier[ruleXBasicForLoopExpression] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[current] operator[=] identifier[iv_ruleXBasicForLoopExpression] operator[SEP]
}
identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[current] operator[SEP]
}
|
private static Type[] extractTypeArgumentsFrom(final Map<TypeVariable<?>, Type> mappings, final TypeVariable<?>[] variables) {
final Type[] result = new Type[variables.length];
int index = 0;
for (final TypeVariable<?> var : variables) {
Validate.isTrue(mappings.containsKey(var), "missing argument mapping for %s", toString(var));
result[index++] = mappings.get(var);
}
return result;
} | class class_name[name] begin[{]
method[extractTypeArgumentsFrom, return_type[type[Type]], modifier[private static], parameter[mappings, variables]] begin[{]
local_variable[type[Type], result]
local_variable[type[int], index]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=mappings, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="missing argument mapping for %s"), MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=isTrue, postfix_operators=[], prefix_operators=[], qualifier=Validate, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mappings, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=variables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=var)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=TypeVariable, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Type] operator[SEP] operator[SEP] identifier[extractTypeArgumentsFrom] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[TypeVariable] operator[<] operator[?] operator[>] , identifier[Type] operator[>] identifier[mappings] , Keyword[final] identifier[TypeVariable] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[variables] operator[SEP] {
Keyword[final] identifier[Type] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[Type] operator[SEP] identifier[variables] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[TypeVariable] operator[<] operator[?] operator[>] identifier[var] operator[:] identifier[variables] operator[SEP] {
identifier[Validate] operator[SEP] identifier[isTrue] operator[SEP] identifier[mappings] operator[SEP] identifier[containsKey] operator[SEP] identifier[var] operator[SEP] , literal[String] , identifier[toString] operator[SEP] identifier[var] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] identifier[mappings] operator[SEP] identifier[get] operator[SEP] identifier[var] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void setRow(int row, double[] columns) {
if (columns.length != cols) {
throw new IllegalArgumentException(
"invalid number of columns: " + columns.length);
}
for (int col = 0; col < cols; ++col) {
sparseMatrix[row].set(col, columns[col]);
}
} | class class_name[name] begin[{]
method[setRow, return_type[void], modifier[public], parameter[row, columns]] begin[{]
if[binary_operation[member[columns.length], !=, member[.cols]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid number of columns: "), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=columns, 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[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=sparseMatrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cols, 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=col)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=col, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setRow] operator[SEP] Keyword[int] identifier[row] , Keyword[double] operator[SEP] operator[SEP] identifier[columns] operator[SEP] {
Keyword[if] operator[SEP] identifier[columns] operator[SEP] identifier[length] operator[!=] identifier[cols] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[columns] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[col] operator[=] Other[0] operator[SEP] identifier[col] operator[<] identifier[cols] operator[SEP] operator[++] identifier[col] operator[SEP] {
identifier[sparseMatrix] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[col] , identifier[columns] operator[SEP] identifier[col] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected boolean isColumnDefinitionStart( DdlTokenStream tokens ) throws ParsingException {
boolean result = false;
if (isTableConstraint(tokens)) {
result = false;
} else {
for (String dTypeStartWord : getDataTypeStartWords()) {
result = (tokens.matches(TokenStream.ANY_VALUE, dTypeStartWord) || tokens.matches("COLUMN",
TokenStream.ANY_VALUE,
dTypeStartWord));
if (result) {
break;
}
}
}
return result;
} | class class_name[name] begin[{]
method[isColumnDefinitionStart, return_type[type[boolean]], modifier[protected], parameter[tokens]] begin[{]
local_variable[type[boolean], result]
if[call[.isTableConstraint, parameter[member[.tokens]]]] begin[{]
assign[member[.result], literal[false]]
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ANY_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TokenStream, selectors=[]), MemberReference(member=dTypeStartWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="COLUMN"), MemberReference(member=ANY_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TokenStream, selectors=[]), MemberReference(member=dTypeStartWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), operator=||)), label=None), IfStatement(condition=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDataTypeStartWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dTypeStartWord)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[protected] Keyword[boolean] identifier[isColumnDefinitionStart] operator[SEP] identifier[DdlTokenStream] identifier[tokens] operator[SEP] Keyword[throws] identifier[ParsingException] {
Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[isTableConstraint] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] {
identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[String] identifier[dTypeStartWord] operator[:] identifier[getDataTypeStartWords] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[=] operator[SEP] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] identifier[TokenStream] operator[SEP] identifier[ANY_VALUE] , identifier[dTypeStartWord] operator[SEP] operator[||] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] literal[String] , identifier[TokenStream] operator[SEP] identifier[ANY_VALUE] , identifier[dTypeStartWord] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] {
Keyword[break] operator[SEP]
}
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public Resource[] getResources(String path) throws IOException {
if (hasContext()) {
return context.getResources(path);
}
return getContext().getResources(getContextPath() + '/' + path);
} | class class_name[name] begin[{]
method[getResources, return_type[type[Resource]], modifier[public], parameter[path]] begin[{]
if[call[.hasContext, parameter[]]] begin[{]
return[call[context.getResources, parameter[member[.path]]]]
else begin[{]
None
end[}]
return[call[.getContext, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Resource] operator[SEP] operator[SEP] identifier[getResources] operator[SEP] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[hasContext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[context] operator[SEP] identifier[getResources] operator[SEP] identifier[path] operator[SEP] operator[SEP]
}
Keyword[return] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getResources] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[path] operator[SEP] operator[SEP]
}
|
@NonNull
public static Drop dropFunction(@Nullable String keyspace, @NonNull String functionName) {
return new DefaultDrop(
keyspace == null ? null : CqlIdentifier.fromCql(keyspace),
CqlIdentifier.fromCql(functionName),
"FUNCTION");
} | class class_name[name] begin[{]
method[dropFunction, return_type[type[Drop]], modifier[public static], parameter[keyspace, functionName]] begin[{]
return[ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=keyspace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=keyspace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromCql, postfix_operators=[], prefix_operators=[], qualifier=CqlIdentifier, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), MethodInvocation(arguments=[MemberReference(member=functionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromCql, postfix_operators=[], prefix_operators=[], qualifier=CqlIdentifier, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FUNCTION")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultDrop, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[NonNull] Keyword[public] Keyword[static] identifier[Drop] identifier[dropFunction] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[keyspace] , annotation[@] identifier[NonNull] identifier[String] identifier[functionName] operator[SEP] {
Keyword[return] Keyword[new] identifier[DefaultDrop] operator[SEP] identifier[keyspace] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[CqlIdentifier] operator[SEP] identifier[fromCql] operator[SEP] identifier[keyspace] operator[SEP] , identifier[CqlIdentifier] operator[SEP] identifier[fromCql] operator[SEP] identifier[functionName] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
|
public void copy(int srcIdx, char[] dst, int dstIdx, int length) {
if (dst == null) {
throw new NullPointerException("dst");
}
if (isOutOfBounds(srcIdx, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + length("
+ length + ") <= srcLen(" + length() + ')');
}
final int dstEnd = dstIdx + length;
for (int i = dstIdx, j = srcIdx + arrayOffset(); i < dstEnd; i++, j++) {
dst[i] = b2c(value[j]);
}
} | class class_name[name] begin[{]
method[copy, return_type[void], modifier[public], parameter[srcIdx, dst, dstIdx, length]] begin[{]
if[binary_operation[member[.dst], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dst")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[.isOutOfBounds, parameter[member[.srcIdx], member[.length], call[.length, parameter[]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="expected: "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0 <= srcIdx("), operator=+), operandr=MemberReference(member=srcIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") <= srcIdx + length("), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") <= srcLen("), operator=+), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')'), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], dstEnd]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=b2c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dstEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=dstIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=srcIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=arrayOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[copy] operator[SEP] Keyword[int] identifier[srcIdx] , Keyword[char] operator[SEP] operator[SEP] identifier[dst] , Keyword[int] identifier[dstIdx] , Keyword[int] identifier[length] operator[SEP] {
Keyword[if] operator[SEP] identifier[dst] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isOutOfBounds] operator[SEP] identifier[srcIdx] , identifier[length] , identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[srcIdx] operator[+] literal[String] operator[+] identifier[length] operator[+] literal[String] operator[+] identifier[length] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[int] identifier[dstEnd] operator[=] identifier[dstIdx] operator[+] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[dstIdx] , identifier[j] operator[=] identifier[srcIdx] operator[+] identifier[arrayOffset] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[dstEnd] operator[SEP] identifier[i] operator[++] , identifier[j] operator[++] operator[SEP] {
identifier[dst] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[b2c] operator[SEP] identifier[value] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public Policy withResourceTypeList(String... resourceTypeList) {
if (this.resourceTypeList == null) {
setResourceTypeList(new java.util.ArrayList<String>(resourceTypeList.length));
}
for (String ele : resourceTypeList) {
this.resourceTypeList.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withResourceTypeList, return_type[type[Policy]], modifier[public], parameter[resourceTypeList]] begin[{]
if[binary_operation[THIS[member[None.resourceTypeList]], ==, literal[null]]] begin[{]
call[.setResourceTypeList, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resourceTypeList, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=resourceTypeList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resourceTypeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Policy] identifier[withResourceTypeList] operator[SEP] identifier[String] operator[...] identifier[resourceTypeList] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[resourceTypeList] operator[==] Other[null] operator[SEP] {
identifier[setResourceTypeList] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[resourceTypeList] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[resourceTypeList] operator[SEP] {
Keyword[this] operator[SEP] identifier[resourceTypeList] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public String getDateTime(Date date) {
return CmsDateUtil.getDateTime(date, DateFormat.SHORT, m_locale);
} | class class_name[name] begin[{]
method[getDateTime, return_type[type[String]], modifier[public], parameter[date]] begin[{]
return[call[CmsDateUtil.getDateTime, parameter[member[.date], member[DateFormat.SHORT], member[.m_locale]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getDateTime] operator[SEP] identifier[Date] identifier[date] operator[SEP] {
Keyword[return] identifier[CmsDateUtil] operator[SEP] identifier[getDateTime] operator[SEP] identifier[date] , identifier[DateFormat] operator[SEP] identifier[SHORT] , identifier[m_locale] operator[SEP] operator[SEP]
}
|
public final JrsValueCursor iterateChildren() {
JrsValue n = currentNode();
if (n == null) throw new IllegalStateException("No current node");
if (n.isArray()) { // false since we have already returned START_ARRAY
return new ArrayCursor((JrsArray) n, this);
}
if (n.isObject()) {
return new ObjectCursor((JrsObject) n, this);
}
throw new IllegalStateException("Current node of type "+n.getClass().getName());
} | class class_name[name] begin[{]
method[iterateChildren, return_type[type[JrsValueCursor]], modifier[final public], parameter[]] begin[{]
local_variable[type[JrsValue], n]
if[binary_operation[member[.n], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No current node")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[n.isArray, parameter[]]] begin[{]
return[ClassCreator(arguments=[Cast(expression=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JrsArray, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayCursor, sub_type=None))]
else begin[{]
None
end[}]
if[call[n.isObject, parameter[]]] begin[{]
return[ClassCreator(arguments=[Cast(expression=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JrsObject, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectCursor, sub_type=None))]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Current node of type "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[final] identifier[JrsValueCursor] identifier[iterateChildren] operator[SEP] operator[SEP] {
identifier[JrsValue] identifier[n] operator[=] identifier[currentNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArrayCursor] operator[SEP] operator[SEP] identifier[JrsArray] operator[SEP] identifier[n] , Keyword[this] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[isObject] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ObjectCursor] operator[SEP] operator[SEP] identifier[JrsObject] operator[SEP] identifier[n] , Keyword[this] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[n] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Subject authenticate(String jaasEntryName, AuthenticationData authenticationData, Subject subject) throws AuthenticationException {
ReentrantLock currentLock = optionallyObtainLockedLock(authenticationData);
try {
// If basic auth login to a different realm, then create a basic auth subject
if (isBasicAuthLogin(authenticationData)) {
return createBasicAuthSubject(authenticationData, subject);
} else {
Subject authenticatedSubject = findSubjectInAuthCache(authenticationData, subject);
if (authenticatedSubject == null) {
authenticatedSubject = performJAASLogin(jaasEntryName, authenticationData, subject);
insertSubjectInAuthCache(authenticationData, authenticatedSubject);
}
return authenticatedSubject;
}
} finally {
releaseLock(authenticationData, currentLock);
}
} | class class_name[name] begin[{]
method[authenticate, return_type[type[Subject]], modifier[public], parameter[jaasEntryName, authenticationData, subject]] begin[{]
local_variable[type[ReentrantLock], currentLock]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=authenticationData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBasicAuthLogin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=authenticationData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findSubjectInAuthCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=authenticatedSubject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Subject, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=authenticatedSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=authenticatedSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=jaasEntryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authenticationData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=performJAASLogin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=authenticationData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authenticatedSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insertSubjectInAuthCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=authenticatedSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=authenticationData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createBasicAuthSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=authenticationData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=releaseLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Subject] identifier[authenticate] operator[SEP] identifier[String] identifier[jaasEntryName] , identifier[AuthenticationData] identifier[authenticationData] , identifier[Subject] identifier[subject] operator[SEP] Keyword[throws] identifier[AuthenticationException] {
identifier[ReentrantLock] identifier[currentLock] operator[=] identifier[optionallyObtainLockedLock] operator[SEP] identifier[authenticationData] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[isBasicAuthLogin] operator[SEP] identifier[authenticationData] operator[SEP] operator[SEP] {
Keyword[return] identifier[createBasicAuthSubject] operator[SEP] identifier[authenticationData] , identifier[subject] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Subject] identifier[authenticatedSubject] operator[=] identifier[findSubjectInAuthCache] operator[SEP] identifier[authenticationData] , identifier[subject] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[authenticatedSubject] operator[==] Other[null] operator[SEP] {
identifier[authenticatedSubject] operator[=] identifier[performJAASLogin] operator[SEP] identifier[jaasEntryName] , identifier[authenticationData] , identifier[subject] operator[SEP] operator[SEP] identifier[insertSubjectInAuthCache] operator[SEP] identifier[authenticationData] , identifier[authenticatedSubject] operator[SEP] operator[SEP]
}
Keyword[return] identifier[authenticatedSubject] operator[SEP]
}
}
Keyword[finally] {
identifier[releaseLock] operator[SEP] identifier[authenticationData] , identifier[currentLock] operator[SEP] operator[SEP]
}
}
|
private boolean voltConvertBinaryIntegerLiteral(Session session, Expression lhs, Expression rhs) {
Expression nonIntegralExpr;
int whichChild;
if (lhs.dataType.isIntegralType()) {
nonIntegralExpr = rhs;
whichChild = RIGHT;
}
else if (rhs.dataType.isIntegralType()) {
nonIntegralExpr = lhs;
whichChild = LEFT;
} else {
return false;
}
return ExpressionValue.voltMutateToBigintType(nonIntegralExpr, this, whichChild);
} | class class_name[name] begin[{]
method[voltConvertBinaryIntegerLiteral, return_type[type[boolean]], modifier[private], parameter[session, lhs, rhs]] begin[{]
local_variable[type[Expression], nonIntegralExpr]
local_variable[type[int], whichChild]
if[call[lhs.dataType.isIntegralType, parameter[]]] begin[{]
assign[member[.nonIntegralExpr], member[.rhs]]
assign[member[.whichChild], member[.RIGHT]]
else begin[{]
if[call[rhs.dataType.isIntegralType, parameter[]]] begin[{]
assign[member[.nonIntegralExpr], member[.lhs]]
assign[member[.whichChild], member[.LEFT]]
else begin[{]
return[literal[false]]
end[}]
end[}]
return[call[ExpressionValue.voltMutateToBigintType, parameter[member[.nonIntegralExpr], THIS[], member[.whichChild]]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[voltConvertBinaryIntegerLiteral] operator[SEP] identifier[Session] identifier[session] , identifier[Expression] identifier[lhs] , identifier[Expression] identifier[rhs] operator[SEP] {
identifier[Expression] identifier[nonIntegralExpr] operator[SEP] Keyword[int] identifier[whichChild] operator[SEP] Keyword[if] operator[SEP] identifier[lhs] operator[SEP] identifier[dataType] operator[SEP] identifier[isIntegralType] operator[SEP] operator[SEP] operator[SEP] {
identifier[nonIntegralExpr] operator[=] identifier[rhs] operator[SEP] identifier[whichChild] operator[=] identifier[RIGHT] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rhs] operator[SEP] identifier[dataType] operator[SEP] identifier[isIntegralType] operator[SEP] operator[SEP] operator[SEP] {
identifier[nonIntegralExpr] operator[=] identifier[lhs] operator[SEP] identifier[whichChild] operator[=] identifier[LEFT] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] identifier[ExpressionValue] operator[SEP] identifier[voltMutateToBigintType] operator[SEP] identifier[nonIntegralExpr] , Keyword[this] , identifier[whichChild] operator[SEP] operator[SEP]
}
|
public void marshall(RetainRule retainRule, ProtocolMarshaller protocolMarshaller) {
if (retainRule == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(retainRule.getCount(), COUNT_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[retainRule, protocolMarshaller]] begin[{]
if[binary_operation[member[.retainRule], ==, 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=getCount, postfix_operators=[], prefix_operators=[], qualifier=retainRule, selectors=[], type_arguments=None), MemberReference(member=COUNT_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[RetainRule] identifier[retainRule] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[retainRule] 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[retainRule] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] , identifier[COUNT_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]
}
}
|
void build()
{
// xsl:import, xsl:include
XSLTAttributeDef hrefAttr = new XSLTAttributeDef(null, "href",
XSLTAttributeDef.T_URL, true, false,XSLTAttributeDef.ERROR);
// xsl:preserve-space, xsl:strip-space
XSLTAttributeDef elementsAttr = new XSLTAttributeDef(null, "elements",
XSLTAttributeDef.T_SIMPLEPATTERNLIST,
true, false, XSLTAttributeDef.ERROR);
// XSLTAttributeDef anyNamespacedAttr = new XSLTAttributeDef("*", "*",
// XSLTAttributeDef.T_CDATA, false);
// xsl:output
XSLTAttributeDef methodAttr = new XSLTAttributeDef(null, "method",
XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef versionAttr = new XSLTAttributeDef(null, "version",
XSLTAttributeDef.T_NMTOKEN, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef encodingAttr = new XSLTAttributeDef(null, "encoding",
XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef omitXmlDeclarationAttr = new XSLTAttributeDef(null,
"omit-xml-declaration",
XSLTAttributeDef.T_YESNO,
false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef standaloneAttr = new XSLTAttributeDef(null,
"standalone",
XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef doctypePublicAttr = new XSLTAttributeDef(null,
"doctype-public",
XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef doctypeSystemAttr = new XSLTAttributeDef(null,
"doctype-system",
XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef cdataSectionElementsAttr = new XSLTAttributeDef(null,
"cdata-section-elements",
XSLTAttributeDef.T_QNAMES_RESOLVE_NULL,
false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef indentAttr = new XSLTAttributeDef(null, "indent",
XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef mediaTypeAttr = new XSLTAttributeDef(null, "media-type",
XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
// Required.
// It is an error if the name attribute is invalid on any of these elements
// xsl:key, xsl:attribute-set, xsl:call-template, xsl:with-param, xsl:variable, xsl:param
XSLTAttributeDef nameAttrRequired = new XSLTAttributeDef(null, "name",
XSLTAttributeDef.T_QNAME, true, false,XSLTAttributeDef.ERROR);
// Required.
// Support AVT
// xsl:element, xsl:attribute
XSLTAttributeDef nameAVTRequired = new XSLTAttributeDef(null, "name",
XSLTAttributeDef.T_AVT_QNAME, true, true,XSLTAttributeDef.WARNING);
// Required.
// Support AVT
// xsl:processing-instruction
XSLTAttributeDef nameAVT_NCNAMERequired = new XSLTAttributeDef(null, "name",
XSLTAttributeDef.T_NCNAME, true, true,XSLTAttributeDef.WARNING);
// Optional.
// Static error if invalid
// xsl:template, xsl:decimal-format
XSLTAttributeDef nameAttrOpt_ERROR = new XSLTAttributeDef(null, "name",
XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR);
// xsl:key
XSLTAttributeDef useAttr = new XSLTAttributeDef(null, "use",
XSLTAttributeDef.T_EXPR, true, false,XSLTAttributeDef.ERROR);
// xsl:element, xsl:attribute
XSLTAttributeDef namespaceAVTOpt = new XSLTAttributeDef(null,
"namespace",XSLTAttributeDef.T_URL,
false, true,XSLTAttributeDef.WARNING);
// xsl:decimal-format
XSLTAttributeDef decimalSeparatorAttr = new XSLTAttributeDef(null,
"decimal-separator",
XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, ".");
XSLTAttributeDef infinityAttr = new XSLTAttributeDef(null, "infinity",
XSLTAttributeDef.T_CDATA, false,XSLTAttributeDef.ERROR,"Infinity");
XSLTAttributeDef minusSignAttr = new XSLTAttributeDef(null, "minus-sign",
XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR,"-");
XSLTAttributeDef NaNAttr = new XSLTAttributeDef(null, "NaN",
XSLTAttributeDef.T_CDATA, false,XSLTAttributeDef.ERROR, "NaN");
XSLTAttributeDef percentAttr = new XSLTAttributeDef(null, "percent",
XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, "%");
XSLTAttributeDef perMilleAttr = new XSLTAttributeDef(null, "per-mille",
XSLTAttributeDef.T_CHAR,
false, false,XSLTAttributeDef.ERROR /* ,"‰" */);
XSLTAttributeDef zeroDigitAttr = new XSLTAttributeDef(null, "zero-digit",
XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, "0");
XSLTAttributeDef digitAttr = new XSLTAttributeDef(null, "digit",
XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, "#");
XSLTAttributeDef patternSeparatorAttr = new XSLTAttributeDef(null,
"pattern-separator",
XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, ";");
// xsl:decimal-format
XSLTAttributeDef groupingSeparatorAttr = new XSLTAttributeDef(null,
"grouping-separator",
XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR,",");
// xsl:element, xsl:attribute-set, xsl:copy
XSLTAttributeDef useAttributeSetsAttr = new XSLTAttributeDef(null,
"use-attribute-sets",
XSLTAttributeDef.T_QNAMES,
false, false, XSLTAttributeDef.ERROR);
// xsl:if, xsl:when
XSLTAttributeDef testAttrRequired = new XSLTAttributeDef(null, "test",
XSLTAttributeDef.T_EXPR, true, false,XSLTAttributeDef.ERROR);
// Required.
// xsl:value-of, xsl:for-each, xsl:copy-of
XSLTAttributeDef selectAttrRequired = new XSLTAttributeDef(null,
"select",
XSLTAttributeDef.T_EXPR, true, false,XSLTAttributeDef.ERROR);
// Optional.
// xsl:variable, xsl:param, xsl:with-param
XSLTAttributeDef selectAttrOpt = new XSLTAttributeDef(null, "select",
XSLTAttributeDef.T_EXPR, false, false,XSLTAttributeDef.ERROR);
// Optional.
// Default: "node()"
// xsl:apply-templates
XSLTAttributeDef selectAttrDefNode = new XSLTAttributeDef(null, "select",
XSLTAttributeDef.T_EXPR, false,XSLTAttributeDef.ERROR, "node()");
// Optional.
// Default: "."
// xsl:sort
XSLTAttributeDef selectAttrDefDot = new XSLTAttributeDef(null, "select",
XSLTAttributeDef.T_EXPR, false,XSLTAttributeDef.ERROR, ".");
// xsl:key
XSLTAttributeDef matchAttrRequired = new XSLTAttributeDef(null, "match",
XSLTAttributeDef.T_PATTERN, true, false,XSLTAttributeDef.ERROR);
// xsl:template
XSLTAttributeDef matchAttrOpt = new XSLTAttributeDef(null, "match",
XSLTAttributeDef.T_PATTERN, false, false,XSLTAttributeDef.ERROR);
// xsl:template
XSLTAttributeDef priorityAttr = new XSLTAttributeDef(null, "priority",
XSLTAttributeDef.T_NUMBER, false, false,XSLTAttributeDef.ERROR);
// xsl:template, xsl:apply-templates
XSLTAttributeDef modeAttr = new XSLTAttributeDef(null, "mode",
XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef spaceAttr =
new XSLTAttributeDef(Constants.S_XMLNAMESPACEURI, "space", false, false, false, XSLTAttributeDef.WARNING,
"default", Constants.ATTRVAL_STRIP, "preserve",
Constants.ATTRVAL_PRESERVE);
XSLTAttributeDef spaceAttrLiteral =
new XSLTAttributeDef(Constants.S_XMLNAMESPACEURI, "space",
XSLTAttributeDef.T_URL, false, true,XSLTAttributeDef.ERROR);
// xsl:namespace-alias
XSLTAttributeDef stylesheetPrefixAttr = new XSLTAttributeDef(null,
"stylesheet-prefix",
XSLTAttributeDef.T_CDATA, true, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef resultPrefixAttr = new XSLTAttributeDef(null,
"result-prefix",
XSLTAttributeDef.T_CDATA, true, false,XSLTAttributeDef.ERROR);
// xsl:text, xsl:value-of
XSLTAttributeDef disableOutputEscapingAttr = new XSLTAttributeDef(null,
"disable-output-escaping",
XSLTAttributeDef.T_YESNO,
false, false,XSLTAttributeDef.ERROR);
// xsl:number
XSLTAttributeDef levelAttr = new XSLTAttributeDef(null, "level", false, false, false, XSLTAttributeDef.ERROR,
"single", Constants.NUMBERLEVEL_SINGLE,
"multiple", Constants.NUMBERLEVEL_MULTI,
"any", Constants.NUMBERLEVEL_ANY);
levelAttr.setDefault("single");
XSLTAttributeDef countAttr = new XSLTAttributeDef(null, "count",
XSLTAttributeDef.T_PATTERN, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef fromAttr = new XSLTAttributeDef(null, "from",
XSLTAttributeDef.T_PATTERN, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef valueAttr = new XSLTAttributeDef(null, "value",
XSLTAttributeDef.T_EXPR, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef formatAttr = new XSLTAttributeDef(null, "format",
XSLTAttributeDef.T_CDATA, false, true,XSLTAttributeDef.ERROR);
formatAttr.setDefault("1");
// xsl:number, xsl:sort
XSLTAttributeDef langAttr = new XSLTAttributeDef(null, "lang",
XSLTAttributeDef.T_NMTOKEN, false, true,XSLTAttributeDef.ERROR);
// xsl:number
XSLTAttributeDef letterValueAttr = new XSLTAttributeDef(null,
"letter-value",
false, true, false, XSLTAttributeDef.ERROR,
"alphabetic", Constants.NUMBERLETTER_ALPHABETIC,
"traditional", Constants.NUMBERLETTER_TRADITIONAL);
// xsl:number
XSLTAttributeDef groupingSeparatorAVT = new XSLTAttributeDef(null,
"grouping-separator",
XSLTAttributeDef.T_CHAR, false, true,XSLTAttributeDef.ERROR);
// xsl:number
XSLTAttributeDef groupingSizeAttr = new XSLTAttributeDef(null,
"grouping-size",
XSLTAttributeDef.T_NUMBER, false, true,XSLTAttributeDef.ERROR);
// xsl:sort
XSLTAttributeDef dataTypeAttr = new XSLTAttributeDef(null, "data-type", false, true, true, XSLTAttributeDef.ERROR,
"text", Constants.SORTDATATYPE_TEXT ,"number", Constants.SORTDATATYPE_TEXT);
dataTypeAttr.setDefault("text");
// xsl:sort
XSLTAttributeDef orderAttr = new XSLTAttributeDef(null, "order", false, true, false,XSLTAttributeDef.ERROR,
"ascending", Constants.SORTORDER_ASCENDING,
"descending", Constants.SORTORDER_DESCENDING);
orderAttr.setDefault("ascending");
// xsl:sort
XSLTAttributeDef caseOrderAttr = new XSLTAttributeDef(null, "case-order", false, true, false,XSLTAttributeDef.ERROR,
"upper-first", Constants.SORTCASEORDER_UPPERFIRST ,
"lower-first", Constants.SORTCASEORDER_LOWERFIRST);
// xsl:message
XSLTAttributeDef terminateAttr = new XSLTAttributeDef(null, "terminate",
XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR);
terminateAttr.setDefault("no");
// top level attributes
XSLTAttributeDef xslExcludeResultPrefixesAttr =
new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL,
"exclude-result-prefixes",
XSLTAttributeDef.T_PREFIXLIST, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef xslExtensionElementPrefixesAttr =
new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL,
"extension-element-prefixes",
XSLTAttributeDef.T_PREFIX_URLLIST, false, false,XSLTAttributeDef.ERROR);
// result-element-atts
XSLTAttributeDef xslUseAttributeSetsAttr =
new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "use-attribute-sets",
XSLTAttributeDef.T_QNAMES, false, false,XSLTAttributeDef.ERROR);
XSLTAttributeDef xslVersionAttr =
new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "version",
XSLTAttributeDef.T_NMTOKEN, false, false,XSLTAttributeDef.ERROR);
XSLTElementDef charData = new XSLTElementDef(this, null, "text()",
null /*alias */, null /* elements */, null, /* attributes */
new ProcessorCharacters(),
ElemTextLiteral.class /* class object */);
charData.setType(XSLTElementDef.T_PCDATA);
XSLTElementDef whiteSpaceOnly = new XSLTElementDef(this, null, "text()",
null /*alias */, null /* elements */,
null, /* attributes */
null,
ElemTextLiteral.class /* should be null? -sb */);
charData.setType(XSLTElementDef.T_PCDATA);
XSLTAttributeDef resultAttr = new XSLTAttributeDef(null, "*",
XSLTAttributeDef.T_AVT, false, true,XSLTAttributeDef.WARNING);
XSLTAttributeDef xslResultAttr =
new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "*",
XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.WARNING);
XSLTElementDef[] templateElements = new XSLTElementDef[23];
XSLTElementDef[] templateElementsAndParams = new XSLTElementDef[24];
XSLTElementDef[] templateElementsAndSort = new XSLTElementDef[24];
//exslt
XSLTElementDef[] exsltFunctionElements = new XSLTElementDef[24];
XSLTElementDef[] charTemplateElements = new XSLTElementDef[15];
XSLTElementDef resultElement = new XSLTElementDef(this, null, "*",
null /*alias */,
templateElements /* elements */,
new XSLTAttributeDef[]{
spaceAttrLiteral, // special
xslExcludeResultPrefixesAttr,
xslExtensionElementPrefixesAttr,
xslUseAttributeSetsAttr,
xslVersionAttr,
xslResultAttr,
resultAttr },
new ProcessorLRE(),
ElemLiteralResult.class /* class object */, 20, true);
XSLTElementDef unknownElement =
new XSLTElementDef(this, "*", "unknown", null /*alias */,
templateElementsAndParams /* elements */,
new XSLTAttributeDef[]{ xslExcludeResultPrefixesAttr,
xslExtensionElementPrefixesAttr,
xslUseAttributeSetsAttr,
xslVersionAttr,
xslResultAttr,
resultAttr },
new ProcessorUnknown(),
ElemUnknown.class /* class object */, 20, true);
XSLTElementDef xslValueOf = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "value-of",
null /*alias */, null /* elements */,
new XSLTAttributeDef[]{ selectAttrRequired,
disableOutputEscapingAttr },
new ProcessorTemplateElem(),
ElemValueOf.class /* class object */, 20, true);
XSLTElementDef xslCopyOf = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "copy-of",
null /*alias */, null /* elements */,
new XSLTAttributeDef[]{ selectAttrRequired },
new ProcessorTemplateElem(),
ElemCopyOf.class /* class object */, 20, true);
XSLTElementDef xslNumber = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "number",
null /*alias */, null /* elements */,
new XSLTAttributeDef[]{ levelAttr,
countAttr,
fromAttr,
valueAttr,
formatAttr,
langAttr,
letterValueAttr,
groupingSeparatorAVT,
groupingSizeAttr },
new ProcessorTemplateElem(),
ElemNumber.class /* class object */, 20, true);
// <!-- xsl:sort cannot occur after any other elements or
// any non-whitespace character -->
XSLTElementDef xslSort = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL,
"sort", null /*alias */,
null /* elements */,
new XSLTAttributeDef[]{
selectAttrDefDot,
langAttr,
dataTypeAttr,
orderAttr,
caseOrderAttr },
new ProcessorTemplateElem(),
ElemSort.class/* class object */, 19, true );
XSLTElementDef xslWithParam = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL,
"with-param", null /*alias */,
templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{ nameAttrRequired,
selectAttrOpt }, new ProcessorTemplateElem(),
ElemWithParam.class /* class object */, 19, true);
XSLTElementDef xslApplyTemplates = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL,
"apply-templates", null /*alias */,
new XSLTElementDef[]{ xslSort,
xslWithParam } /* elements */, new XSLTAttributeDef[]{
selectAttrDefNode,
modeAttr },
new ProcessorTemplateElem(),
ElemApplyTemplates.class /* class object */, 20, true);
XSLTElementDef xslApplyImports =
new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "apply-imports",
null /*alias */, null /* elements */,
new XSLTAttributeDef[]{},
new ProcessorTemplateElem(),
ElemApplyImport.class /* class object */);
XSLTElementDef xslForEach = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "for-each",
null /*alias */, templateElementsAndSort, // (#PCDATA %instructions; %result-elements; | xsl:sort)*
new XSLTAttributeDef[]{ selectAttrRequired,
spaceAttr },
new ProcessorTemplateElem(),
ElemForEach.class /* class object */, true, false, true, 20, true);
XSLTElementDef xslIf = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL,
"if", null /*alias */,
templateElements /* elements */, // %template;
new XSLTAttributeDef[]{
testAttrRequired,
spaceAttr }, new ProcessorTemplateElem(),
ElemIf.class /* class object */, 20, true);
XSLTElementDef xslWhen =
new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "when",
null /*alias */, templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{
testAttrRequired,
spaceAttr }, new ProcessorTemplateElem(),
ElemWhen.class /* class object */,
false, true, 1, true);
XSLTElementDef xslOtherwise = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "otherwise",
null /*alias */,
templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{ spaceAttr },
new ProcessorTemplateElem(),
ElemOtherwise.class /* class object */,
false, false, 2, false);
XSLTElementDef xslChoose = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "choose",
null /*alias */,
new XSLTElementDef[]{ xslWhen,
xslOtherwise } /* elements */,
new XSLTAttributeDef[]{ spaceAttr },
new ProcessorTemplateElem(),
ElemChoose.class /* class object */, true, false, true, 20, true);
XSLTElementDef xslAttribute = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "attribute",
null /*alias */,
charTemplateElements /* elements */, // %char-template;>
new XSLTAttributeDef[]{ nameAVTRequired,
namespaceAVTOpt,
spaceAttr },
new ProcessorTemplateElem(),
ElemAttribute.class /* class object */, 20, true);
XSLTElementDef xslCallTemplate =
new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "call-template",
null /*alias */,
new XSLTElementDef[]{ xslWithParam } /* elements */,
new XSLTAttributeDef[]{ nameAttrRequired },
new ProcessorTemplateElem(),
ElemCallTemplate.class /* class object */, 20, true);
XSLTElementDef xslVariable = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "variable",
null /*alias */,
templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{ nameAttrRequired,
selectAttrOpt },
new ProcessorTemplateElem(),
ElemVariable.class /* class object */, 20, true);
XSLTElementDef xslParam = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "param",
null /*alias */,
templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{ nameAttrRequired,
selectAttrOpt },
new ProcessorTemplateElem(),
ElemParam.class /* class object */, 19, true);
XSLTElementDef xslText =
new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "text",
null /*alias */,
new XSLTElementDef[]{ charData } /* elements */,
new XSLTAttributeDef[]{ disableOutputEscapingAttr },
new ProcessorText(),
ElemText.class /* class object */, 20, true);
XSLTElementDef xslProcessingInstruction =
new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL,
"processing-instruction", null /*alias */,
charTemplateElements /* elements */, // %char-template;>
new XSLTAttributeDef[]{
nameAVT_NCNAMERequired,
spaceAttr },
new ProcessorTemplateElem(),
ElemPI.class /* class object */, 20, true);
XSLTElementDef xslElement = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "element",
null /*alias */,
templateElements /* elements */, // %template;
new XSLTAttributeDef[]{ nameAVTRequired,
namespaceAVTOpt,
useAttributeSetsAttr,
spaceAttr },
new ProcessorTemplateElem(),
ElemElement.class /* class object */, 20, true);
XSLTElementDef xslComment = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "comment",
null /*alias */,
charTemplateElements /* elements */, // %char-template;>
new XSLTAttributeDef[]{ spaceAttr },
new ProcessorTemplateElem(),
ElemComment.class /* class object */, 20, true);
XSLTElementDef xslCopy =
new XSLTElementDef(this, Constants.S_XSLNAMESPACEURL, "copy",
null /*alias */, templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{
spaceAttr,
useAttributeSetsAttr },
new ProcessorTemplateElem(),
ElemCopy.class /* class object */, 20, true);
XSLTElementDef xslMessage = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "message",
null /*alias */,
templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{ terminateAttr },
new ProcessorTemplateElem(),
ElemMessage.class /* class object */, 20, true);
XSLTElementDef xslFallback = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "fallback",
null /*alias */,
templateElements /* elements */, // %template;>
new XSLTAttributeDef[]{ spaceAttr },
new ProcessorTemplateElem(),
ElemFallback.class /* class object */, 20, true);
//exslt
XSLTElementDef exsltFunction =
new XSLTElementDef(this,
Constants.S_EXSLT_FUNCTIONS_URL,
"function",
null /*alias */,
exsltFunctionElements /* elements */,
new XSLTAttributeDef[]{ nameAttrRequired },
new ProcessorExsltFunction(),
ElemExsltFunction.class /* class object */);
XSLTElementDef exsltResult =
new XSLTElementDef(this,
Constants.S_EXSLT_FUNCTIONS_URL,
"result",
null /*alias */,
templateElements /* elements */,
new XSLTAttributeDef[]{ selectAttrOpt },
new ProcessorExsltFuncResult(),
ElemExsltFuncResult.class /* class object */);
int i = 0;
templateElements[i++] = charData; // #PCDATA
// char-instructions
templateElements[i++] = xslApplyTemplates;
templateElements[i++] = xslCallTemplate;
templateElements[i++] = xslApplyImports;
templateElements[i++] = xslForEach;
templateElements[i++] = xslValueOf;
templateElements[i++] = xslCopyOf;
templateElements[i++] = xslNumber;
templateElements[i++] = xslChoose;
templateElements[i++] = xslIf;
templateElements[i++] = xslText;
templateElements[i++] = xslCopy;
templateElements[i++] = xslVariable;
templateElements[i++] = xslMessage;
templateElements[i++] = xslFallback;
// instructions
templateElements[i++] = xslProcessingInstruction;
templateElements[i++] = xslComment;
templateElements[i++] = xslElement;
templateElements[i++] = xslAttribute;
templateElements[i++] = resultElement;
templateElements[i++] = unknownElement;
templateElements[i++] = exsltFunction;
templateElements[i++] = exsltResult;
System.arraycopy(templateElements, 0, templateElementsAndParams, 0, i);
System.arraycopy(templateElements, 0, templateElementsAndSort, 0, i);
System.arraycopy(templateElements, 0, exsltFunctionElements, 0, i);
templateElementsAndParams[i] = xslParam;
templateElementsAndSort[i] = xslSort;
exsltFunctionElements[i] = xslParam;
i = 0;
charTemplateElements[i++] = charData; // #PCDATA
// char-instructions
charTemplateElements[i++] = xslApplyTemplates;
charTemplateElements[i++] = xslCallTemplate;
charTemplateElements[i++] = xslApplyImports;
charTemplateElements[i++] = xslForEach;
charTemplateElements[i++] = xslValueOf;
charTemplateElements[i++] = xslCopyOf;
charTemplateElements[i++] = xslNumber;
charTemplateElements[i++] = xslChoose;
charTemplateElements[i++] = xslIf;
charTemplateElements[i++] = xslText;
charTemplateElements[i++] = xslCopy;
charTemplateElements[i++] = xslVariable;
charTemplateElements[i++] = xslMessage;
charTemplateElements[i++] = xslFallback;
XSLTElementDef importDef = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "import",
null /*alias */, null /* elements */,
new XSLTAttributeDef[]{ hrefAttr }, // EMPTY
new ProcessorImport(),
null /* class object */,
1, true);
XSLTElementDef includeDef = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL, "include",
null /*alias */, null /* elements */, // EMPTY
new XSLTAttributeDef[]{ hrefAttr },
new ProcessorInclude(),
null /* class object */,
20, true);
XSLTAttributeDef[] scriptAttrs = new XSLTAttributeDef[]{
new XSLTAttributeDef(null, "lang", XSLTAttributeDef.T_NMTOKEN,
true, false,XSLTAttributeDef.WARNING),
new XSLTAttributeDef(null, "src", XSLTAttributeDef.T_URL,
false, false,XSLTAttributeDef.WARNING)};
XSLTAttributeDef[] componentAttrs = new XSLTAttributeDef[]{
new XSLTAttributeDef(null, "prefix", XSLTAttributeDef.T_NMTOKEN,
true, false,XSLTAttributeDef.WARNING),
new XSLTAttributeDef(null, "elements", XSLTAttributeDef.T_STRINGLIST,
false, false,XSLTAttributeDef.WARNING),
new XSLTAttributeDef(null, "functions", XSLTAttributeDef.T_STRINGLIST,
false, false,XSLTAttributeDef.WARNING) };
XSLTElementDef[] topLevelElements = new XSLTElementDef[]
{includeDef,
importDef,
// resultElement,
whiteSpaceOnly,
unknownElement,
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"strip-space",
null /*alias */,
null /* elements */,
new XSLTAttributeDef[]{
elementsAttr },
new ProcessorStripSpace(),
null /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"preserve-space",
null /*alias */,
null /* elements */,
new XSLTAttributeDef[]{
elementsAttr },
new ProcessorPreserveSpace(),
null /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"output",
null /*alias */,
null /* elements */,
new XSLTAttributeDef[]{
methodAttr,
versionAttr,
encodingAttr,
omitXmlDeclarationAttr,
standaloneAttr,
doctypePublicAttr,
doctypeSystemAttr,
cdataSectionElementsAttr,
indentAttr,
mediaTypeAttr,
XSLTAttributeDef.m_foreignAttr },
new ProcessorOutputElem(), null /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"key",
null /*alias */,
null /* elements */, // EMPTY
new XSLTAttributeDef[]{ nameAttrRequired,
matchAttrRequired,
useAttr },
new ProcessorKey(), null /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"decimal-format",
null /*alias */,
null /* elements */, // EMPTY
new XSLTAttributeDef[]{
nameAttrOpt_ERROR,
decimalSeparatorAttr,
groupingSeparatorAttr,
infinityAttr,
minusSignAttr,
NaNAttr,
percentAttr,
perMilleAttr,
zeroDigitAttr,
digitAttr,
patternSeparatorAttr },
new ProcessorDecimalFormat(),
null /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"attribute-set",
null /*alias */,
new XSLTElementDef[]{
xslAttribute } /* elements */,
new XSLTAttributeDef[]{
nameAttrRequired,
useAttributeSetsAttr },
new ProcessorAttributeSet(),
null /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"variable",
null /*alias */,
templateElements /* elements */,
new XSLTAttributeDef[]{
nameAttrRequired,
selectAttrOpt },
new ProcessorGlobalVariableDecl(),
ElemVariable.class /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"param",
null /*alias */,
templateElements /* elements */,
new XSLTAttributeDef[]{
nameAttrRequired,
selectAttrOpt },
new ProcessorGlobalParamDecl(),
ElemParam.class /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"template",
null /*alias */,
templateElementsAndParams /* elements */,
new XSLTAttributeDef[]{
matchAttrOpt,
nameAttrOpt_ERROR,
priorityAttr,
modeAttr,
spaceAttr },
new ProcessorTemplate(), ElemTemplate.class /* class object */, true, 20, true),
new XSLTElementDef(
this,
Constants.S_XSLNAMESPACEURL,
"namespace-alias",
null /*alias */,
null /* elements */, // EMPTY
new XSLTAttributeDef[]{
stylesheetPrefixAttr,
resultPrefixAttr },
new ProcessorNamespaceAlias(), null /* class object */, 20, true),
new XSLTElementDef(
this,
Constants.S_BUILTIN_EXTENSIONS_URL,
"component",
null /*alias */,
new XSLTElementDef[]{
new XSLTElementDef(
this,
Constants.S_BUILTIN_EXTENSIONS_URL,
"script",
null /*alias */,
new XSLTElementDef[]{
charData } /* elements */,
scriptAttrs,
new ProcessorLRE(),
ElemExtensionScript.class /* class object */, 20, true) }, // EMPTY
componentAttrs,
new ProcessorLRE(), ElemExtensionDecl.class /* class object */),
new XSLTElementDef(
this,
Constants.S_BUILTIN_OLD_EXTENSIONS_URL,
"component",
null /*alias */,
new XSLTElementDef[]{
new XSLTElementDef(
this,
Constants.S_BUILTIN_OLD_EXTENSIONS_URL,
"script",
null /*alias */,
new XSLTElementDef[]{
charData } /* elements */,
scriptAttrs,
new ProcessorLRE(),
ElemExtensionScript.class /* class object */, 20, true) }, // EMPTY
componentAttrs,
new ProcessorLRE(), ElemExtensionDecl.class /* class object */),
exsltFunction}/* exslt */; //end of topevelElements
XSLTAttributeDef excludeResultPrefixesAttr =
new XSLTAttributeDef(null, "exclude-result-prefixes",
XSLTAttributeDef.T_PREFIXLIST, false,false,XSLTAttributeDef.WARNING);
XSLTAttributeDef extensionElementPrefixesAttr =
new XSLTAttributeDef(null, "extension-element-prefixes",
XSLTAttributeDef.T_PREFIX_URLLIST, false,false,XSLTAttributeDef.WARNING);
XSLTAttributeDef idAttr = new XSLTAttributeDef(null, "id",
XSLTAttributeDef.T_CDATA, false,false,XSLTAttributeDef.WARNING);
XSLTAttributeDef versionAttrRequired = new XSLTAttributeDef(null,
"version",
XSLTAttributeDef.T_NMTOKEN,
true,false,XSLTAttributeDef.WARNING);
XSLTElementDef stylesheetElemDef = new XSLTElementDef(this,
Constants.S_XSLNAMESPACEURL,
"stylesheet", "transform",
topLevelElements,
new XSLTAttributeDef[]{
extensionElementPrefixesAttr,
excludeResultPrefixesAttr,
idAttr,
versionAttrRequired,
spaceAttr }, new ProcessorStylesheetElement(), /* ContentHandler */
null /* class object */,
true, -1, false);
importDef.setElements(new XSLTElementDef[]{ stylesheetElemDef,
resultElement,
unknownElement });
includeDef.setElements(new XSLTElementDef[]{ stylesheetElemDef,
resultElement,
unknownElement });
build(null, null, null, new XSLTElementDef[]{ stylesheetElemDef,
whiteSpaceOnly,
resultElement,
unknownElement }, null,
new ProcessorStylesheetDoc(), /* ContentHandler */
null /* class object */
);
} | class class_name[name] begin[{]
method[build, return_type[void], modifier[default], parameter[]] begin[{]
local_variable[type[XSLTAttributeDef], hrefAttr]
local_variable[type[XSLTAttributeDef], elementsAttr]
local_variable[type[XSLTAttributeDef], methodAttr]
local_variable[type[XSLTAttributeDef], versionAttr]
local_variable[type[XSLTAttributeDef], encodingAttr]
local_variable[type[XSLTAttributeDef], omitXmlDeclarationAttr]
local_variable[type[XSLTAttributeDef], standaloneAttr]
local_variable[type[XSLTAttributeDef], doctypePublicAttr]
local_variable[type[XSLTAttributeDef], doctypeSystemAttr]
local_variable[type[XSLTAttributeDef], cdataSectionElementsAttr]
local_variable[type[XSLTAttributeDef], indentAttr]
local_variable[type[XSLTAttributeDef], mediaTypeAttr]
local_variable[type[XSLTAttributeDef], nameAttrRequired]
local_variable[type[XSLTAttributeDef], nameAVTRequired]
local_variable[type[XSLTAttributeDef], nameAVT_NCNAMERequired]
local_variable[type[XSLTAttributeDef], nameAttrOpt_ERROR]
local_variable[type[XSLTAttributeDef], useAttr]
local_variable[type[XSLTAttributeDef], namespaceAVTOpt]
local_variable[type[XSLTAttributeDef], decimalSeparatorAttr]
local_variable[type[XSLTAttributeDef], infinityAttr]
local_variable[type[XSLTAttributeDef], minusSignAttr]
local_variable[type[XSLTAttributeDef], NaNAttr]
local_variable[type[XSLTAttributeDef], percentAttr]
local_variable[type[XSLTAttributeDef], perMilleAttr]
local_variable[type[XSLTAttributeDef], zeroDigitAttr]
local_variable[type[XSLTAttributeDef], digitAttr]
local_variable[type[XSLTAttributeDef], patternSeparatorAttr]
local_variable[type[XSLTAttributeDef], groupingSeparatorAttr]
local_variable[type[XSLTAttributeDef], useAttributeSetsAttr]
local_variable[type[XSLTAttributeDef], testAttrRequired]
local_variable[type[XSLTAttributeDef], selectAttrRequired]
local_variable[type[XSLTAttributeDef], selectAttrOpt]
local_variable[type[XSLTAttributeDef], selectAttrDefNode]
local_variable[type[XSLTAttributeDef], selectAttrDefDot]
local_variable[type[XSLTAttributeDef], matchAttrRequired]
local_variable[type[XSLTAttributeDef], matchAttrOpt]
local_variable[type[XSLTAttributeDef], priorityAttr]
local_variable[type[XSLTAttributeDef], modeAttr]
local_variable[type[XSLTAttributeDef], spaceAttr]
local_variable[type[XSLTAttributeDef], spaceAttrLiteral]
local_variable[type[XSLTAttributeDef], stylesheetPrefixAttr]
local_variable[type[XSLTAttributeDef], resultPrefixAttr]
local_variable[type[XSLTAttributeDef], disableOutputEscapingAttr]
local_variable[type[XSLTAttributeDef], levelAttr]
call[levelAttr.setDefault, parameter[literal["single"]]]
local_variable[type[XSLTAttributeDef], countAttr]
local_variable[type[XSLTAttributeDef], fromAttr]
local_variable[type[XSLTAttributeDef], valueAttr]
local_variable[type[XSLTAttributeDef], formatAttr]
call[formatAttr.setDefault, parameter[literal["1"]]]
local_variable[type[XSLTAttributeDef], langAttr]
local_variable[type[XSLTAttributeDef], letterValueAttr]
local_variable[type[XSLTAttributeDef], groupingSeparatorAVT]
local_variable[type[XSLTAttributeDef], groupingSizeAttr]
local_variable[type[XSLTAttributeDef], dataTypeAttr]
call[dataTypeAttr.setDefault, parameter[literal["text"]]]
local_variable[type[XSLTAttributeDef], orderAttr]
call[orderAttr.setDefault, parameter[literal["ascending"]]]
local_variable[type[XSLTAttributeDef], caseOrderAttr]
local_variable[type[XSLTAttributeDef], terminateAttr]
call[terminateAttr.setDefault, parameter[literal["no"]]]
local_variable[type[XSLTAttributeDef], xslExcludeResultPrefixesAttr]
local_variable[type[XSLTAttributeDef], xslExtensionElementPrefixesAttr]
local_variable[type[XSLTAttributeDef], xslUseAttributeSetsAttr]
local_variable[type[XSLTAttributeDef], xslVersionAttr]
local_variable[type[XSLTElementDef], charData]
call[charData.setType, parameter[member[XSLTElementDef.T_PCDATA]]]
local_variable[type[XSLTElementDef], whiteSpaceOnly]
call[charData.setType, parameter[member[XSLTElementDef.T_PCDATA]]]
local_variable[type[XSLTAttributeDef], resultAttr]
local_variable[type[XSLTAttributeDef], xslResultAttr]
local_variable[type[XSLTElementDef], templateElements]
local_variable[type[XSLTElementDef], templateElementsAndParams]
local_variable[type[XSLTElementDef], templateElementsAndSort]
local_variable[type[XSLTElementDef], exsltFunctionElements]
local_variable[type[XSLTElementDef], charTemplateElements]
local_variable[type[XSLTElementDef], resultElement]
local_variable[type[XSLTElementDef], unknownElement]
local_variable[type[XSLTElementDef], xslValueOf]
local_variable[type[XSLTElementDef], xslCopyOf]
local_variable[type[XSLTElementDef], xslNumber]
local_variable[type[XSLTElementDef], xslSort]
local_variable[type[XSLTElementDef], xslWithParam]
local_variable[type[XSLTElementDef], xslApplyTemplates]
local_variable[type[XSLTElementDef], xslApplyImports]
local_variable[type[XSLTElementDef], xslForEach]
local_variable[type[XSLTElementDef], xslIf]
local_variable[type[XSLTElementDef], xslWhen]
local_variable[type[XSLTElementDef], xslOtherwise]
local_variable[type[XSLTElementDef], xslChoose]
local_variable[type[XSLTElementDef], xslAttribute]
local_variable[type[XSLTElementDef], xslCallTemplate]
local_variable[type[XSLTElementDef], xslVariable]
local_variable[type[XSLTElementDef], xslParam]
local_variable[type[XSLTElementDef], xslText]
local_variable[type[XSLTElementDef], xslProcessingInstruction]
local_variable[type[XSLTElementDef], xslElement]
local_variable[type[XSLTElementDef], xslComment]
local_variable[type[XSLTElementDef], xslCopy]
local_variable[type[XSLTElementDef], xslMessage]
local_variable[type[XSLTElementDef], xslFallback]
local_variable[type[XSLTElementDef], exsltFunction]
local_variable[type[XSLTElementDef], exsltResult]
local_variable[type[int], i]
assign[member[.templateElements], member[.charData]]
assign[member[.templateElements], member[.xslApplyTemplates]]
assign[member[.templateElements], member[.xslCallTemplate]]
assign[member[.templateElements], member[.xslApplyImports]]
assign[member[.templateElements], member[.xslForEach]]
assign[member[.templateElements], member[.xslValueOf]]
assign[member[.templateElements], member[.xslCopyOf]]
assign[member[.templateElements], member[.xslNumber]]
assign[member[.templateElements], member[.xslChoose]]
assign[member[.templateElements], member[.xslIf]]
assign[member[.templateElements], member[.xslText]]
assign[member[.templateElements], member[.xslCopy]]
assign[member[.templateElements], member[.xslVariable]]
assign[member[.templateElements], member[.xslMessage]]
assign[member[.templateElements], member[.xslFallback]]
assign[member[.templateElements], member[.xslProcessingInstruction]]
assign[member[.templateElements], member[.xslComment]]
assign[member[.templateElements], member[.xslElement]]
assign[member[.templateElements], member[.xslAttribute]]
assign[member[.templateElements], member[.resultElement]]
assign[member[.templateElements], member[.unknownElement]]
assign[member[.templateElements], member[.exsltFunction]]
assign[member[.templateElements], member[.exsltResult]]
call[System.arraycopy, parameter[member[.templateElements], literal[0], member[.templateElementsAndParams], literal[0], member[.i]]]
call[System.arraycopy, parameter[member[.templateElements], literal[0], member[.templateElementsAndSort], literal[0], member[.i]]]
call[System.arraycopy, parameter[member[.templateElements], literal[0], member[.exsltFunctionElements], literal[0], member[.i]]]
assign[member[.templateElementsAndParams], member[.xslParam]]
assign[member[.templateElementsAndSort], member[.xslSort]]
assign[member[.exsltFunctionElements], member[.xslParam]]
assign[member[.i], literal[0]]
assign[member[.charTemplateElements], member[.charData]]
assign[member[.charTemplateElements], member[.xslApplyTemplates]]
assign[member[.charTemplateElements], member[.xslCallTemplate]]
assign[member[.charTemplateElements], member[.xslApplyImports]]
assign[member[.charTemplateElements], member[.xslForEach]]
assign[member[.charTemplateElements], member[.xslValueOf]]
assign[member[.charTemplateElements], member[.xslCopyOf]]
assign[member[.charTemplateElements], member[.xslNumber]]
assign[member[.charTemplateElements], member[.xslChoose]]
assign[member[.charTemplateElements], member[.xslIf]]
assign[member[.charTemplateElements], member[.xslText]]
assign[member[.charTemplateElements], member[.xslCopy]]
assign[member[.charTemplateElements], member[.xslVariable]]
assign[member[.charTemplateElements], member[.xslMessage]]
assign[member[.charTemplateElements], member[.xslFallback]]
local_variable[type[XSLTElementDef], importDef]
local_variable[type[XSLTElementDef], includeDef]
local_variable[type[XSLTAttributeDef], scriptAttrs]
local_variable[type[XSLTAttributeDef], componentAttrs]
local_variable[type[XSLTElementDef], topLevelElements]
local_variable[type[XSLTAttributeDef], excludeResultPrefixesAttr]
local_variable[type[XSLTAttributeDef], extensionElementPrefixesAttr]
local_variable[type[XSLTAttributeDef], idAttr]
local_variable[type[XSLTAttributeDef], versionAttrRequired]
local_variable[type[XSLTElementDef], stylesheetElemDef]
call[importDef.setElements, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=stylesheetElemDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resultElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unknownElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XSLTElementDef, sub_type=None))]]
call[includeDef.setElements, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=stylesheetElemDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resultElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unknownElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XSLTElementDef, sub_type=None))]]
call[.build, parameter[literal[null], literal[null], literal[null], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=stylesheetElemDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=whiteSpaceOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resultElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unknownElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XSLTElementDef, sub_type=None)), literal[null], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProcessorStylesheetDoc, sub_type=None)), literal[null]]]
end[}]
END[}] | Keyword[void] identifier[build] operator[SEP] operator[SEP] {
identifier[XSLTAttributeDef] identifier[hrefAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_URL] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[elementsAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_SIMPLEPATTERNLIST] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[methodAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_QNAME] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[versionAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NMTOKEN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[encodingAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[omitXmlDeclarationAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_YESNO] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[standaloneAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_YESNO] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[doctypePublicAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[doctypeSystemAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[cdataSectionElementsAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_QNAMES_RESOLVE_NULL] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[indentAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_YESNO] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[mediaTypeAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[nameAttrRequired] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_QNAME] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[nameAVTRequired] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_AVT_QNAME] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[nameAVT_NCNAMERequired] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NCNAME] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[nameAttrOpt_ERROR] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_QNAME] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[useAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_EXPR] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[namespaceAVTOpt] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_URL] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[decimalSeparatorAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[infinityAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[minusSignAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[NaNAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[percentAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[perMilleAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[zeroDigitAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[digitAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[patternSeparatorAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[groupingSeparatorAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[useAttributeSetsAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_QNAMES] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[testAttrRequired] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_EXPR] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[selectAttrRequired] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_EXPR] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[selectAttrOpt] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_EXPR] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[selectAttrDefNode] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_EXPR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[selectAttrDefDot] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_EXPR] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[matchAttrRequired] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PATTERN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[matchAttrOpt] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PATTERN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[priorityAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NUMBER] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[modeAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_QNAME] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[spaceAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] identifier[Constants] operator[SEP] identifier[S_XMLNAMESPACEURI] , literal[String] , literal[boolean] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] , literal[String] , identifier[Constants] operator[SEP] identifier[ATTRVAL_STRIP] , literal[String] , identifier[Constants] operator[SEP] identifier[ATTRVAL_PRESERVE] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[spaceAttrLiteral] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] identifier[Constants] operator[SEP] identifier[S_XMLNAMESPACEURI] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_URL] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[stylesheetPrefixAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[resultPrefixAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[disableOutputEscapingAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_YESNO] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[levelAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , literal[boolean] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] , identifier[Constants] operator[SEP] identifier[NUMBERLEVEL_SINGLE] , literal[String] , identifier[Constants] operator[SEP] identifier[NUMBERLEVEL_MULTI] , literal[String] , identifier[Constants] operator[SEP] identifier[NUMBERLEVEL_ANY] operator[SEP] operator[SEP] identifier[levelAttr] operator[SEP] identifier[setDefault] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[countAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PATTERN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[fromAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PATTERN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[valueAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_EXPR] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[formatAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[formatAttr] operator[SEP] identifier[setDefault] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[langAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NMTOKEN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[letterValueAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , literal[boolean] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] , identifier[Constants] operator[SEP] identifier[NUMBERLETTER_ALPHABETIC] , literal[String] , identifier[Constants] operator[SEP] identifier[NUMBERLETTER_TRADITIONAL] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[groupingSeparatorAVT] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CHAR] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[groupingSizeAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NUMBER] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[dataTypeAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , literal[boolean] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] , identifier[Constants] operator[SEP] identifier[SORTDATATYPE_TEXT] , literal[String] , identifier[Constants] operator[SEP] identifier[SORTDATATYPE_TEXT] operator[SEP] operator[SEP] identifier[dataTypeAttr] operator[SEP] identifier[setDefault] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[orderAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , literal[boolean] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] , identifier[Constants] operator[SEP] identifier[SORTORDER_ASCENDING] , literal[String] , identifier[Constants] operator[SEP] identifier[SORTORDER_DESCENDING] operator[SEP] operator[SEP] identifier[orderAttr] operator[SEP] identifier[setDefault] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[caseOrderAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , literal[boolean] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] , literal[String] , identifier[Constants] operator[SEP] identifier[SORTCASEORDER_UPPERFIRST] , literal[String] , identifier[Constants] operator[SEP] identifier[SORTCASEORDER_LOWERFIRST] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[terminateAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_YESNO] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[terminateAttr] operator[SEP] identifier[setDefault] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[xslExcludeResultPrefixesAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PREFIXLIST] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[xslExtensionElementPrefixesAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PREFIX_URLLIST] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[xslUseAttributeSetsAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_QNAMES] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[xslVersionAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NMTOKEN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[charData] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , Other[null] , literal[String] , Other[null] , Other[null] , Other[null] , Keyword[new] identifier[ProcessorCharacters] operator[SEP] operator[SEP] , identifier[ElemTextLiteral] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[charData] operator[SEP] identifier[setType] operator[SEP] identifier[XSLTElementDef] operator[SEP] identifier[T_PCDATA] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[whiteSpaceOnly] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , Other[null] , literal[String] , Other[null] , Other[null] , Other[null] , Other[null] , identifier[ElemTextLiteral] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[charData] operator[SEP] identifier[setType] operator[SEP] identifier[XSLTElementDef] operator[SEP] identifier[T_PCDATA] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[resultAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_AVT] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[xslResultAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTElementDef] operator[SEP] operator[SEP] identifier[templateElements] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Other[23] operator[SEP] operator[SEP] identifier[XSLTElementDef] operator[SEP] operator[SEP] identifier[templateElementsAndParams] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Other[24] operator[SEP] operator[SEP] identifier[XSLTElementDef] operator[SEP] operator[SEP] identifier[templateElementsAndSort] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Other[24] operator[SEP] operator[SEP] identifier[XSLTElementDef] operator[SEP] operator[SEP] identifier[exsltFunctionElements] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Other[24] operator[SEP] operator[SEP] identifier[XSLTElementDef] operator[SEP] operator[SEP] identifier[charTemplateElements] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Other[15] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[resultElement] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , Other[null] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[spaceAttrLiteral] , identifier[xslExcludeResultPrefixesAttr] , identifier[xslExtensionElementPrefixesAttr] , identifier[xslUseAttributeSetsAttr] , identifier[xslVersionAttr] , identifier[xslResultAttr] , identifier[resultAttr]
} , Keyword[new] identifier[ProcessorLRE] operator[SEP] operator[SEP] , identifier[ElemLiteralResult] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[unknownElement] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , literal[String] , literal[String] , Other[null] , identifier[templateElementsAndParams] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[xslExcludeResultPrefixesAttr] , identifier[xslExtensionElementPrefixesAttr] , identifier[xslUseAttributeSetsAttr] , identifier[xslVersionAttr] , identifier[xslResultAttr] , identifier[resultAttr]
} , Keyword[new] identifier[ProcessorUnknown] operator[SEP] operator[SEP] , identifier[ElemUnknown] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslValueOf] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[selectAttrRequired] , identifier[disableOutputEscapingAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemValueOf] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslCopyOf] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[selectAttrRequired]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemCopyOf] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslNumber] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[levelAttr] , identifier[countAttr] , identifier[fromAttr] , identifier[valueAttr] , identifier[formatAttr] , identifier[langAttr] , identifier[letterValueAttr] , identifier[groupingSeparatorAVT] , identifier[groupingSizeAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemNumber] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslSort] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[selectAttrDefDot] , identifier[langAttr] , identifier[dataTypeAttr] , identifier[orderAttr] , identifier[caseOrderAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemSort] operator[SEP] Keyword[class] , Other[19] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslWithParam] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired] , identifier[selectAttrOpt]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemWithParam] operator[SEP] Keyword[class] , Other[19] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslApplyTemplates] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[xslSort] , identifier[xslWithParam]
} , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[selectAttrDefNode] , identifier[modeAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemApplyTemplates] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslApplyImports] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemApplyImport] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslForEach] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElementsAndSort] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[selectAttrRequired] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemForEach] operator[SEP] Keyword[class] , literal[boolean] , literal[boolean] , literal[boolean] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslIf] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[testAttrRequired] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemIf] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslWhen] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[testAttrRequired] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemWhen] operator[SEP] Keyword[class] , literal[boolean] , literal[boolean] , Other[1] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslOtherwise] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemOtherwise] operator[SEP] Keyword[class] , literal[boolean] , literal[boolean] , Other[2] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslChoose] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[xslWhen] , identifier[xslOtherwise]
} , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemChoose] operator[SEP] Keyword[class] , literal[boolean] , literal[boolean] , literal[boolean] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslAttribute] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[charTemplateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAVTRequired] , identifier[namespaceAVTOpt] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemAttribute] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslCallTemplate] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[xslWithParam]
} , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemCallTemplate] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslVariable] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired] , identifier[selectAttrOpt]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemVariable] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslParam] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired] , identifier[selectAttrOpt]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemParam] operator[SEP] Keyword[class] , Other[19] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslText] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[charData]
} , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[disableOutputEscapingAttr]
} , Keyword[new] identifier[ProcessorText] operator[SEP] operator[SEP] , identifier[ElemText] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslProcessingInstruction] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[charTemplateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAVT_NCNAMERequired] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemPI] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslElement] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAVTRequired] , identifier[namespaceAVTOpt] , identifier[useAttributeSetsAttr] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemElement] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslComment] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[charTemplateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemComment] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslCopy] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[spaceAttr] , identifier[useAttributeSetsAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemCopy] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslMessage] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[terminateAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemMessage] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[xslFallback] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplateElem] operator[SEP] operator[SEP] , identifier[ElemFallback] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[exsltFunction] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_EXSLT_FUNCTIONS_URL] , literal[String] , Other[null] , identifier[exsltFunctionElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired]
} , Keyword[new] identifier[ProcessorExsltFunction] operator[SEP] operator[SEP] , identifier[ElemExsltFunction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[exsltResult] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_EXSLT_FUNCTIONS_URL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[selectAttrOpt]
} , Keyword[new] identifier[ProcessorExsltFuncResult] operator[SEP] operator[SEP] , identifier[ElemExsltFuncResult] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[charData] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslApplyTemplates] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslCallTemplate] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslApplyImports] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslForEach] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslValueOf] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslCopyOf] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslNumber] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslChoose] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslIf] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslText] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslCopy] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslVariable] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslMessage] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslFallback] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslProcessingInstruction] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslComment] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslElement] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslAttribute] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[resultElement] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[unknownElement] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[exsltFunction] operator[SEP] identifier[templateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[exsltResult] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[templateElements] , Other[0] , identifier[templateElementsAndParams] , Other[0] , identifier[i] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[templateElements] , Other[0] , identifier[templateElementsAndSort] , Other[0] , identifier[i] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[templateElements] , Other[0] , identifier[exsltFunctionElements] , Other[0] , identifier[i] operator[SEP] operator[SEP] identifier[templateElementsAndParams] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[xslParam] operator[SEP] identifier[templateElementsAndSort] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[xslSort] operator[SEP] identifier[exsltFunctionElements] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[xslParam] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[charData] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslApplyTemplates] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslCallTemplate] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslApplyImports] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslForEach] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslValueOf] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslCopyOf] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslNumber] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslChoose] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslIf] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslText] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslCopy] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslVariable] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslMessage] operator[SEP] identifier[charTemplateElements] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[xslFallback] operator[SEP] identifier[XSLTElementDef] identifier[importDef] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[hrefAttr]
} , Keyword[new] identifier[ProcessorImport] operator[SEP] operator[SEP] , Other[null] , Other[1] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[includeDef] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[hrefAttr]
} , Keyword[new] identifier[ProcessorInclude] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] identifier[scriptAttrs] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NMTOKEN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_URL] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP]
} operator[SEP] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] identifier[componentAttrs] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NMTOKEN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_STRINGLIST] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_STRINGLIST] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP]
} operator[SEP] identifier[XSLTElementDef] operator[SEP] operator[SEP] identifier[topLevelElements] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[includeDef] , identifier[importDef] , identifier[whiteSpaceOnly] , identifier[unknownElement] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[elementsAttr]
} , Keyword[new] identifier[ProcessorStripSpace] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[elementsAttr]
} , Keyword[new] identifier[ProcessorPreserveSpace] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[methodAttr] , identifier[versionAttr] , identifier[encodingAttr] , identifier[omitXmlDeclarationAttr] , identifier[standaloneAttr] , identifier[doctypePublicAttr] , identifier[doctypeSystemAttr] , identifier[cdataSectionElementsAttr] , identifier[indentAttr] , identifier[mediaTypeAttr] , identifier[XSLTAttributeDef] operator[SEP] identifier[m_foreignAttr]
} , Keyword[new] identifier[ProcessorOutputElem] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired] , identifier[matchAttrRequired] , identifier[useAttr]
} , Keyword[new] identifier[ProcessorKey] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrOpt_ERROR] , identifier[decimalSeparatorAttr] , identifier[groupingSeparatorAttr] , identifier[infinityAttr] , identifier[minusSignAttr] , identifier[NaNAttr] , identifier[percentAttr] , identifier[perMilleAttr] , identifier[zeroDigitAttr] , identifier[digitAttr] , identifier[patternSeparatorAttr]
} , Keyword[new] identifier[ProcessorDecimalFormat] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[xslAttribute]
} , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired] , identifier[useAttributeSetsAttr]
} , Keyword[new] identifier[ProcessorAttributeSet] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired] , identifier[selectAttrOpt]
} , Keyword[new] identifier[ProcessorGlobalVariableDecl] operator[SEP] operator[SEP] , identifier[ElemVariable] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[nameAttrRequired] , identifier[selectAttrOpt]
} , Keyword[new] identifier[ProcessorGlobalParamDecl] operator[SEP] operator[SEP] , identifier[ElemParam] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , identifier[templateElementsAndParams] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[matchAttrOpt] , identifier[nameAttrOpt_ERROR] , identifier[priorityAttr] , identifier[modeAttr] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorTemplate] operator[SEP] operator[SEP] , identifier[ElemTemplate] operator[SEP] Keyword[class] , literal[boolean] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , Other[null] , Other[null] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[stylesheetPrefixAttr] , identifier[resultPrefixAttr]
} , Keyword[new] identifier[ProcessorNamespaceAlias] operator[SEP] operator[SEP] , Other[null] , Other[20] , literal[boolean] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_BUILTIN_EXTENSIONS_URL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_BUILTIN_EXTENSIONS_URL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[charData]
} , identifier[scriptAttrs] , Keyword[new] identifier[ProcessorLRE] operator[SEP] operator[SEP] , identifier[ElemExtensionScript] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP]
} , identifier[componentAttrs] , Keyword[new] identifier[ProcessorLRE] operator[SEP] operator[SEP] , identifier[ElemExtensionDecl] operator[SEP] Keyword[class] operator[SEP] , Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_BUILTIN_OLD_EXTENSIONS_URL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_BUILTIN_OLD_EXTENSIONS_URL] , literal[String] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[charData]
} , identifier[scriptAttrs] , Keyword[new] identifier[ProcessorLRE] operator[SEP] operator[SEP] , identifier[ElemExtensionScript] operator[SEP] Keyword[class] , Other[20] , literal[boolean] operator[SEP]
} , identifier[componentAttrs] , Keyword[new] identifier[ProcessorLRE] operator[SEP] operator[SEP] , identifier[ElemExtensionDecl] operator[SEP] Keyword[class] operator[SEP] , identifier[exsltFunction]
} operator[SEP] identifier[XSLTAttributeDef] identifier[excludeResultPrefixesAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PREFIXLIST] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[extensionElementPrefixesAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_PREFIX_URLLIST] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[idAttr] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_CDATA] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTAttributeDef] identifier[versionAttrRequired] operator[=] Keyword[new] identifier[XSLTAttributeDef] operator[SEP] Other[null] , literal[String] , identifier[XSLTAttributeDef] operator[SEP] identifier[T_NMTOKEN] , literal[boolean] , literal[boolean] , identifier[XSLTAttributeDef] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[XSLTElementDef] identifier[stylesheetElemDef] operator[=] Keyword[new] identifier[XSLTElementDef] operator[SEP] Keyword[this] , identifier[Constants] operator[SEP] identifier[S_XSLNAMESPACEURL] , literal[String] , literal[String] , identifier[topLevelElements] , Keyword[new] identifier[XSLTAttributeDef] operator[SEP] operator[SEP] {
identifier[extensionElementPrefixesAttr] , identifier[excludeResultPrefixesAttr] , identifier[idAttr] , identifier[versionAttrRequired] , identifier[spaceAttr]
} , Keyword[new] identifier[ProcessorStylesheetElement] operator[SEP] operator[SEP] , Other[null] , literal[boolean] , operator[-] Other[1] , literal[boolean] operator[SEP] operator[SEP] identifier[importDef] operator[SEP] identifier[setElements] operator[SEP] Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[stylesheetElemDef] , identifier[resultElement] , identifier[unknownElement]
} operator[SEP] operator[SEP] identifier[includeDef] operator[SEP] identifier[setElements] operator[SEP] Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[stylesheetElemDef] , identifier[resultElement] , identifier[unknownElement]
} operator[SEP] operator[SEP] identifier[build] operator[SEP] Other[null] , Other[null] , Other[null] , Keyword[new] identifier[XSLTElementDef] operator[SEP] operator[SEP] {
identifier[stylesheetElemDef] , identifier[whiteSpaceOnly] , identifier[resultElement] , identifier[unknownElement]
} , Other[null] , Keyword[new] identifier[ProcessorStylesheetDoc] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP]
}
|
public static InputStream get(IO.Readable io, boolean closeAsync) {
if (io instanceof IOFromInputStream)
return ((IOFromInputStream)io).getInputStream();
if (io instanceof IO.Readable.Buffered)
return new BufferedToInputStream((IO.Readable.Buffered)io, closeAsync);
return new IOAsInputStream(io);
} | class class_name[name] begin[{]
method[get, return_type[type[InputStream]], modifier[public static], parameter[io, closeAsync]] begin[{]
if[binary_operation[member[.io], instanceof, type[IOFromInputStream]]] begin[{]
return[Cast(expression=MemberReference(member=io, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IOFromInputStream, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.io], instanceof, type[IO]]] begin[{]
return[ClassCreator(arguments=[Cast(expression=MemberReference(member=io, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IO, sub_type=ReferenceType(arguments=None, dimensions=None, name=Readable, sub_type=ReferenceType(arguments=None, dimensions=None, name=Buffered, sub_type=None)))), MemberReference(member=closeAsync, 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=BufferedToInputStream, sub_type=None))]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=io, 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=IOAsInputStream, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[InputStream] identifier[get] operator[SEP] identifier[IO] operator[SEP] identifier[Readable] identifier[io] , Keyword[boolean] identifier[closeAsync] operator[SEP] {
Keyword[if] operator[SEP] identifier[io] Keyword[instanceof] identifier[IOFromInputStream] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[IOFromInputStream] operator[SEP] identifier[io] operator[SEP] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[io] Keyword[instanceof] identifier[IO] operator[SEP] identifier[Readable] operator[SEP] identifier[Buffered] operator[SEP] Keyword[return] Keyword[new] identifier[BufferedToInputStream] operator[SEP] operator[SEP] identifier[IO] operator[SEP] identifier[Readable] operator[SEP] identifier[Buffered] operator[SEP] identifier[io] , identifier[closeAsync] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[IOAsInputStream] operator[SEP] identifier[io] operator[SEP] operator[SEP]
}
|
public Vec3 multiply(final Vec3 vec) {
return new Vec3(
m00 * vec.x + m10 * vec.y + m20 * vec.z,
m01 * vec.x + m11 * vec.y + m21 * vec.z,
m02 * vec.x + m12 * vec.y + m22 * vec.z
);
} | class class_name[name] begin[{]
method[multiply, return_type[type[Vec3]], modifier[public], parameter[vec]] begin[{]
return[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m00, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=m10, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=m20, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m01, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=m11, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=m21, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m02, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=m12, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=m22, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[]), operator=*), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Vec3, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Vec3] identifier[multiply] operator[SEP] Keyword[final] identifier[Vec3] identifier[vec] operator[SEP] {
Keyword[return] Keyword[new] identifier[Vec3] operator[SEP] identifier[m00] operator[*] identifier[vec] operator[SEP] identifier[x] operator[+] identifier[m10] operator[*] identifier[vec] operator[SEP] identifier[y] operator[+] identifier[m20] operator[*] identifier[vec] operator[SEP] identifier[z] , identifier[m01] operator[*] identifier[vec] operator[SEP] identifier[x] operator[+] identifier[m11] operator[*] identifier[vec] operator[SEP] identifier[y] operator[+] identifier[m21] operator[*] identifier[vec] operator[SEP] identifier[z] , identifier[m02] operator[*] identifier[vec] operator[SEP] identifier[x] operator[+] identifier[m12] operator[*] identifier[vec] operator[SEP] identifier[y] operator[+] identifier[m22] operator[*] identifier[vec] operator[SEP] identifier[z] operator[SEP] operator[SEP]
}
|
protected void renderEasyUIDataGrid(Class<? extends Model> modelClass) {
final Optional<DataGridReq> reqOptional = EuiDataGrid.req(getRequest());
if (reqOptional.isPresent()) {
renderJson(EuiDataGrid.rsp(reqOptional.get(), modelClass));
} else {
renderJson(EuiDataGrid.EMPTY_DATAGRID);
}
} | class class_name[name] begin[{]
method[renderEasyUIDataGrid, return_type[void], modifier[protected], parameter[modelClass]] begin[{]
local_variable[type[Optional], reqOptional]
if[call[reqOptional.isPresent, parameter[]]] begin[{]
call[.renderJson, parameter[call[EuiDataGrid.rsp, parameter[call[reqOptional.get, parameter[]], member[.modelClass]]]]]
else begin[{]
call[.renderJson, parameter[member[EuiDataGrid.EMPTY_DATAGRID]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[renderEasyUIDataGrid] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Model] operator[>] identifier[modelClass] operator[SEP] {
Keyword[final] identifier[Optional] operator[<] identifier[DataGridReq] operator[>] identifier[reqOptional] operator[=] identifier[EuiDataGrid] operator[SEP] identifier[req] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reqOptional] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[renderJson] operator[SEP] identifier[EuiDataGrid] operator[SEP] identifier[rsp] operator[SEP] identifier[reqOptional] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[modelClass] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[renderJson] operator[SEP] identifier[EuiDataGrid] operator[SEP] identifier[EMPTY_DATAGRID] operator[SEP] operator[SEP]
}
}
|
public Observable<ServiceResponse<ExpressRouteCircuitsRoutesTableListResultInner>> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (crossConnectionName == null) {
throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (devicePath == null) {
throw new IllegalArgumentException("Parameter devicePath is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2018-06-01";
Observable<Response<ResponseBody>> observable = service.listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<ExpressRouteCircuitsRoutesTableListResultInner>() { }.getType());
} | class class_name[name] begin[{]
method[listRoutesTableWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, crossConnectionName, peeringName, devicePath]] begin[{]
if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.crossConnectionName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter crossConnectionName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.peeringName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter peeringName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.devicePath], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter devicePath is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], apiVersion]
local_variable[type[Observable], observable]
return[call[client.getAzureClient, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ExpressRouteCircuitsRoutesTableListResultInner] operator[>] operator[>] identifier[listRoutesTableWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[crossConnectionName] , identifier[String] identifier[peeringName] , identifier[String] identifier[devicePath] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[crossConnectionName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[peeringName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[devicePath] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[apiVersion] operator[=] literal[String] operator[SEP] identifier[Observable] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] operator[>] identifier[observable] operator[=] identifier[service] operator[SEP] identifier[listRoutesTable] operator[SEP] identifier[resourceGroupName] , identifier[crossConnectionName] , identifier[peeringName] , identifier[devicePath] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[apiVersion] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[getAzureClient] operator[SEP] operator[SEP] operator[SEP] identifier[getPostOrDeleteResultAsync] operator[SEP] identifier[observable] , Keyword[new] identifier[TypeToken] operator[<] identifier[ExpressRouteCircuitsRoutesTableListResultInner] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public StateIdsBuilder append(final String stateToken, final int start, final int end) {
return doAppend(Collections.singletonList(new StateId(stateToken, start, end)));
} | class class_name[name] begin[{]
method[append, return_type[type[StateIdsBuilder]], modifier[public], parameter[stateToken, start, end]] begin[{]
return[call[.doAppend, parameter[call[Collections.singletonList, parameter[ClassCreator(arguments=[MemberReference(member=stateToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, 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=StateId, sub_type=None))]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[StateIdsBuilder] identifier[append] operator[SEP] Keyword[final] identifier[String] identifier[stateToken] , Keyword[final] Keyword[int] identifier[start] , Keyword[final] Keyword[int] identifier[end] operator[SEP] {
Keyword[return] identifier[doAppend] operator[SEP] identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] Keyword[new] identifier[StateId] operator[SEP] identifier[stateToken] , identifier[start] , identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected UserDetailsService userDetailsService() {
AuthenticationManagerBuilder globalAuthBuilder = context
.getBean(AuthenticationManagerBuilder.class);
return new UserDetailsServiceDelegator(Arrays.asList(
localConfigureAuthenticationBldr, globalAuthBuilder));
} | class class_name[name] begin[{]
method[userDetailsService, return_type[type[UserDetailsService]], modifier[protected], parameter[]] begin[{]
local_variable[type[AuthenticationManagerBuilder], globalAuthBuilder]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=localConfigureAuthenticationBldr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=globalAuthBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UserDetailsServiceDelegator, sub_type=None))]
end[}]
END[}] | Keyword[protected] identifier[UserDetailsService] identifier[userDetailsService] operator[SEP] operator[SEP] {
identifier[AuthenticationManagerBuilder] identifier[globalAuthBuilder] operator[=] identifier[context] operator[SEP] identifier[getBean] operator[SEP] identifier[AuthenticationManagerBuilder] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[UserDetailsServiceDelegator] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[localConfigureAuthenticationBldr] , identifier[globalAuthBuilder] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public char[] transformIn(String lvc) throws CpoException {
return lvc == null ? null : lvc.toCharArray();
} | class class_name[name] begin[{]
method[transformIn, return_type[type[char]], modifier[public], parameter[lvc]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lvc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=lvc, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[char] operator[SEP] operator[SEP] identifier[transformIn] operator[SEP] identifier[String] identifier[lvc] operator[SEP] Keyword[throws] identifier[CpoException] {
Keyword[return] identifier[lvc] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[lvc] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(HttpInstanceSummary httpInstanceSummary, ProtocolMarshaller protocolMarshaller) {
if (httpInstanceSummary == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(httpInstanceSummary.getInstanceId(), INSTANCEID_BINDING);
protocolMarshaller.marshall(httpInstanceSummary.getNamespaceName(), NAMESPACENAME_BINDING);
protocolMarshaller.marshall(httpInstanceSummary.getServiceName(), SERVICENAME_BINDING);
protocolMarshaller.marshall(httpInstanceSummary.getHealthStatus(), HEALTHSTATUS_BINDING);
protocolMarshaller.marshall(httpInstanceSummary.getAttributes(), ATTRIBUTES_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[httpInstanceSummary, protocolMarshaller]] begin[{]
if[binary_operation[member[.httpInstanceSummary], ==, 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=getInstanceId, postfix_operators=[], prefix_operators=[], qualifier=httpInstanceSummary, selectors=[], type_arguments=None), MemberReference(member=INSTANCEID_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=getNamespaceName, postfix_operators=[], prefix_operators=[], qualifier=httpInstanceSummary, selectors=[], type_arguments=None), MemberReference(member=NAMESPACENAME_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=getServiceName, postfix_operators=[], prefix_operators=[], qualifier=httpInstanceSummary, selectors=[], type_arguments=None), MemberReference(member=SERVICENAME_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=getHealthStatus, postfix_operators=[], prefix_operators=[], qualifier=httpInstanceSummary, selectors=[], type_arguments=None), MemberReference(member=HEALTHSTATUS_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=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=httpInstanceSummary, selectors=[], type_arguments=None), MemberReference(member=ATTRIBUTES_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[HttpInstanceSummary] identifier[httpInstanceSummary] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[httpInstanceSummary] 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[httpInstanceSummary] operator[SEP] identifier[getInstanceId] operator[SEP] operator[SEP] , identifier[INSTANCEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[httpInstanceSummary] operator[SEP] identifier[getNamespaceName] operator[SEP] operator[SEP] , identifier[NAMESPACENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[httpInstanceSummary] operator[SEP] identifier[getServiceName] operator[SEP] operator[SEP] , identifier[SERVICENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[httpInstanceSummary] operator[SEP] identifier[getHealthStatus] operator[SEP] operator[SEP] , identifier[HEALTHSTATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[httpInstanceSummary] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] , identifier[ATTRIBUTES_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private static synchronized Set<String> getCanonicalSystemLocationZIDs() {
Set<String> canonicalSystemLocationZones = null;
if (REF_CANONICAL_SYSTEM_LOCATION_ZONES != null) {
canonicalSystemLocationZones = REF_CANONICAL_SYSTEM_LOCATION_ZONES.get();
}
if (canonicalSystemLocationZones == null) {
Set<String> canonicalSystemLocationIDs = new TreeSet<String>();
String[] allIDs = getZoneIDs();
for (String id : allIDs) {
// exclude Etc/Unknown
if (id.equals(TimeZone.UNKNOWN_ZONE_ID)) {
continue;
}
String canonicalID = getCanonicalCLDRID(id);
if (id.equals(canonicalID)) {
String region = getRegion(id);
if (region != null && !region.equals(kWorld)) {
canonicalSystemLocationIDs.add(id);
}
}
}
canonicalSystemLocationZones = Collections.unmodifiableSet(canonicalSystemLocationIDs);
REF_CANONICAL_SYSTEM_LOCATION_ZONES = new SoftReference<Set<String>>(canonicalSystemLocationZones);
}
return canonicalSystemLocationZones;
} | class class_name[name] begin[{]
method[getCanonicalSystemLocationZIDs, return_type[type[Set]], modifier[synchronized private static], parameter[]] begin[{]
local_variable[type[Set], canonicalSystemLocationZones]
if[binary_operation[member[.REF_CANONICAL_SYSTEM_LOCATION_ZONES], !=, literal[null]]] begin[{]
assign[member[.canonicalSystemLocationZones], call[REF_CANONICAL_SYSTEM_LOCATION_ZONES.get, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[member[.canonicalSystemLocationZones], ==, literal[null]]] begin[{]
local_variable[type[Set], canonicalSystemLocationIDs]
local_variable[type[String], allIDs]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=UNKNOWN_ZONE_ID, postfix_operators=[], prefix_operators=[], qualifier=TimeZone, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCanonicalCLDRID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=canonicalID)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=canonicalID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), else_statement=None, 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=getRegion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=region)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=region, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=kWorld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=region, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=canonicalSystemLocationIDs, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=allIDs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
assign[member[.canonicalSystemLocationZones], call[Collections.unmodifiableSet, parameter[member[.canonicalSystemLocationIDs]]]]
assign[member[.REF_CANONICAL_SYSTEM_LOCATION_ZONES], ClassCreator(arguments=[MemberReference(member=canonicalSystemLocationZones, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=SoftReference, sub_type=None))]
else begin[{]
None
end[}]
return[member[.canonicalSystemLocationZones]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[synchronized] identifier[Set] operator[<] identifier[String] operator[>] identifier[getCanonicalSystemLocationZIDs] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[canonicalSystemLocationZones] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[REF_CANONICAL_SYSTEM_LOCATION_ZONES] operator[!=] Other[null] operator[SEP] {
identifier[canonicalSystemLocationZones] operator[=] identifier[REF_CANONICAL_SYSTEM_LOCATION_ZONES] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[canonicalSystemLocationZones] operator[==] Other[null] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[canonicalSystemLocationIDs] operator[=] Keyword[new] identifier[TreeSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[allIDs] operator[=] identifier[getZoneIDs] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[id] operator[:] identifier[allIDs] operator[SEP] {
Keyword[if] operator[SEP] identifier[id] operator[SEP] identifier[equals] operator[SEP] identifier[TimeZone] operator[SEP] identifier[UNKNOWN_ZONE_ID] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] identifier[canonicalID] operator[=] identifier[getCanonicalCLDRID] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[SEP] identifier[equals] operator[SEP] identifier[canonicalID] operator[SEP] operator[SEP] {
identifier[String] identifier[region] operator[=] identifier[getRegion] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[region] operator[!=] Other[null] operator[&&] operator[!] identifier[region] operator[SEP] identifier[equals] operator[SEP] identifier[kWorld] operator[SEP] operator[SEP] {
identifier[canonicalSystemLocationIDs] operator[SEP] identifier[add] operator[SEP] identifier[id] operator[SEP] operator[SEP]
}
}
}
identifier[canonicalSystemLocationZones] operator[=] identifier[Collections] operator[SEP] identifier[unmodifiableSet] operator[SEP] identifier[canonicalSystemLocationIDs] operator[SEP] operator[SEP] identifier[REF_CANONICAL_SYSTEM_LOCATION_ZONES] operator[=] Keyword[new] identifier[SoftReference] operator[<] identifier[Set] operator[<] identifier[String] operator[>] operator[>] operator[SEP] identifier[canonicalSystemLocationZones] operator[SEP] operator[SEP]
}
Keyword[return] identifier[canonicalSystemLocationZones] operator[SEP]
}
|
public static FloatBinding nextAfter(final float start, final ObservableFloatValue direction) {
return createFloatBinding(() -> Math.nextAfter(start, direction.get()), direction);
} | class class_name[name] begin[{]
method[nextAfter, return_type[type[FloatBinding]], modifier[public static], parameter[start, direction]] begin[{]
return[call[.createFloatBinding, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=direction, selectors=[], type_arguments=None)], member=nextAfter, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), parameters=[]), member[.direction]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[FloatBinding] identifier[nextAfter] operator[SEP] Keyword[final] Keyword[float] identifier[start] , Keyword[final] identifier[ObservableFloatValue] identifier[direction] operator[SEP] {
Keyword[return] identifier[createFloatBinding] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[Math] operator[SEP] identifier[nextAfter] operator[SEP] identifier[start] , identifier[direction] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] , identifier[direction] operator[SEP] operator[SEP]
}
|
public com.google.api.ads.admanager.axis.v201808.ProductMarketplaceInfo getProductMarketplaceInfo() {
return productMarketplaceInfo;
} | class class_name[name] begin[{]
method[getProductMarketplaceInfo, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.productMarketplaceInfo]]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[ProductMarketplaceInfo] identifier[getProductMarketplaceInfo] operator[SEP] operator[SEP] {
Keyword[return] identifier[productMarketplaceInfo] operator[SEP]
}
|
public void putBytes(ByteBuffer writeBuffer) {
if (writeBuffer.remaining() < CONNECTION_ID_LENGTH) {
throw new IllegalArgumentException("Could not add ConnectionHandle to byte buffer: not enough space.");
}
writeBuffer.putLong(this.connID);
writeBuffer.putInt(this.seqNum);
writeBuffer.put(this.connHandleCreatorId);
writeBuffer.put(this.myFlags);
writeBuffer.put(this.myType);
writeBuffer.put((byte) 0xFF); // place holder - empty flag
} | class class_name[name] begin[{]
method[putBytes, return_type[void], modifier[public], parameter[writeBuffer]] begin[{]
if[binary_operation[call[writeBuffer.remaining, parameter[]], <, member[.CONNECTION_ID_LENGTH]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not add ConnectionHandle to byte buffer: not enough space.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[writeBuffer.putLong, parameter[THIS[member[None.connID]]]]
call[writeBuffer.putInt, parameter[THIS[member[None.seqNum]]]]
call[writeBuffer.put, parameter[THIS[member[None.connHandleCreatorId]]]]
call[writeBuffer.put, parameter[THIS[member[None.myFlags]]]]
call[writeBuffer.put, parameter[THIS[member[None.myType]]]]
call[writeBuffer.put, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), type=BasicType(dimensions=[], name=byte))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[putBytes] operator[SEP] identifier[ByteBuffer] identifier[writeBuffer] operator[SEP] {
Keyword[if] operator[SEP] identifier[writeBuffer] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[<] identifier[CONNECTION_ID_LENGTH] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[writeBuffer] operator[SEP] identifier[putLong] operator[SEP] Keyword[this] operator[SEP] identifier[connID] operator[SEP] operator[SEP] identifier[writeBuffer] operator[SEP] identifier[putInt] operator[SEP] Keyword[this] operator[SEP] identifier[seqNum] operator[SEP] operator[SEP] identifier[writeBuffer] operator[SEP] identifier[put] operator[SEP] Keyword[this] operator[SEP] identifier[connHandleCreatorId] operator[SEP] operator[SEP] identifier[writeBuffer] operator[SEP] identifier[put] operator[SEP] Keyword[this] operator[SEP] identifier[myFlags] operator[SEP] operator[SEP] identifier[writeBuffer] operator[SEP] identifier[put] operator[SEP] Keyword[this] operator[SEP] identifier[myType] operator[SEP] operator[SEP] identifier[writeBuffer] operator[SEP] identifier[put] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] literal[Integer] operator[SEP] operator[SEP]
}
|
public TcpIpConfig setMembers(final List<String> members) {
isNotNull(members, "members");
this.members.clear();
for (String member : members) {
addMember(member);
}
return this;
} | class class_name[name] begin[{]
method[setMembers, return_type[type[TcpIpConfig]], modifier[public], parameter[members]] begin[{]
call[.isNotNull, parameter[member[.members], literal["members"]]]
THIS[member[None.members]call[None.clear, parameter[]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMember, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=members, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=member)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[TcpIpConfig] identifier[setMembers] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[members] operator[SEP] {
identifier[isNotNull] operator[SEP] identifier[members] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[members] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[member] operator[:] identifier[members] operator[SEP] {
identifier[addMember] operator[SEP] identifier[member] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static <T> TextArea<T> newTextArea(final String id, final IModel<T> model)
{
final TextArea<T> textArea = new TextArea<>(id, model);
textArea.setOutputMarkupId(true);
return textArea;
} | class class_name[name] begin[{]
method[newTextArea, return_type[type[TextArea]], modifier[public static], parameter[id, model]] begin[{]
local_variable[type[TextArea], textArea]
call[textArea.setOutputMarkupId, parameter[literal[true]]]
return[member[.textArea]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[TextArea] operator[<] identifier[T] operator[>] identifier[newTextArea] operator[SEP] Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[IModel] operator[<] identifier[T] operator[>] identifier[model] operator[SEP] {
Keyword[final] identifier[TextArea] operator[<] identifier[T] operator[>] identifier[textArea] operator[=] Keyword[new] identifier[TextArea] operator[<] operator[>] operator[SEP] identifier[id] , identifier[model] operator[SEP] operator[SEP] identifier[textArea] operator[SEP] identifier[setOutputMarkupId] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[textArea] operator[SEP]
}
|
public com.google.api.ads.adwords.axis.v201809.cm.CustomParameters getSitelinkUrlCustomParameters() {
return sitelinkUrlCustomParameters;
} | class class_name[name] begin[{]
method[getSitelinkUrlCustomParameters, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.sitelinkUrlCustomParameters]]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[cm] operator[SEP] identifier[CustomParameters] identifier[getSitelinkUrlCustomParameters] operator[SEP] operator[SEP] {
Keyword[return] identifier[sitelinkUrlCustomParameters] operator[SEP]
}
|
public static String capitalize(final String str) {
final int strLen;
if(str == null || (strLen = str.length()) == 0) {
return str;
}
return new StringBuilder(strLen)
.append(String.valueOf(str.charAt(0)).toUpperCase())
.append(str.substring(1))
.toString();
} | class class_name[name] begin[{]
method[capitalize, return_type[type[String]], modifier[public static], parameter[str]] begin[{]
local_variable[type[int], strLen]
if[binary_operation[binary_operation[member[.str], ==, literal[null]], ||, binary_operation[assign[member[.strLen], call[str.length, parameter[]]], ==, literal[0]]]] begin[{]
return[member[.str]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=strLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[capitalize] operator[SEP] Keyword[final] identifier[String] identifier[str] operator[SEP] {
Keyword[final] Keyword[int] identifier[strLen] operator[SEP] Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[||] operator[SEP] identifier[strLen] operator[=] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[str] operator[SEP]
}
Keyword[return] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[strLen] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[str] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[str] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Resource create(File file)
{
try
{
String path = file.getCanonicalPath();
if(file.isDirectory())
path = PathUtils.addTrailingSlash(path);
return create(new File("/"), path);
}
catch(IOException e)
{
throw new IllegalArgumentException("invalid file " + file, e);
}
} | class class_name[name] begin[{]
method[create, return_type[type[Resource]], modifier[public static], parameter[file]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addTrailingSlash, postfix_operators=[], prefix_operators=[], qualifier=PathUtils, selectors=[], type_arguments=None)), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid file "), operandr=MemberReference(member=file, 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=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Resource] identifier[create] operator[SEP] identifier[File] identifier[file] operator[SEP] {
Keyword[try] {
identifier[String] identifier[path] operator[=] identifier[file] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[PathUtils] operator[SEP] identifier[addTrailingSlash] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[return] identifier[create] operator[SEP] Keyword[new] identifier[File] operator[SEP] literal[String] operator[SEP] , identifier[path] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[file] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static Object requiredSingleResult(Collection results) throws DatabaseException {
int size = ((results != null) ? results.size() : 0);
if (size == 0) {
throw new DatabaseException("Empty result set, expected one row");
}
if (results.size() > 1) {
throw new DatabaseException("Result set larger than one row");
}
return results.iterator().next();
} | class class_name[name] begin[{]
method[requiredSingleResult, return_type[type[Object]], modifier[public static], parameter[results]] begin[{]
local_variable[type[int], size]
if[binary_operation[member[.size], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Empty result set, expected one row")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[results.size, parameter[]], >, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Result set larger than one row")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[results.iterator, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[requiredSingleResult] operator[SEP] identifier[Collection] identifier[results] operator[SEP] Keyword[throws] identifier[DatabaseException] {
Keyword[int] identifier[size] operator[=] operator[SEP] operator[SEP] identifier[results] operator[!=] Other[null] operator[SEP] operator[?] identifier[results] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[results] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[results] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected void initializeImpl()
{
//initialize
super.initializeImpl();
//initialize templates
this.initializeMailTemplates();
//get logger
Logger logger=this.getLogger();
//validate mail address template
if(this.mailAddressTemplate==null)
{
throw new FaxException("Mail address template not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.MAIL_ADDRESS_TEMPLATE_PROPERTY_KEY);
}
logger.logDebug(new Object[]{"Using mail address template: ",this.mailAddressTemplate},null);
//validate mail subject template
if(this.mailSubjectTemplate==null)
{
throw new FaxException("Mail subject template not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.MAIL_SUBJECT_TEMPLATE_PROPERTY_KEY);
}
logger.logDebug(new Object[]{"Using mail subject template: ",this.mailSubjectTemplate},null);
} | class class_name[name] begin[{]
method[initializeImpl, return_type[void], modifier[protected], parameter[]] begin[{]
SuperMethodInvocation(arguments=[], member=initializeImpl, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
THIS[call[None.initializeMailTemplates, parameter[]]]
local_variable[type[Logger], logger]
if[binary_operation[THIS[member[None.mailAddressTemplate]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Mail address template not defined in fax4j.properties. Property: "), operandr=MemberReference(member=MAIL_ADDRESS_TEMPLATE_PROPERTY_KEY, postfix_operators=[], prefix_operators=[], qualifier=FaxClientSpiConfigurationConstants, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FaxException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[logger.logDebug, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Using mail address template: "), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mailAddressTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), literal[null]]]
if[binary_operation[THIS[member[None.mailSubjectTemplate]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Mail subject template not defined in fax4j.properties. Property: "), operandr=MemberReference(member=MAIL_SUBJECT_TEMPLATE_PROPERTY_KEY, postfix_operators=[], prefix_operators=[], qualifier=FaxClientSpiConfigurationConstants, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FaxException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[logger.logDebug, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Using mail subject template: "), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mailSubjectTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), literal[null]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[initializeImpl] operator[SEP] operator[SEP] {
Keyword[super] operator[SEP] identifier[initializeImpl] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[initializeMailTemplates] operator[SEP] operator[SEP] operator[SEP] identifier[Logger] identifier[logger] operator[=] Keyword[this] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[mailAddressTemplate] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[FaxException] operator[SEP] literal[String] operator[+] identifier[FaxClientSpiConfigurationConstants] operator[SEP] identifier[MAIL_ADDRESS_TEMPLATE_PROPERTY_KEY] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[logDebug] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , Keyword[this] operator[SEP] identifier[mailAddressTemplate]
} , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[mailSubjectTemplate] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[FaxException] operator[SEP] literal[String] operator[+] identifier[FaxClientSpiConfigurationConstants] operator[SEP] identifier[MAIL_SUBJECT_TEMPLATE_PROPERTY_KEY] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[logDebug] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , Keyword[this] operator[SEP] identifier[mailSubjectTemplate]
} , Other[null] operator[SEP] operator[SEP]
}
|
public static <T> AsyncDataFetcher<T> async(DataFetcher<T> wrappedDataFetcher, Executor executor) {
return new AsyncDataFetcher<>(wrappedDataFetcher, executor);
} | class class_name[name] begin[{]
method[async, return_type[type[AsyncDataFetcher]], modifier[public static], parameter[wrappedDataFetcher, executor]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=wrappedDataFetcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=executor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=AsyncDataFetcher, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[AsyncDataFetcher] operator[<] identifier[T] operator[>] identifier[async] operator[SEP] identifier[DataFetcher] operator[<] identifier[T] operator[>] identifier[wrappedDataFetcher] , identifier[Executor] identifier[executor] operator[SEP] {
Keyword[return] Keyword[new] identifier[AsyncDataFetcher] operator[<] operator[>] operator[SEP] identifier[wrappedDataFetcher] , identifier[executor] operator[SEP] operator[SEP]
}
|
@Override
public ApiFuture<Operation> snapshotTableAsync(SnapshotTableRequest request) {
return baseAdminClient.snapshotTableCallable().futureCall(request);
} | class class_name[name] begin[{]
method[snapshotTableAsync, return_type[type[ApiFuture]], modifier[public], parameter[request]] begin[{]
return[call[baseAdminClient.snapshotTableCallable, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ApiFuture] operator[<] identifier[Operation] operator[>] identifier[snapshotTableAsync] operator[SEP] identifier[SnapshotTableRequest] identifier[request] operator[SEP] {
Keyword[return] identifier[baseAdminClient] operator[SEP] identifier[snapshotTableCallable] operator[SEP] operator[SEP] operator[SEP] identifier[futureCall] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private long nfanode(Subre t) throws RegexException {
long ret;
assert t.begin != null;
if (LOG.isDebugEnabled() && IS_DEBUG) {
LOG.debug(String.format("========= TREE NODE %s ==========", t.shortId()));
}
Nfa newNfa = new Nfa(nfa);
newNfa.dupnfa(t.begin, t.end, newNfa.init, newNfa.finalState);
newNfa.specialcolors();
ret = newNfa.optimize();
t.cnfa = newNfa.compact();
// freenfa ... depend on our friend the GC.
return ret;
} | class class_name[name] begin[{]
method[nfanode, return_type[type[long]], modifier[private], parameter[t]] begin[{]
local_variable[type[long], ret]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=begin, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
if[binary_operation[call[LOG.isDebugEnabled, parameter[]], &&, member[.IS_DEBUG]]] begin[{]
call[LOG.debug, parameter[call[String.format, parameter[literal["========= TREE NODE %s =========="], call[t.shortId, parameter[]]]]]]
else begin[{]
None
end[}]
local_variable[type[Nfa], newNfa]
call[newNfa.dupnfa, parameter[member[t.begin], member[t.end], member[newNfa.init], member[newNfa.finalState]]]
call[newNfa.specialcolors, parameter[]]
assign[member[.ret], call[newNfa.optimize, parameter[]]]
assign[member[t.cnfa], call[newNfa.compact, parameter[]]]
return[member[.ret]]
end[}]
END[}] | Keyword[private] Keyword[long] identifier[nfanode] operator[SEP] identifier[Subre] identifier[t] operator[SEP] Keyword[throws] identifier[RegexException] {
Keyword[long] identifier[ret] operator[SEP] Keyword[assert] identifier[t] operator[SEP] identifier[begin] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[&&] identifier[IS_DEBUG] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[t] operator[SEP] identifier[shortId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Nfa] identifier[newNfa] operator[=] Keyword[new] identifier[Nfa] operator[SEP] identifier[nfa] operator[SEP] operator[SEP] identifier[newNfa] operator[SEP] identifier[dupnfa] operator[SEP] identifier[t] operator[SEP] identifier[begin] , identifier[t] operator[SEP] identifier[end] , identifier[newNfa] operator[SEP] identifier[init] , identifier[newNfa] operator[SEP] identifier[finalState] operator[SEP] operator[SEP] identifier[newNfa] operator[SEP] identifier[specialcolors] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[=] identifier[newNfa] operator[SEP] identifier[optimize] operator[SEP] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[cnfa] operator[=] identifier[newNfa] operator[SEP] identifier[compact] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
public Observable<ServiceResponse<Domain>> getDomainWithServiceResponseAsync(UUID domainId) {
if (domainId == null) {
throw new IllegalArgumentException("Parameter domainId is required and cannot be null.");
}
if (this.client.apiKey() == null) {
throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null.");
}
return service.getDomain(domainId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Domain>>>() {
@Override
public Observable<ServiceResponse<Domain>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Domain> clientResponse = getDomainDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} | class class_name[name] begin[{]
method[getDomainWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[domainId]] begin[{]
if[binary_operation[member[.domainId], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter domainId is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.apiKey, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiKey() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[service.getDomain, parameter[member[.domainId], THIS[member[None.client]call[None.apiKey, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Domain] operator[>] operator[>] identifier[getDomainWithServiceResponseAsync] operator[SEP] identifier[UUID] identifier[domainId] operator[SEP] {
Keyword[if] operator[SEP] identifier[domainId] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiKey] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[service] operator[SEP] identifier[getDomain] operator[SEP] identifier[domainId] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiKey] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Domain] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Domain] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] {
Keyword[try] {
identifier[ServiceResponse] operator[<] identifier[Domain] operator[>] identifier[clientResponse] operator[=] identifier[getDomainDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "CompassPoint")
public JAXBElement<CompassPointEnumeration> createCompassPoint(CompassPointEnumeration value) {
return new JAXBElement<CompassPointEnumeration>(_CompassPoint_QNAME, CompassPointEnumeration.class, null, value);
} | class class_name[name] begin[{]
method[createCompassPoint, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_CompassPoint_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompassPointEnumeration, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CompassPointEnumeration, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[CompassPointEnumeration] operator[>] identifier[createCompassPoint] operator[SEP] identifier[CompassPointEnumeration] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[CompassPointEnumeration] operator[>] operator[SEP] identifier[_CompassPoint_QNAME] , identifier[CompassPointEnumeration] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
public Observable<ImmutabilityPolicyInner> extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) {
return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays).map(new Func1<ServiceResponseWithHeaders<ImmutabilityPolicyInner, BlobContainersExtendImmutabilityPolicyHeaders>, ImmutabilityPolicyInner>() {
@Override
public ImmutabilityPolicyInner call(ServiceResponseWithHeaders<ImmutabilityPolicyInner, BlobContainersExtendImmutabilityPolicyHeaders> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[extendImmutabilityPolicyAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays]] begin[{]
return[call[.extendImmutabilityPolicyWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.containerName], member[.ifMatch], member[.immutabilityPeriodSinceCreationInDays]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ImmutabilityPolicyInner] operator[>] identifier[extendImmutabilityPolicyAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[containerName] , identifier[String] identifier[ifMatch] , Keyword[int] identifier[immutabilityPeriodSinceCreationInDays] operator[SEP] {
Keyword[return] identifier[extendImmutabilityPolicyWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[containerName] , identifier[ifMatch] , identifier[immutabilityPeriodSinceCreationInDays] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[ImmutabilityPolicyInner] , identifier[BlobContainersExtendImmutabilityPolicyHeaders] operator[>] , identifier[ImmutabilityPolicyInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[ImmutabilityPolicyInner] identifier[call] operator[SEP] identifier[ServiceResponseWithHeaders] operator[<] identifier[ImmutabilityPolicyInner] , identifier[BlobContainersExtendImmutabilityPolicyHeaders] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static <T extends JComponent> T getDescendantOfClass(Class<T> clazz,
Container container, String property, Object value)
throws IllegalArgumentException {
return getDescendantOfClass(clazz, container, property, value, true);
} | class class_name[name] begin[{]
method[getDescendantOfClass, return_type[type[T]], modifier[public static], parameter[clazz, container, property, value]] begin[{]
return[call[.getDescendantOfClass, parameter[member[.clazz], member[.container], member[.property], member[.value], literal[true]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[JComponent] operator[>] identifier[T] identifier[getDescendantOfClass] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] , identifier[Container] identifier[container] , identifier[String] identifier[property] , identifier[Object] identifier[value] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[return] identifier[getDescendantOfClass] operator[SEP] identifier[clazz] , identifier[container] , identifier[property] , identifier[value] , literal[boolean] operator[SEP] operator[SEP]
}
|
public Observable<Page<FileServerInner>> listByResourceGroupAsync(final String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
.map(new Func1<ServiceResponse<Page<FileServerInner>>, Page<FileServerInner>>() {
@Override
public Page<FileServerInner> call(ServiceResponse<Page<FileServerInner>> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[listByResourceGroupAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName]] begin[{]
return[call[.listByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[FileServerInner] operator[>] operator[>] identifier[listByResourceGroupAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] operator[SEP] {
Keyword[return] identifier[listByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[FileServerInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[FileServerInner] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[FileServerInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[FileServerInner] operator[>] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public Iterator<Integer> getBshIterator(final Number obj) {
int number = obj.intValue();
if (number == 0)
return this.emptyIt();
if (number > 0)
return IntStream.rangeClosed(0, number).iterator();
return IntStream.rangeClosed(number, 0).map(i -> number - i).iterator();
} | class class_name[name] begin[{]
method[getBshIterator, return_type[type[Iterator]], modifier[public], parameter[obj]] begin[{]
local_variable[type[int], number]
if[binary_operation[member[.number], ==, literal[0]]] begin[{]
return[THIS[call[None.emptyIt, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.number], >, literal[0]]] begin[{]
return[call[IntStream.rangeClosed, parameter[literal[0], member[.number]]]]
else begin[{]
None
end[}]
return[call[IntStream.rangeClosed, parameter[member[.number], literal[0]]]]
end[}]
END[}] | Keyword[public] identifier[Iterator] operator[<] identifier[Integer] operator[>] identifier[getBshIterator] operator[SEP] Keyword[final] identifier[Number] identifier[obj] operator[SEP] {
Keyword[int] identifier[number] operator[=] identifier[obj] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[number] operator[==] Other[0] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[emptyIt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[number] operator[>] Other[0] operator[SEP] Keyword[return] identifier[IntStream] operator[SEP] identifier[rangeClosed] operator[SEP] Other[0] , identifier[number] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[IntStream] operator[SEP] identifier[rangeClosed] operator[SEP] identifier[number] , Other[0] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[i] operator[->] identifier[number] operator[-] identifier[i] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP]
}
|
protected <T> String getGroupType(T obj, String type, String name, Session session) throws CpoException {
String retType = type;
long objCount;
if (CpoAdapter.PERSIST_GROUP.equals(retType)) {
objCount = existsObject(name, obj, session, null);
if (objCount == 0) {
retType = CpoAdapter.CREATE_GROUP;
} else if (objCount == 1) {
retType = CpoAdapter.UPDATE_GROUP;
} else {
throw new CpoException("Persist can only UPDATE one record. Your EXISTS function returned 2 or more.");
}
}
return retType;
} | class class_name[name] begin[{]
method[getGroupType, return_type[type[String]], modifier[protected], parameter[obj, type, name, session]] begin[{]
local_variable[type[String], retType]
local_variable[type[long], objCount]
if[call[CpoAdapter.PERSIST_GROUP.equals, parameter[member[.retType]]]] begin[{]
assign[member[.objCount], call[.existsObject, parameter[member[.name], member[.obj], member[.session], literal[null]]]]
if[binary_operation[member[.objCount], ==, literal[0]]] begin[{]
assign[member[.retType], member[CpoAdapter.CREATE_GROUP]]
else begin[{]
if[binary_operation[member[.objCount], ==, literal[1]]] begin[{]
assign[member[.retType], member[CpoAdapter.UPDATE_GROUP]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Persist can only UPDATE one record. Your EXISTS function returned 2 or more.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CpoException, sub_type=None)), label=None)
end[}]
end[}]
else begin[{]
None
end[}]
return[member[.retType]]
end[}]
END[}] | Keyword[protected] operator[<] identifier[T] operator[>] identifier[String] identifier[getGroupType] operator[SEP] identifier[T] identifier[obj] , identifier[String] identifier[type] , identifier[String] identifier[name] , identifier[Session] identifier[session] operator[SEP] Keyword[throws] identifier[CpoException] {
identifier[String] identifier[retType] operator[=] identifier[type] operator[SEP] Keyword[long] identifier[objCount] operator[SEP] Keyword[if] operator[SEP] identifier[CpoAdapter] operator[SEP] identifier[PERSIST_GROUP] operator[SEP] identifier[equals] operator[SEP] identifier[retType] operator[SEP] operator[SEP] {
identifier[objCount] operator[=] identifier[existsObject] operator[SEP] identifier[name] , identifier[obj] , identifier[session] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[objCount] operator[==] Other[0] operator[SEP] {
identifier[retType] operator[=] identifier[CpoAdapter] operator[SEP] identifier[CREATE_GROUP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[objCount] operator[==] Other[1] operator[SEP] {
identifier[retType] operator[=] identifier[CpoAdapter] operator[SEP] identifier[UPDATE_GROUP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[CpoException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[retType] operator[SEP]
}
|
protected void validate(String operationType) throws Exception
{
super.validate(operationType);
MPSInt timeout_validator = new MPSInt();
timeout_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 0);
timeout_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 18000);
timeout_validator.validate(operationType, timeout, "\"timeout\"");
MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
ns_ip_address_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
} | class class_name[name] begin[{]
method[validate, return_type[void], modifier[protected], parameter[operationType]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=operationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validate, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
local_variable[type[MPSInt], timeout_validator]
call[timeout_validator.setConstraintMinValue, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[0]]]
call[timeout_validator.setConstraintMaxValue, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[18000]]]
call[timeout_validator.validate, parameter[member[.operationType], member[.timeout], literal["\"timeout\""]]]
local_variable[type[MPSIPAddress], ns_ip_address_validator]
call[ns_ip_address_validator.setConstraintIsReq, parameter[member[MPSConstants.ADD_CONSTRAINT], literal[true]]]
call[ns_ip_address_validator.validate, parameter[member[.operationType], member[.ns_ip_address], literal["\"ns_ip_address\""]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[validate] operator[SEP] identifier[String] identifier[operationType] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[super] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] operator[SEP] operator[SEP] identifier[MPSInt] identifier[timeout_validator] operator[=] Keyword[new] identifier[MPSInt] operator[SEP] operator[SEP] operator[SEP] identifier[timeout_validator] operator[SEP] identifier[setConstraintMinValue] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[0] operator[SEP] operator[SEP] identifier[timeout_validator] operator[SEP] identifier[setConstraintMaxValue] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[18000] operator[SEP] operator[SEP] identifier[timeout_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[timeout] , literal[String] operator[SEP] operator[SEP] identifier[MPSIPAddress] identifier[ns_ip_address_validator] operator[=] Keyword[new] identifier[MPSIPAddress] operator[SEP] operator[SEP] operator[SEP] identifier[ns_ip_address_validator] operator[SEP] identifier[setConstraintIsReq] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[ADD_CONSTRAINT] , literal[boolean] operator[SEP] operator[SEP] identifier[ns_ip_address_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[ns_ip_address] , literal[String] operator[SEP] operator[SEP]
}
|
public java.util.List<MetricDatum> getMetricData() {
if (metricData == null) {
metricData = new com.amazonaws.internal.SdkInternalList<MetricDatum>();
}
return metricData;
} | class class_name[name] begin[{]
method[getMetricData, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.metricData], ==, literal[null]]] begin[{]
assign[member[.metricData], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MetricDatum, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.metricData]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[MetricDatum] operator[>] identifier[getMetricData] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[metricData] operator[==] Other[null] operator[SEP] {
identifier[metricData] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[MetricDatum] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[metricData] operator[SEP]
}
|
public static boolean checkForInvalidInfoElements(final Document doc) {
final List<Node> invalidElements = XMLUtilities.getDirectChildNodes(doc.getDocumentElement(), "title", "subtitle", "titleabbrev");
return invalidElements != null && !invalidElements.isEmpty();
} | class class_name[name] begin[{]
method[checkForInvalidInfoElements, return_type[type[boolean]], modifier[public static], parameter[doc]] begin[{]
local_variable[type[List], invalidElements]
return[binary_operation[binary_operation[member[.invalidElements], !=, literal[null]], &&, call[invalidElements.isEmpty, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[checkForInvalidInfoElements] operator[SEP] Keyword[final] identifier[Document] identifier[doc] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[Node] operator[>] identifier[invalidElements] operator[=] identifier[XMLUtilities] operator[SEP] identifier[getDirectChildNodes] operator[SEP] identifier[doc] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[invalidElements] operator[!=] Other[null] operator[&&] operator[!] identifier[invalidElements] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String toHTTPTimeString(Date date, boolean oldFormat) {
if (oldFormat) {
synchronized (HTTP_TIME_STRING_FORMAT_OLD) {
return StringUtil.replace(HTTP_TIME_STRING_FORMAT_OLD.format(date), "+00:00", "", true);
}
}
synchronized (HTTP_TIME_STRING_FORMAT) {
return StringUtil.replace(HTTP_TIME_STRING_FORMAT.format(date), "+00:00", "", true);
}
} | class class_name[name] begin[{]
method[toHTTPTimeString, return_type[type[String]], modifier[public static], parameter[date, oldFormat]] begin[{]
if[member[.oldFormat]] begin[{]
SYNCHRONIZED[member[.HTTP_TIME_STRING_FORMAT_OLD]] BEGIN[{]
return[call[StringUtil.replace, parameter[call[HTTP_TIME_STRING_FORMAT_OLD.format, parameter[member[.date]]], literal["+00:00"], literal[""], literal[true]]]]
END[}]
else begin[{]
None
end[}]
SYNCHRONIZED[member[.HTTP_TIME_STRING_FORMAT]] BEGIN[{]
return[call[StringUtil.replace, parameter[call[HTTP_TIME_STRING_FORMAT.format, parameter[member[.date]]], literal["+00:00"], literal[""], literal[true]]]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[toHTTPTimeString] operator[SEP] identifier[Date] identifier[date] , Keyword[boolean] identifier[oldFormat] operator[SEP] {
Keyword[if] operator[SEP] identifier[oldFormat] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[HTTP_TIME_STRING_FORMAT_OLD] operator[SEP] {
Keyword[return] identifier[StringUtil] operator[SEP] identifier[replace] operator[SEP] identifier[HTTP_TIME_STRING_FORMAT_OLD] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] , literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[synchronized] operator[SEP] identifier[HTTP_TIME_STRING_FORMAT] operator[SEP] {
Keyword[return] identifier[StringUtil] operator[SEP] identifier[replace] operator[SEP] identifier[HTTP_TIME_STRING_FORMAT] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] , literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP]
}
}
|
public JQMButton setLeftButton(String text) {
return setLeftButton(text, (String) null, (DataIcon) null);
} | class class_name[name] begin[{]
method[setLeftButton, return_type[type[JQMButton]], modifier[public], parameter[text]] begin[{]
return[call[.setLeftButton, parameter[member[.text], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=DataIcon, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[JQMButton] identifier[setLeftButton] operator[SEP] identifier[String] identifier[text] operator[SEP] {
Keyword[return] identifier[setLeftButton] operator[SEP] identifier[text] , operator[SEP] identifier[String] operator[SEP] Other[null] , operator[SEP] identifier[DataIcon] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
|
private void changeStateTo(int newState) {
synchronized (lockObject) {
int oldState = this.status.getRunState();
if (oldState == newState) {
return; //old and new states are same
}
this.status.setRunState(newState);
}
} | class class_name[name] begin[{]
method[changeStateTo, return_type[void], modifier[private], parameter[newState]] begin[{]
SYNCHRONIZED[member[.lockObject]] BEGIN[{]
local_variable[type[int], oldState]
if[binary_operation[member[.oldState], ==, member[.newState]]] begin[{]
return[None]
else begin[{]
None
end[}]
THIS[member[None.status]call[None.setRunState, parameter[member[.newState]]]]
END[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[changeStateTo] operator[SEP] Keyword[int] identifier[newState] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[lockObject] operator[SEP] {
Keyword[int] identifier[oldState] operator[=] Keyword[this] operator[SEP] identifier[status] operator[SEP] identifier[getRunState] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldState] operator[==] identifier[newState] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[status] operator[SEP] identifier[setRunState] operator[SEP] identifier[newState] operator[SEP] operator[SEP]
}
}
|
public AgentOrder getAgentOrder(String agentId) {
for (AgentOrder eachAgentOrder : this.agentOrders) {
if (eachAgentOrder.getId().equals(agentId)) {
return eachAgentOrder;
}
}
return null;
} | class class_name[name] begin[{]
method[getAgentOrder, return_type[type[AgentOrder]], modifier[public], parameter[agentId]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=eachAgentOrder, selectors=[MethodInvocation(arguments=[MemberReference(member=agentId, 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=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=eachAgentOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=agentOrders, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eachAgentOrder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AgentOrder, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[AgentOrder] identifier[getAgentOrder] operator[SEP] identifier[String] identifier[agentId] operator[SEP] {
Keyword[for] operator[SEP] identifier[AgentOrder] identifier[eachAgentOrder] operator[:] Keyword[this] operator[SEP] identifier[agentOrders] operator[SEP] {
Keyword[if] operator[SEP] identifier[eachAgentOrder] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[agentId] operator[SEP] operator[SEP] {
Keyword[return] identifier[eachAgentOrder] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public void marshall(VaultLockPolicy vaultLockPolicy, ProtocolMarshaller protocolMarshaller) {
if (vaultLockPolicy == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(vaultLockPolicy.getPolicy(), POLICY_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[vaultLockPolicy, protocolMarshaller]] begin[{]
if[binary_operation[member[.vaultLockPolicy], ==, 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=getPolicy, postfix_operators=[], prefix_operators=[], qualifier=vaultLockPolicy, selectors=[], type_arguments=None), MemberReference(member=POLICY_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[VaultLockPolicy] identifier[vaultLockPolicy] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[vaultLockPolicy] 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[vaultLockPolicy] operator[SEP] identifier[getPolicy] operator[SEP] operator[SEP] , identifier[POLICY_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]
}
}
|
@BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> concat(Iterable<? extends MaybeSource<? extends T>> sources) {
ObjectHelper.requireNonNull(sources, "sources is null");
return RxJavaPlugins.onAssembly(new MaybeConcatIterable<T>(sources));
} | class class_name[name] begin[{]
method[concat, return_type[type[Flowable]], modifier[public static], parameter[sources]] begin[{]
call[ObjectHelper.requireNonNull, parameter[member[.sources], literal["sources is null"]]]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[MemberReference(member=sources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=MaybeConcatIterable, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[BackpressureSupport] operator[SEP] identifier[BackpressureKind] operator[SEP] identifier[FULL] operator[SEP] annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Flowable] operator[<] identifier[T] operator[>] identifier[concat] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[MaybeSource] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[sources] operator[SEP] {
identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[sources] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[MaybeConcatIterable] operator[<] identifier[T] operator[>] operator[SEP] identifier[sources] operator[SEP] operator[SEP] operator[SEP]
}
|
public static BufferedImage process(BufferedImage inImage, int outWidth, int outHeight, int scanSize, ProgressListener listener)
{
System.out.println("DistanceFieldFilter.process");
BufferedImage outImage = new BufferedImage(outWidth, outHeight, BufferedImage.TYPE_4BYTE_ABGR);
float[][] distances = new float[outImage.getWidth()][outImage.getHeight()];
final int blockWidth = inImage.getWidth() / outImage.getWidth();
final int blockHeight = inImage.getHeight() / outImage.getHeight();
System.out.println("Block size is "+blockWidth+","+blockHeight);
for (int x=0; x<outImage.getWidth(); x++)
{
listener.reportProgress("Finding signed distance", x, outImage.getWidth());
for (int y=0; y<outImage.getHeight(); y++)
{
distances[x][y] = findSignedDistance( (x * blockWidth) + (blockWidth / 2),
(y * blockHeight) + (blockHeight / 2),
inImage,
scanSize, scanSize);
}
}
float max = 0;
for (int x=0; x<distances.length; x++)
{
for (int y=0; y<distances[0].length; y++)
{
final float d = distances[x][y];
if (d != Float.MAX_VALUE && d > max)
max = d;
}
}
float min = 0;
for (int x=0; x<distances.length; x++)
{
for (int y=0; y<distances[0].length; y++)
{
final float d = distances[x][y];
if (d != Float.MIN_VALUE && d < min)
min = d;
}
}
final float range = max - min;
final float scale = Math.max( Math.abs(min), Math.abs(max) );
System.out.println("Max: "+max+", Min:"+min+", Range:"+range);
for (int x=0; x<distances.length; x++)
{
for (int y=0; y<distances[0].length; y++)
{
float d = distances[x][y];
if (d == Float.MAX_VALUE)
d = 1.0f;
else if (d == Float.MIN_VALUE)
d = 0.0f;
else
{
d /= scale;
d /= 2;
d += 0.5f;
}
distances[x][y] = d;
}
}
for (int x=0; x<distances.length; x++)
{
listener.reportProgress("Setting Image", x, outImage.getWidth());
for (int y=0; y<distances[0].length; y++)
{
float d = distances[x][y];
if (d == Float.NaN)
d = 0;
// As greyscale
// outImage.setRGB(x, y, new Color(d, d, d, 1.0f).getRGB());
// As alpha
outImage.setRGB(x, y, new Color(1.0f, 1.0f, 1.0f, d).getRGB());
// As both
// outImage.setRGB(x, y, new Color(d, d, d, d).getRGB());
}
}
return outImage;
} | class class_name[name] begin[{]
method[process, return_type[type[BufferedImage]], modifier[public static], parameter[inImage, outWidth, outHeight, scanSize, listener]] begin[{]
call[System.out.println, parameter[literal["DistanceFieldFilter.process"]]]
local_variable[type[BufferedImage], outImage]
local_variable[type[float], distances]
local_variable[type[int], blockWidth]
local_variable[type[int], blockHeight]
call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["Block size is "], +, member[.blockWidth]], +, literal[","]], +, member[.blockHeight]]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Finding signed distance"), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=outImage, selectors=[], type_arguments=None)], member=reportProgress, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=blockWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=blockWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=blockHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=blockHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operator=+), MemberReference(member=inImage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scanSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scanSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findSignedDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=outImage, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=outImage, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[float], max]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=d)], modifiers={'final'}, type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=distances, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[float], min]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=d)], modifiers={'final'}, type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=distances, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[float], range]
local_variable[type[float], scale]
call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Max: "], +, member[.max]], +, literal[", Min:"]], +, member[.min]], +, literal[", Range:"]], +, member[.range]]]]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=/=, value=MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=/=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.5f)), label=None)]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0f)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0f)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=distances, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Setting Image"), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=outImage, selectors=[], type_arguments=None)], member=reportProgress, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NaN, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0f), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0f), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0f), MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRGB, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))], member=setRGB, postfix_operators=[], prefix_operators=[], qualifier=outImage, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=distances, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.outImage]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BufferedImage] identifier[process] operator[SEP] identifier[BufferedImage] identifier[inImage] , Keyword[int] identifier[outWidth] , Keyword[int] identifier[outHeight] , Keyword[int] identifier[scanSize] , identifier[ProgressListener] identifier[listener] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[outImage] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[outWidth] , identifier[outHeight] , identifier[BufferedImage] operator[SEP] identifier[TYPE_4BYTE_ABGR] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[distances] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[outImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[outImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[blockWidth] operator[=] identifier[inImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[/] identifier[outImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[blockHeight] operator[=] identifier[inImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[/] identifier[outImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[blockWidth] operator[+] literal[String] operator[+] identifier[blockHeight] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[outImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[++] operator[SEP] {
identifier[listener] operator[SEP] identifier[reportProgress] operator[SEP] literal[String] , identifier[x] , identifier[outImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[outImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] identifier[y] operator[++] operator[SEP] {
identifier[distances] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] identifier[findSignedDistance] operator[SEP] operator[SEP] identifier[x] operator[*] identifier[blockWidth] operator[SEP] operator[+] operator[SEP] identifier[blockWidth] operator[/] Other[2] operator[SEP] , operator[SEP] identifier[y] operator[*] identifier[blockHeight] operator[SEP] operator[+] operator[SEP] identifier[blockHeight] operator[/] Other[2] operator[SEP] , identifier[inImage] , identifier[scanSize] , identifier[scanSize] operator[SEP] operator[SEP]
}
}
Keyword[float] identifier[max] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[distances] operator[SEP] identifier[length] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[distances] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[final] Keyword[float] identifier[d] operator[=] identifier[distances] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[!=] identifier[Float] operator[SEP] identifier[MAX_VALUE] operator[&&] identifier[d] operator[>] identifier[max] operator[SEP] identifier[max] operator[=] identifier[d] operator[SEP]
}
}
Keyword[float] identifier[min] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[distances] operator[SEP] identifier[length] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[distances] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[final] Keyword[float] identifier[d] operator[=] identifier[distances] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[!=] identifier[Float] operator[SEP] identifier[MIN_VALUE] operator[&&] identifier[d] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[d] operator[SEP]
}
}
Keyword[final] Keyword[float] identifier[range] operator[=] identifier[max] operator[-] identifier[min] operator[SEP] Keyword[final] Keyword[float] identifier[scale] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[min] operator[SEP] , identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[max] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[max] operator[+] literal[String] operator[+] identifier[min] operator[+] literal[String] operator[+] identifier[range] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[distances] operator[SEP] identifier[length] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[distances] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[float] identifier[d] operator[=] identifier[distances] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[==] identifier[Float] operator[SEP] identifier[MAX_VALUE] operator[SEP] identifier[d] operator[=] literal[Float] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[d] operator[==] identifier[Float] operator[SEP] identifier[MIN_VALUE] operator[SEP] identifier[d] operator[=] literal[Float] operator[SEP] Keyword[else] {
identifier[d] operator[/=] identifier[scale] operator[SEP] identifier[d] operator[/=] Other[2] operator[SEP] identifier[d] operator[+=] literal[Float] operator[SEP]
}
identifier[distances] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] identifier[d] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[distances] operator[SEP] identifier[length] operator[SEP] identifier[x] operator[++] operator[SEP] {
identifier[listener] operator[SEP] identifier[reportProgress] operator[SEP] literal[String] , identifier[x] , identifier[outImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[distances] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[float] identifier[d] operator[=] identifier[distances] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[==] identifier[Float] operator[SEP] identifier[NaN] operator[SEP] identifier[d] operator[=] Other[0] operator[SEP] identifier[outImage] operator[SEP] identifier[setRGB] operator[SEP] identifier[x] , identifier[y] , Keyword[new] identifier[Color] operator[SEP] literal[Float] , literal[Float] , literal[Float] , identifier[d] operator[SEP] operator[SEP] identifier[getRGB] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[outImage] operator[SEP]
}
|
@Override
public boolean matches(int lineNumber, String line) {
if (lineNumber == 1 && line.equals("id,description,nodes,edges,s_abs,s_rel,c_abs,c_rel")) {
return true;
}
return false;
} | class class_name[name] begin[{]
method[matches, return_type[type[boolean]], modifier[public], parameter[lineNumber, line]] begin[{]
if[binary_operation[binary_operation[member[.lineNumber], ==, literal[1]], &&, call[line.equals, parameter[literal["id,description,nodes,edges,s_abs,s_rel,c_abs,c_rel"]]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] Keyword[int] identifier[lineNumber] , identifier[String] identifier[line] operator[SEP] {
Keyword[if] operator[SEP] identifier[lineNumber] operator[==] Other[1] operator[&&] identifier[line] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public Object get(String key) {
if (!StringUtil.isEmpty(key)) {
if (pendingInstanceData.containsKey(key)) {
return pendingInstanceData.get(key);
}
if (instanceData.containsKey(key)) {
return instanceData.get(key);
}
}
return null;
} | class class_name[name] begin[{]
method[get, return_type[type[Object]], modifier[public], parameter[key]] begin[{]
if[call[StringUtil.isEmpty, parameter[member[.key]]]] begin[{]
if[call[pendingInstanceData.containsKey, parameter[member[.key]]]] begin[{]
return[call[pendingInstanceData.get, parameter[member[.key]]]]
else begin[{]
None
end[}]
if[call[instanceData.containsKey, parameter[member[.key]]]] begin[{]
return[call[instanceData.get, parameter[member[.key]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[get] operator[SEP] identifier[String] identifier[key] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[StringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[pendingInstanceData] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
Keyword[return] identifier[pendingInstanceData] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[instanceData] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
Keyword[return] identifier[instanceData] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static String display(Object first, Object second, Object... remainder) {
Object[] array = new Object[remainder.length + 2];
array[0] = first;
array[1] = second;
System.arraycopy(remainder, 0, array, 2, remainder.length);
return display(array);
} | class class_name[name] begin[{]
method[display, return_type[type[String]], modifier[public static], parameter[first, second, remainder]] begin[{]
local_variable[type[Object], array]
assign[member[.array], member[.first]]
assign[member[.array], member[.second]]
call[System.arraycopy, parameter[member[.remainder], literal[0], member[.array], literal[2], member[remainder.length]]]
return[call[.display, parameter[member[.array]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[display] operator[SEP] identifier[Object] identifier[first] , identifier[Object] identifier[second] , identifier[Object] operator[...] identifier[remainder] operator[SEP] {
identifier[Object] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[remainder] operator[SEP] identifier[length] operator[+] Other[2] operator[SEP] operator[SEP] identifier[array] operator[SEP] Other[0] operator[SEP] operator[=] identifier[first] operator[SEP] identifier[array] operator[SEP] Other[1] operator[SEP] operator[=] identifier[second] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[remainder] , Other[0] , identifier[array] , Other[2] , identifier[remainder] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[display] operator[SEP] identifier[array] operator[SEP] operator[SEP]
}
|
public void addConsumer(
Object key,
String topic,
String selectorString,
MatchTarget target,
boolean isWildcarded)
throws SIDiscriminatorSyntaxException
{
if (tc.isEntryEnabled())
SibTr.entry(tc,
"addConsumer",
new Object[]{key,
topic,
selectorString,
target,
new Boolean(isWildcarded)});
boolean selector = false;
MonitoredConsumer mc = (MonitoredConsumer)target;
// Is there a selector expression
if (selectorString != null && selectorString.trim().length() != 0)
{
selector = true;
}
// Has a consumer already registered on this topicexpression?
//
// If they have then, we can use the matching monitor lists in the existing consumer
// to short circuit the monitor matching process.
//
// Note that in this case we are agnostic about selectors.....but need to
// make sure that the SubscriptionRegistrar adds the consumer in the
// correct place
if(selector)
{
// This consumer has a selector, see if there is an existing subscription
// registrar entry
if(_subscriptionRegistrar.isKnownSelectorExpression(topic, isWildcarded))
{
// Found existing entry in selector table add this consumer to
// that entry
addConsumerForKnownTopicExpr(topic, selector, isWildcarded, mc, true);
}
else
{
// See if theres a corresponding non-selector entry
if(_subscriptionRegistrar.isKnownNonSelectorExpression(topic, isWildcarded))
{
// Found existing entry in non-selector table, add a new row in the
// subscriptionRegistrar's selector table
_subscriptionRegistrar.addNewConsumerForExpression(topic,mc,selector, isWildcarded);
addConsumerForKnownTopicExpr(topic, selector, isWildcarded, mc, false);
}
else
{
// An Entirely new expression, we'll have to do the matching
// Add a new row in the table of subscriptions
_subscriptionRegistrar.addNewConsumerForExpression(topic,mc,selector, isWildcarded);
addConsumerForNewTopicExpr(topic, isWildcarded, mc);
}
}
}
else
{
// This consumer has no selector, see if there is an existing subscription
// registrar entry
if(_subscriptionRegistrar.isKnownNonSelectorExpression(topic, isWildcarded))
{
// Found existing entry in non-selector table add this consumer to
// that entry
addConsumerForKnownTopicExpr(topic, selector, isWildcarded, mc, true);
}
else
{
// See if theres a corresponding selector entry
if(_subscriptionRegistrar.isKnownSelectorExpression(topic, isWildcarded))
{
// Found existing entry in selector table, add a new row in the
// subscriptionRegistrar's non-selector table
_subscriptionRegistrar.addNewConsumerForExpression(topic,mc,selector, isWildcarded);
addConsumerForKnownTopicExpr(topic, selector, isWildcarded, mc, false);
}
else
{
// An Entirely new expression, we'll have to do the matching
// Add a new row in the table of subscriptions
_subscriptionRegistrar.addNewConsumerForExpression(topic,mc,selector, isWildcarded);
addConsumerForNewTopicExpr(topic, isWildcarded, mc);
}
}
}
// Set info into the Target itself
if(selector)
mc.setSelector();
if(isWildcarded)
mc.setWildcarded();
mc.setTopic(topic);
if (tc.isEntryEnabled()) SibTr.exit(tc, "addConsumer");
} | class class_name[name] begin[{]
method[addConsumer, return_type[void], modifier[public], parameter[key, topic, selectorString, target, isWildcarded]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["addConsumer"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selectorString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=isWildcarded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[boolean], selector]
local_variable[type[MonitoredConsumer], mc]
if[binary_operation[binary_operation[member[.selectorString], !=, literal[null]], &&, binary_operation[call[selectorString.trim, parameter[]], !=, literal[0]]]] begin[{]
assign[member[.selector], literal[true]]
else begin[{]
None
end[}]
if[member[.selector]] begin[{]
if[call[_subscriptionRegistrar.isKnownSelectorExpression, parameter[member[.topic], member[.isWildcarded]]]] begin[{]
call[.addConsumerForKnownTopicExpr, parameter[member[.topic], member[.selector], member[.isWildcarded], member[.mc], literal[true]]]
else begin[{]
if[call[_subscriptionRegistrar.isKnownNonSelectorExpression, parameter[member[.topic], member[.isWildcarded]]]] begin[{]
call[_subscriptionRegistrar.addNewConsumerForExpression, parameter[member[.topic], member[.mc], member[.selector], member[.isWildcarded]]]
call[.addConsumerForKnownTopicExpr, parameter[member[.topic], member[.selector], member[.isWildcarded], member[.mc], literal[false]]]
else begin[{]
call[_subscriptionRegistrar.addNewConsumerForExpression, parameter[member[.topic], member[.mc], member[.selector], member[.isWildcarded]]]
call[.addConsumerForNewTopicExpr, parameter[member[.topic], member[.isWildcarded], member[.mc]]]
end[}]
end[}]
else begin[{]
if[call[_subscriptionRegistrar.isKnownNonSelectorExpression, parameter[member[.topic], member[.isWildcarded]]]] begin[{]
call[.addConsumerForKnownTopicExpr, parameter[member[.topic], member[.selector], member[.isWildcarded], member[.mc], literal[true]]]
else begin[{]
if[call[_subscriptionRegistrar.isKnownSelectorExpression, parameter[member[.topic], member[.isWildcarded]]]] begin[{]
call[_subscriptionRegistrar.addNewConsumerForExpression, parameter[member[.topic], member[.mc], member[.selector], member[.isWildcarded]]]
call[.addConsumerForKnownTopicExpr, parameter[member[.topic], member[.selector], member[.isWildcarded], member[.mc], literal[false]]]
else begin[{]
call[_subscriptionRegistrar.addNewConsumerForExpression, parameter[member[.topic], member[.mc], member[.selector], member[.isWildcarded]]]
call[.addConsumerForNewTopicExpr, parameter[member[.topic], member[.isWildcarded], member[.mc]]]
end[}]
end[}]
end[}]
if[member[.selector]] begin[{]
call[mc.setSelector, parameter[]]
else begin[{]
None
end[}]
if[member[.isWildcarded]] begin[{]
call[mc.setWildcarded, parameter[]]
else begin[{]
None
end[}]
call[mc.setTopic, parameter[member[.topic]]]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["addConsumer"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addConsumer] operator[SEP] identifier[Object] identifier[key] , identifier[String] identifier[topic] , identifier[String] identifier[selectorString] , identifier[MatchTarget] identifier[target] , Keyword[boolean] identifier[isWildcarded] operator[SEP] Keyword[throws] identifier[SIDiscriminatorSyntaxException] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[key] , identifier[topic] , identifier[selectorString] , identifier[target] , Keyword[new] identifier[Boolean] operator[SEP] identifier[isWildcarded] operator[SEP]
} operator[SEP] operator[SEP] Keyword[boolean] identifier[selector] operator[=] literal[boolean] operator[SEP] identifier[MonitoredConsumer] identifier[mc] operator[=] operator[SEP] identifier[MonitoredConsumer] operator[SEP] identifier[target] operator[SEP] Keyword[if] operator[SEP] identifier[selectorString] operator[!=] Other[null] operator[&&] identifier[selectorString] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[selector] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[selector] operator[SEP] {
Keyword[if] operator[SEP] identifier[_subscriptionRegistrar] operator[SEP] identifier[isKnownSelectorExpression] operator[SEP] identifier[topic] , identifier[isWildcarded] operator[SEP] operator[SEP] {
identifier[addConsumerForKnownTopicExpr] operator[SEP] identifier[topic] , identifier[selector] , identifier[isWildcarded] , identifier[mc] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[_subscriptionRegistrar] operator[SEP] identifier[isKnownNonSelectorExpression] operator[SEP] identifier[topic] , identifier[isWildcarded] operator[SEP] operator[SEP] {
identifier[_subscriptionRegistrar] operator[SEP] identifier[addNewConsumerForExpression] operator[SEP] identifier[topic] , identifier[mc] , identifier[selector] , identifier[isWildcarded] operator[SEP] operator[SEP] identifier[addConsumerForKnownTopicExpr] operator[SEP] identifier[topic] , identifier[selector] , identifier[isWildcarded] , identifier[mc] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_subscriptionRegistrar] operator[SEP] identifier[addNewConsumerForExpression] operator[SEP] identifier[topic] , identifier[mc] , identifier[selector] , identifier[isWildcarded] operator[SEP] operator[SEP] identifier[addConsumerForNewTopicExpr] operator[SEP] identifier[topic] , identifier[isWildcarded] , identifier[mc] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[_subscriptionRegistrar] operator[SEP] identifier[isKnownNonSelectorExpression] operator[SEP] identifier[topic] , identifier[isWildcarded] operator[SEP] operator[SEP] {
identifier[addConsumerForKnownTopicExpr] operator[SEP] identifier[topic] , identifier[selector] , identifier[isWildcarded] , identifier[mc] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[_subscriptionRegistrar] operator[SEP] identifier[isKnownSelectorExpression] operator[SEP] identifier[topic] , identifier[isWildcarded] operator[SEP] operator[SEP] {
identifier[_subscriptionRegistrar] operator[SEP] identifier[addNewConsumerForExpression] operator[SEP] identifier[topic] , identifier[mc] , identifier[selector] , identifier[isWildcarded] operator[SEP] operator[SEP] identifier[addConsumerForKnownTopicExpr] operator[SEP] identifier[topic] , identifier[selector] , identifier[isWildcarded] , identifier[mc] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_subscriptionRegistrar] operator[SEP] identifier[addNewConsumerForExpression] operator[SEP] identifier[topic] , identifier[mc] , identifier[selector] , identifier[isWildcarded] operator[SEP] operator[SEP] identifier[addConsumerForNewTopicExpr] operator[SEP] identifier[topic] , identifier[isWildcarded] , identifier[mc] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[selector] operator[SEP] identifier[mc] operator[SEP] identifier[setSelector] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isWildcarded] operator[SEP] identifier[mc] operator[SEP] identifier[setWildcarded] operator[SEP] operator[SEP] operator[SEP] identifier[mc] operator[SEP] identifier[setTopic] operator[SEP] identifier[topic] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
protected String escapeObjectName(@Nonnull ObjectName objectName) {
/** Add objectName's domain */
StringBuilder result = new StringBuilder();
StringUtils2.appendEscapedNonAlphaNumericChars(objectName.getDomain(), false, result);
/** Walk through (sorted) properties of the ObjectName and add values to the result */
List<String> keys = Collections.list(objectName.getKeyPropertyList().keys());
Collections.sort(keys);
for (Iterator<String> it = keys.iterator(); it.hasNext(); ) {
String propertyKey = it.next();
result.append('.');
StringUtils2.appendEscapedNonAlphaNumericChars(objectName.getKeyProperty(propertyKey), false, result);
}
return result.toString();
} | class class_name[name] begin[{]
method[escapeObjectName, return_type[type[String]], modifier[protected], parameter[objectName]] begin[{]
local_variable[type[StringBuilder], result]
call[StringUtils2.appendEscapedNonAlphaNumericChars, parameter[call[objectName.getDomain, parameter[]], literal[false], member[.result]]]
local_variable[type[List], keys]
call[Collections.sort, parameter[member[.keys]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=propertyKey)], 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=result, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=propertyKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getKeyProperty, postfix_operators=[], prefix_operators=[], qualifier=objectName, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendEscapedNonAlphaNumericChars, postfix_operators=[], prefix_operators=[], qualifier=StringUtils2, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[call[result.toString, parameter[]]]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[escapeObjectName] operator[SEP] annotation[@] identifier[Nonnull] identifier[ObjectName] identifier[objectName] operator[SEP] {
identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[StringUtils2] operator[SEP] identifier[appendEscapedNonAlphaNumericChars] operator[SEP] identifier[objectName] operator[SEP] identifier[getDomain] operator[SEP] operator[SEP] , literal[boolean] , identifier[result] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[keys] operator[=] identifier[Collections] operator[SEP] identifier[list] operator[SEP] identifier[objectName] operator[SEP] identifier[getKeyPropertyList] operator[SEP] operator[SEP] operator[SEP] identifier[keys] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[keys] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[it] operator[=] identifier[keys] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[propertyKey] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StringUtils2] operator[SEP] identifier[appendEscapedNonAlphaNumericChars] operator[SEP] identifier[objectName] operator[SEP] identifier[getKeyProperty] operator[SEP] identifier[propertyKey] operator[SEP] , literal[boolean] , identifier[result] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setCurrentObject(Object obj) {
if (((obj == null) && (this.nullString != null))
|| this.requiredType.isInstance(obj)
|| (obj instanceof String)
|| (obj instanceof File)
// || ((obj instanceof Task) && this.requiredType.isAssignableFrom(((Task) obj).getTaskResultType()))
) {
this.currentValue = obj;
} else {
throw new IllegalArgumentException("Object not of required type.");
}
} | class class_name[name] begin[{]
method[setCurrentObject, return_type[void], modifier[public], parameter[obj]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.obj], ==, literal[null]], &&, binary_operation[THIS[member[None.nullString]], !=, literal[null]]], ||, THIS[member[None.requiredType]call[None.isInstance, parameter[member[.obj]]]]], ||, binary_operation[member[.obj], instanceof, type[String]]], ||, binary_operation[member[.obj], instanceof, type[File]]]] begin[{]
assign[THIS[member[None.currentValue]], member[.obj]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Object not of required type.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setCurrentObject] operator[SEP] identifier[Object] identifier[obj] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[nullString] operator[!=] Other[null] operator[SEP] operator[SEP] operator[||] Keyword[this] operator[SEP] identifier[requiredType] operator[SEP] identifier[isInstance] operator[SEP] identifier[obj] operator[SEP] operator[||] operator[SEP] identifier[obj] Keyword[instanceof] identifier[String] operator[SEP] operator[||] operator[SEP] identifier[obj] Keyword[instanceof] identifier[File] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[currentValue] operator[=] identifier[obj] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
@BetaApi
public final Operation insertTargetInstance(
ProjectZoneName zone, TargetInstance targetInstanceResource) {
InsertTargetInstanceHttpRequest request =
InsertTargetInstanceHttpRequest.newBuilder()
.setZone(zone == null ? null : zone.toString())
.setTargetInstanceResource(targetInstanceResource)
.build();
return insertTargetInstance(request);
} | class class_name[name] begin[{]
method[insertTargetInstance, return_type[type[Operation]], modifier[final public], parameter[zone, targetInstanceResource]] begin[{]
local_variable[type[InsertTargetInstanceHttpRequest], request]
return[call[.insertTargetInstance, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[insertTargetInstance] operator[SEP] identifier[ProjectZoneName] identifier[zone] , identifier[TargetInstance] identifier[targetInstanceResource] operator[SEP] {
identifier[InsertTargetInstanceHttpRequest] identifier[request] operator[=] identifier[InsertTargetInstanceHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setZone] operator[SEP] identifier[zone] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[zone] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTargetInstanceResource] operator[SEP] identifier[targetInstanceResource] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[insertTargetInstance] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private void validateEntity(final DbEntity entity) throws DatabaseEngineException {
if (entity.getName() == null || entity.getName().length() == 0) {
throw new DatabaseEngineException("You have to define the entity name");
}
final int maxIdentSize = properties.getMaxIdentifierSize();
if (entity.getName().length() > maxIdentSize) {
throw new DatabaseEngineException(String.format("Entity '%s' exceeds the maximum number of characters (%d)", entity.getName(), maxIdentSize));
}
if (entity.getColumns().isEmpty()) {
throw new DatabaseEngineException("You have to specify at least one column");
}
int numberOfAutoIncs = 0;
for (DbColumn c : entity.getColumns()) {
if (c.getName() == null || c.getName().length() == 0) {
throw new DatabaseEngineException(String.format("Column in entity '%s' must have a name", entity.getName()));
}
if (c.getName().length() > maxIdentSize) {
throw new DatabaseEngineException(String.format("Column '%s' in entity '%s' exceeds the maximum number of characters (%d)", c.getName(), entity.getName(), maxIdentSize));
}
if (c.isAutoInc()) {
numberOfAutoIncs++;
}
}
if (numberOfAutoIncs > 1) {
throw new DatabaseEngineException("You can only define one auto incremented column");
}
// Index validation
List<DbIndex> indexes = entity.getIndexes();
if (!indexes.isEmpty()) {
for (DbIndex index : indexes) {
if (index.getColumns().isEmpty()) {
throw new DatabaseEngineException(String.format("You have to specify at least one column to create an index in entity '%s'", entity.getName()));
}
for (String column : index.getColumns()) {
if (column == null || column.length() == 0) {
throw new DatabaseEngineException(String.format("Column indexes must have a name in entity '%s'", entity.getName()));
}
}
}
}
// FK validation
List<DbFk> fks = entity.getFks();
if (!fks.isEmpty()) {
for (DbFk fk : fks) {
if (fk.getForeignTable() == null || fk.getForeignTable().length() == 0) {
throw new DatabaseEngineException(String.format("You have to specify the table when creating a Foreign Key in entity '%s'", entity.getName()));
}
if (fk.getLocalColumns().isEmpty()) {
throw new DatabaseEngineException(String.format("You must specify at least one local column when defining a Foreign Key in '%s'", entity.getName()));
}
if (fk.getForeignColumns().isEmpty()) {
throw new DatabaseEngineException(String.format("You must specify at least one foreign column when defining a Foreign Key in '%s'", entity.getName()));
}
if (fk.getLocalColumns().size() != fk.getForeignColumns().size()) {
throw new DatabaseEngineException(String.format("Number of local columns does not match foreign ones in entity '%s'", entity.getName()));
}
}
}
} | class class_name[name] begin[{]
method[validateEntity, return_type[void], modifier[private], parameter[entity]] begin[{]
if[binary_operation[binary_operation[call[entity.getName, parameter[]], ==, literal[null]], ||, binary_operation[call[entity.getName, parameter[]], ==, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You have to define the entity name")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], maxIdentSize]
if[binary_operation[call[entity.getName, parameter[]], >, member[.maxIdentSize]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity '%s' exceeds the maximum number of characters (%d)"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=maxIdentSize, 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=DatabaseEngineException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[entity.getColumns, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You have to specify at least one column")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], numberOfAutoIncs]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), 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="Column in entity '%s' must have a name"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=maxIdentSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), 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="Column '%s' in entity '%s' exceeds the maximum number of characters (%d)"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=maxIdentSize, 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=DatabaseEngineException, sub_type=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isAutoInc, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=numberOfAutoIncs, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DbColumn, sub_type=None))), label=None)
if[binary_operation[member[.numberOfAutoIncs], >, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You can only define one auto incremented column")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[List], indexes]
if[call[indexes.isEmpty, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You have to specify at least one column to create an index in entity '%s'"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Column indexes must have a name in entity '%s'"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=indexes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DbIndex, sub_type=None))), label=None)
else begin[{]
None
end[}]
local_variable[type[List], fks]
if[call[fks.isEmpty, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getForeignTable, postfix_operators=[], prefix_operators=[], qualifier=fk, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getForeignTable, postfix_operators=[], prefix_operators=[], qualifier=fk, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), 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="You have to specify the table when creating a Foreign Key in entity '%s'"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getLocalColumns, postfix_operators=[], prefix_operators=[], qualifier=fk, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You must specify at least one local column when defining a Foreign Key in '%s'"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getForeignColumns, postfix_operators=[], prefix_operators=[], qualifier=fk, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You must specify at least one foreign column when defining a Foreign Key in '%s'"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLocalColumns, postfix_operators=[], prefix_operators=[], qualifier=fk, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getForeignColumns, postfix_operators=[], prefix_operators=[], qualifier=fk, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Number of local columns does not match foreign ones in entity '%s'"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseEngineException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=fks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fk)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DbFk, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[validateEntity] operator[SEP] Keyword[final] identifier[DbEntity] identifier[entity] operator[SEP] Keyword[throws] identifier[DatabaseEngineException] {
Keyword[if] operator[SEP] identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[int] identifier[maxIdentSize] operator[=] identifier[properties] operator[SEP] identifier[getMaxIdentifierSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[maxIdentSize] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[maxIdentSize] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[entity] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[int] identifier[numberOfAutoIncs] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[DbColumn] identifier[c] operator[:] identifier[entity] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[maxIdentSize] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[maxIdentSize] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[isAutoInc] operator[SEP] operator[SEP] operator[SEP] {
identifier[numberOfAutoIncs] operator[++] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[numberOfAutoIncs] operator[>] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[DbIndex] operator[>] identifier[indexes] operator[=] identifier[entity] operator[SEP] identifier[getIndexes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[indexes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[DbIndex] identifier[index] operator[:] identifier[indexes] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[column] operator[:] identifier[index] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[column] operator[==] Other[null] operator[||] identifier[column] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
identifier[List] operator[<] identifier[DbFk] operator[>] identifier[fks] operator[=] identifier[entity] operator[SEP] identifier[getFks] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[fks] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[DbFk] identifier[fk] operator[:] identifier[fks] operator[SEP] {
Keyword[if] operator[SEP] identifier[fk] operator[SEP] identifier[getForeignTable] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[fk] operator[SEP] identifier[getForeignTable] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[fk] operator[SEP] identifier[getLocalColumns] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[fk] operator[SEP] identifier[getForeignColumns] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[fk] operator[SEP] identifier[getLocalColumns] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[fk] operator[SEP] identifier[getForeignColumns] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
|
@Override
public int determineRandomShardNumber(final Optional<Integer> optShardNumber, final int numShards)
{
Preconditions.checkArgument(numShards > 0);
Preconditions.checkNotNull(optShardNumber);
if (optShardNumber.isPresent())
{
final int shardNumber = optShardNumber.get();
if (shardNumber >= 0 && shardNumber < numShards)
{
return optShardNumber.get();
}
}
// Otherwise...
return generator.nextInt(numShards);
} | class class_name[name] begin[{]
method[determineRandomShardNumber, return_type[type[int]], modifier[public], parameter[optShardNumber, numShards]] begin[{]
call[Preconditions.checkArgument, parameter[binary_operation[member[.numShards], >, literal[0]]]]
call[Preconditions.checkNotNull, parameter[member[.optShardNumber]]]
if[call[optShardNumber.isPresent, parameter[]]] begin[{]
local_variable[type[int], shardNumber]
if[binary_operation[binary_operation[member[.shardNumber], >=, literal[0]], &&, binary_operation[member[.shardNumber], <, member[.numShards]]]] begin[{]
return[call[optShardNumber.get, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[call[generator.nextInt, parameter[member[.numShards]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[determineRandomShardNumber] operator[SEP] Keyword[final] identifier[Optional] operator[<] identifier[Integer] operator[>] identifier[optShardNumber] , Keyword[final] Keyword[int] identifier[numShards] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[numShards] operator[>] Other[0] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[optShardNumber] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[optShardNumber] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[shardNumber] operator[=] identifier[optShardNumber] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shardNumber] operator[>=] Other[0] operator[&&] identifier[shardNumber] operator[<] identifier[numShards] operator[SEP] {
Keyword[return] identifier[optShardNumber] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[generator] operator[SEP] identifier[nextInt] operator[SEP] identifier[numShards] operator[SEP] operator[SEP]
}
|
public static double[][] transpose(double[][] matrix){
//Get number of rows and columns of matrix
int numberOfRows = matrix.length;
int numberOfCols = matrix[0].length;
//Instantiate a unitMatrix of dimension dim
double[][] transpose = new double[numberOfCols][numberOfRows];
//Create unit matrix
for(int rowIndex = 0; rowIndex < numberOfRows; rowIndex++) {
for(int colIndex = 0; colIndex < numberOfCols; colIndex++) {
transpose[colIndex][rowIndex] = matrix[rowIndex][colIndex];
}
}
return transpose;
} | class class_name[name] begin[{]
method[transpose, return_type[type[double]], modifier[public static], parameter[matrix]] begin[{]
local_variable[type[int], numberOfRows]
local_variable[type[int], numberOfCols]
local_variable[type[double], transpose]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=transpose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=colIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=colIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=colIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfCols, 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=colIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=colIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfRows, 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=rowIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=rowIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.transpose]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[transpose] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[matrix] operator[SEP] {
Keyword[int] identifier[numberOfRows] operator[=] identifier[matrix] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[numberOfCols] operator[=] identifier[matrix] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[transpose] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numberOfCols] operator[SEP] operator[SEP] identifier[numberOfRows] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[rowIndex] operator[=] Other[0] operator[SEP] identifier[rowIndex] operator[<] identifier[numberOfRows] operator[SEP] identifier[rowIndex] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[colIndex] operator[=] Other[0] operator[SEP] identifier[colIndex] operator[<] identifier[numberOfCols] operator[SEP] identifier[colIndex] operator[++] operator[SEP] {
identifier[transpose] operator[SEP] identifier[colIndex] operator[SEP] operator[SEP] identifier[rowIndex] operator[SEP] operator[=] identifier[matrix] operator[SEP] identifier[rowIndex] operator[SEP] operator[SEP] identifier[colIndex] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[transpose] operator[SEP]
}
|
public T _get(long seqno) {
int index=index(seqno);
return index < 0? null : buf.get(index);
} | class class_name[name] begin[{]
method[_get, return_type[type[T]], modifier[public], parameter[seqno]] begin[{]
local_variable[type[int], index]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | Keyword[public] identifier[T] identifier[_get] operator[SEP] Keyword[long] identifier[seqno] operator[SEP] {
Keyword[int] identifier[index] operator[=] identifier[index] operator[SEP] identifier[seqno] operator[SEP] operator[SEP] Keyword[return] identifier[index] operator[<] Other[0] operator[?] Other[null] operator[:] identifier[buf] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
|
private static ModelNode responseNodeOnly(OperationResponse or) {
ModelNode result = or.getResponseNode();
try {
or.close();
} catch (IOException e) {
ControllerClientLogger.ROOT_LOGGER.debugf(e, "Caught exception closing %s whose associated streams, " +
"if any, were not wanted", or);
}
return result;
} | class class_name[name] begin[{]
method[responseNodeOnly, return_type[type[ModelNode]], modifier[private static], parameter[or]] begin[{]
local_variable[type[ModelNode], result]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=or, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Caught exception closing %s whose associated streams, "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="if any, were not wanted"), operator=+), MemberReference(member=or, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debugf, postfix_operators=[], prefix_operators=[], qualifier=ControllerClientLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[ModelNode] identifier[responseNodeOnly] operator[SEP] identifier[OperationResponse] identifier[or] operator[SEP] {
identifier[ModelNode] identifier[result] operator[=] identifier[or] operator[SEP] identifier[getResponseNode] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[or] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[ControllerClientLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[debugf] operator[SEP] identifier[e] , literal[String] operator[+] literal[String] , identifier[or] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
protected static EndHead treeToDependencyHelper(Tree tree, List<IntDependency> depList, int loc, Index<String> wordIndex, Index<String> tagIndex) {
// try {
// PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out,"GB18030"),true);
// tree.pennPrint(pw);
// }
// catch (UnsupportedEncodingException e) {}
if (tree.isLeaf() || tree.isPreTerminal()) {
EndHead tempEndHead = new EndHead();
tempEndHead.head = loc;
tempEndHead.end = loc + 1;
return tempEndHead;
}
Tree[] kids = tree.children();
if (kids.length == 1) {
return treeToDependencyHelper(kids[0], depList, loc, wordIndex, tagIndex);
}
EndHead tempEndHead = treeToDependencyHelper(kids[0], depList, loc, wordIndex, tagIndex);
int lHead = tempEndHead.head;
int split = tempEndHead.end;
tempEndHead = treeToDependencyHelper(kids[1], depList, tempEndHead.end, wordIndex, tagIndex);
int end = tempEndHead.end;
int rHead = tempEndHead.head;
String hTag = ((HasTag) tree.label()).tag();
String lTag = ((HasTag) kids[0].label()).tag();
String rTag = ((HasTag) kids[1].label()).tag();
String hWord = ((HasWord) tree.label()).word();
String lWord = ((HasWord) kids[0].label()).word();
String rWord = ((HasWord) kids[1].label()).word();
boolean leftHeaded = hWord.equals(lWord);
String aTag = (leftHeaded ? rTag : lTag);
String aWord = (leftHeaded ? rWord : lWord);
int hT = tagIndex.indexOf(hTag);
int aT = tagIndex.indexOf(aTag);
int hW = (wordIndex.contains(hWord) ? wordIndex.indexOf(hWord) : wordIndex.indexOf(Lexicon.UNKNOWN_WORD));
int aW = (wordIndex.contains(aWord) ? wordIndex.indexOf(aWord) : wordIndex.indexOf(Lexicon.UNKNOWN_WORD));
int head = (leftHeaded ? lHead : rHead);
int arg = (leftHeaded ? rHead : lHead);
IntDependency dependency = new IntDependency(hW, hT, aW, aT, leftHeaded, (leftHeaded ? split - head - 1 : head - split));
depList.add(dependency);
IntDependency stopL = new IntDependency(aW, aT, STOP_WORD_INT, STOP_TAG_INT, false, (leftHeaded ? arg - split : arg - loc));
depList.add(stopL);
IntDependency stopR = new IntDependency(aW, aT, STOP_WORD_INT, STOP_TAG_INT, true, (leftHeaded ? end - arg - 1 : split - arg - 1));
depList.add(stopR);
//System.out.println("Adding: "+dependency+" at "+tree.label());
tempEndHead.head = head;
return tempEndHead;
} | class class_name[name] begin[{]
method[treeToDependencyHelper, return_type[type[EndHead]], modifier[static protected], parameter[tree, depList, loc, wordIndex, tagIndex]] begin[{]
if[binary_operation[call[tree.isLeaf, parameter[]], ||, call[tree.isPreTerminal, parameter[]]]] begin[{]
local_variable[type[EndHead], tempEndHead]
assign[member[tempEndHead.head], member[.loc]]
assign[member[tempEndHead.end], binary_operation[member[.loc], +, literal[1]]]
return[member[.tempEndHead]]
else begin[{]
None
end[}]
local_variable[type[Tree], kids]
if[binary_operation[member[kids.length], ==, literal[1]]] begin[{]
return[call[.treeToDependencyHelper, parameter[member[.kids], member[.depList], member[.loc], member[.wordIndex], member[.tagIndex]]]]
else begin[{]
None
end[}]
local_variable[type[EndHead], tempEndHead]
local_variable[type[int], lHead]
local_variable[type[int], split]
assign[member[.tempEndHead], call[.treeToDependencyHelper, parameter[member[.kids], member[.depList], member[tempEndHead.end], member[.wordIndex], member[.tagIndex]]]]
local_variable[type[int], end]
local_variable[type[int], rHead]
local_variable[type[String], hTag]
local_variable[type[String], lTag]
local_variable[type[String], rTag]
local_variable[type[String], hWord]
local_variable[type[String], lWord]
local_variable[type[String], rWord]
local_variable[type[boolean], leftHeaded]
local_variable[type[String], aTag]
local_variable[type[String], aWord]
local_variable[type[int], hT]
local_variable[type[int], aT]
local_variable[type[int], hW]
local_variable[type[int], aW]
local_variable[type[int], head]
local_variable[type[int], arg]
local_variable[type[IntDependency], dependency]
call[depList.add, parameter[member[.dependency]]]
local_variable[type[IntDependency], stopL]
call[depList.add, parameter[member[.stopL]]]
local_variable[type[IntDependency], stopR]
call[depList.add, parameter[member[.stopR]]]
assign[member[tempEndHead.head], member[.head]]
return[member[.tempEndHead]]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[EndHead] identifier[treeToDependencyHelper] operator[SEP] identifier[Tree] identifier[tree] , identifier[List] operator[<] identifier[IntDependency] operator[>] identifier[depList] , Keyword[int] identifier[loc] , identifier[Index] operator[<] identifier[String] operator[>] identifier[wordIndex] , identifier[Index] operator[<] identifier[String] operator[>] identifier[tagIndex] operator[SEP] {
Keyword[if] operator[SEP] identifier[tree] operator[SEP] identifier[isLeaf] operator[SEP] operator[SEP] operator[||] identifier[tree] operator[SEP] identifier[isPreTerminal] operator[SEP] operator[SEP] operator[SEP] {
identifier[EndHead] identifier[tempEndHead] operator[=] Keyword[new] identifier[EndHead] operator[SEP] operator[SEP] operator[SEP] identifier[tempEndHead] operator[SEP] identifier[head] operator[=] identifier[loc] operator[SEP] identifier[tempEndHead] operator[SEP] identifier[end] operator[=] identifier[loc] operator[+] Other[1] operator[SEP] Keyword[return] identifier[tempEndHead] operator[SEP]
}
identifier[Tree] operator[SEP] operator[SEP] identifier[kids] operator[=] identifier[tree] operator[SEP] identifier[children] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[kids] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] {
Keyword[return] identifier[treeToDependencyHelper] operator[SEP] identifier[kids] operator[SEP] Other[0] operator[SEP] , identifier[depList] , identifier[loc] , identifier[wordIndex] , identifier[tagIndex] operator[SEP] operator[SEP]
}
identifier[EndHead] identifier[tempEndHead] operator[=] identifier[treeToDependencyHelper] operator[SEP] identifier[kids] operator[SEP] Other[0] operator[SEP] , identifier[depList] , identifier[loc] , identifier[wordIndex] , identifier[tagIndex] operator[SEP] operator[SEP] Keyword[int] identifier[lHead] operator[=] identifier[tempEndHead] operator[SEP] identifier[head] operator[SEP] Keyword[int] identifier[split] operator[=] identifier[tempEndHead] operator[SEP] identifier[end] operator[SEP] identifier[tempEndHead] operator[=] identifier[treeToDependencyHelper] operator[SEP] identifier[kids] operator[SEP] Other[1] operator[SEP] , identifier[depList] , identifier[tempEndHead] operator[SEP] identifier[end] , identifier[wordIndex] , identifier[tagIndex] operator[SEP] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[tempEndHead] operator[SEP] identifier[end] operator[SEP] Keyword[int] identifier[rHead] operator[=] identifier[tempEndHead] operator[SEP] identifier[head] operator[SEP] identifier[String] identifier[hTag] operator[=] operator[SEP] operator[SEP] identifier[HasTag] operator[SEP] identifier[tree] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tag] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[lTag] operator[=] operator[SEP] operator[SEP] identifier[HasTag] operator[SEP] identifier[kids] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tag] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[rTag] operator[=] operator[SEP] operator[SEP] identifier[HasTag] operator[SEP] identifier[kids] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tag] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[hWord] operator[=] operator[SEP] operator[SEP] identifier[HasWord] operator[SEP] identifier[tree] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[word] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[lWord] operator[=] operator[SEP] operator[SEP] identifier[HasWord] operator[SEP] identifier[kids] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[word] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[rWord] operator[=] operator[SEP] operator[SEP] identifier[HasWord] operator[SEP] identifier[kids] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[word] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[leftHeaded] operator[=] identifier[hWord] operator[SEP] identifier[equals] operator[SEP] identifier[lWord] operator[SEP] operator[SEP] identifier[String] identifier[aTag] operator[=] operator[SEP] identifier[leftHeaded] operator[?] identifier[rTag] operator[:] identifier[lTag] operator[SEP] operator[SEP] identifier[String] identifier[aWord] operator[=] operator[SEP] identifier[leftHeaded] operator[?] identifier[rWord] operator[:] identifier[lWord] operator[SEP] operator[SEP] Keyword[int] identifier[hT] operator[=] identifier[tagIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[hTag] operator[SEP] operator[SEP] Keyword[int] identifier[aT] operator[=] identifier[tagIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[aTag] operator[SEP] operator[SEP] Keyword[int] identifier[hW] operator[=] operator[SEP] identifier[wordIndex] operator[SEP] identifier[contains] operator[SEP] identifier[hWord] operator[SEP] operator[?] identifier[wordIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[hWord] operator[SEP] operator[:] identifier[wordIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[Lexicon] operator[SEP] identifier[UNKNOWN_WORD] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[aW] operator[=] operator[SEP] identifier[wordIndex] operator[SEP] identifier[contains] operator[SEP] identifier[aWord] operator[SEP] operator[?] identifier[wordIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[aWord] operator[SEP] operator[:] identifier[wordIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[Lexicon] operator[SEP] identifier[UNKNOWN_WORD] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[head] operator[=] operator[SEP] identifier[leftHeaded] operator[?] identifier[lHead] operator[:] identifier[rHead] operator[SEP] operator[SEP] Keyword[int] identifier[arg] operator[=] operator[SEP] identifier[leftHeaded] operator[?] identifier[rHead] operator[:] identifier[lHead] operator[SEP] operator[SEP] identifier[IntDependency] identifier[dependency] operator[=] Keyword[new] identifier[IntDependency] operator[SEP] identifier[hW] , identifier[hT] , identifier[aW] , identifier[aT] , identifier[leftHeaded] , operator[SEP] identifier[leftHeaded] operator[?] identifier[split] operator[-] identifier[head] operator[-] Other[1] operator[:] identifier[head] operator[-] identifier[split] operator[SEP] operator[SEP] operator[SEP] identifier[depList] operator[SEP] identifier[add] operator[SEP] identifier[dependency] operator[SEP] operator[SEP] identifier[IntDependency] identifier[stopL] operator[=] Keyword[new] identifier[IntDependency] operator[SEP] identifier[aW] , identifier[aT] , identifier[STOP_WORD_INT] , identifier[STOP_TAG_INT] , literal[boolean] , operator[SEP] identifier[leftHeaded] operator[?] identifier[arg] operator[-] identifier[split] operator[:] identifier[arg] operator[-] identifier[loc] operator[SEP] operator[SEP] operator[SEP] identifier[depList] operator[SEP] identifier[add] operator[SEP] identifier[stopL] operator[SEP] operator[SEP] identifier[IntDependency] identifier[stopR] operator[=] Keyword[new] identifier[IntDependency] operator[SEP] identifier[aW] , identifier[aT] , identifier[STOP_WORD_INT] , identifier[STOP_TAG_INT] , literal[boolean] , operator[SEP] identifier[leftHeaded] operator[?] identifier[end] operator[-] identifier[arg] operator[-] Other[1] operator[:] identifier[split] operator[-] identifier[arg] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[depList] operator[SEP] identifier[add] operator[SEP] identifier[stopR] operator[SEP] operator[SEP] identifier[tempEndHead] operator[SEP] identifier[head] operator[=] identifier[head] operator[SEP] Keyword[return] identifier[tempEndHead] operator[SEP]
}
|
@Override
public Integer transformOut(JdbcPreparedStatementFactory jpsf, Integer attrOut) throws CpoException {
logger.debug("Inside TransformNoOp::transformOut(JdbcPreparedStatementFactory, " + attrOut + ");");
return attrOut;
} | class class_name[name] begin[{]
method[transformOut, return_type[type[Integer]], modifier[public], parameter[jpsf, attrOut]] begin[{]
call[logger.debug, parameter[binary_operation[binary_operation[literal["Inside TransformNoOp::transformOut(JdbcPreparedStatementFactory, "], +, member[.attrOut]], +, literal[");"]]]]
return[member[.attrOut]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Integer] identifier[transformOut] operator[SEP] identifier[JdbcPreparedStatementFactory] identifier[jpsf] , identifier[Integer] identifier[attrOut] operator[SEP] Keyword[throws] identifier[CpoException] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[attrOut] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[attrOut] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.