code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public boolean contains(G g) {
for (Map.Entry<G,Integer> e : graphIndices.entrySet()) {
if (isoTest.areIsomorphic(g, e.getKey()))
return true;
}
return false;
} | class class_name[name] begin[{]
method[contains, return_type[type[boolean]], modifier[public], parameter[g]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=areIsomorphic, postfix_operators=[], prefix_operators=[], qualifier=isoTest, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=graphIndices, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=G, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[contains] operator[SEP] identifier[G] identifier[g] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[G] , identifier[Integer] operator[>] identifier[e] operator[:] identifier[graphIndices] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isoTest] operator[SEP] identifier[areIsomorphic] operator[SEP] identifier[g] , identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void setClickListener() {
m_ok.addClickListener(new Button.ClickListener() {
private static final long serialVersionUID = 6621475980210242125L;
public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
try {
CmsResourceFilter filter = getType() == null
? CmsResourceFilter.ALL
: CmsResourceFilter.requireType(getType());
results.addResult(
new CmsResourceTypeStatResult(
getType(),
(String)m_siteSelect.getValue(),
getCmsObject().readResources("/", filter, true).size()));
m_results.setVisible(true);
results.setVerticalLayout(m_resLayout, false);
} catch (CmsException e) {
LOG.error("Unable to read resource tree", e);
}
}
});
} | class class_name[name] begin[{]
method[setClickListener, return_type[void], modifier[private], parameter[]] begin[{]
call[m_ok.addClickListener, parameter[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6621475980210242125L), name=serialVersionUID)], documentation=None, modifiers={'final', 'private', 'static'}, type=BasicType(dimensions=[], name=long)), MethodDeclaration(annotations=[], body=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=requireType, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[], type_arguments=None), if_true=MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])), name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResourceFilter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=m_siteSelect, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), MethodInvocation(arguments=[], member=getCmsObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=readResources, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsResourceTypeStatResult, sub_type=None))], member=addResult, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setVisible, postfix_operators=[], prefix_operators=[], qualifier=m_results, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_resLayout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setVerticalLayout, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to read resource tree"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=buttonClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=vaadin, sub_type=ReferenceType(arguments=None, dimensions=None, name=ui, sub_type=ReferenceType(arguments=None, dimensions=None, name=Button, sub_type=ReferenceType(arguments=None, dimensions=None, name=ClickEvent, sub_type=None))))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Button, sub_type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None)))]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[setClickListener] operator[SEP] operator[SEP] {
identifier[m_ok] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[Button] operator[SEP] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[private] Keyword[static] Keyword[final] Keyword[long] identifier[serialVersionUID] operator[=] Other[6621475980210242125L] operator[SEP] Keyword[public] Keyword[void] identifier[buttonClick] operator[SEP] identifier[com] operator[SEP] identifier[vaadin] operator[SEP] identifier[ui] operator[SEP] identifier[Button] operator[SEP] identifier[ClickEvent] identifier[event] operator[SEP] {
Keyword[try] {
identifier[CmsResourceFilter] identifier[filter] operator[=] identifier[getType] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] identifier[CmsResourceFilter] operator[SEP] identifier[ALL] operator[:] identifier[CmsResourceFilter] operator[SEP] identifier[requireType] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[addResult] operator[SEP] Keyword[new] identifier[CmsResourceTypeStatResult] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , operator[SEP] identifier[String] operator[SEP] identifier[m_siteSelect] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[getCmsObject] operator[SEP] operator[SEP] operator[SEP] identifier[readResources] operator[SEP] literal[String] , identifier[filter] , literal[boolean] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_results] operator[SEP] identifier[setVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[setVerticalLayout] operator[SEP] identifier[m_resLayout] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
@Override
public SqlContext param(final String parameterName, final Object value, final int sqlType) {
if (value instanceof Optional) {
Optional<?> optionalValue = (Optional<?>) value;
if (optionalValue.isPresent()) {
param(new Parameter(parameterName, optionalValue.get(), sqlType));
} else {
param(new Parameter(parameterName, null));
}
return this;
} else {
return param(new Parameter(parameterName, value, sqlType));
}
} | class class_name[name] begin[{]
method[param, return_type[type[SqlContext]], modifier[public], parameter[parameterName, value, sqlType]] begin[{]
if[binary_operation[member[.value], instanceof, type[Optional]]] begin[{]
local_variable[type[Optional], optionalValue]
if[call[optionalValue.isPresent, parameter[]]] begin[{]
call[.param, parameter[ClassCreator(arguments=[MemberReference(member=parameterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=optionalValue, selectors=[], type_arguments=None), MemberReference(member=sqlType, 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=Parameter, sub_type=None))]]
else begin[{]
call[.param, parameter[ClassCreator(arguments=[MemberReference(member=parameterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Parameter, sub_type=None))]]
end[}]
return[THIS[]]
else begin[{]
return[call[.param, parameter[ClassCreator(arguments=[MemberReference(member=parameterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sqlType, 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=Parameter, sub_type=None))]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SqlContext] identifier[param] operator[SEP] Keyword[final] identifier[String] identifier[parameterName] , Keyword[final] identifier[Object] identifier[value] , Keyword[final] Keyword[int] identifier[sqlType] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Optional] operator[SEP] {
identifier[Optional] operator[<] operator[?] operator[>] identifier[optionalValue] operator[=] operator[SEP] identifier[Optional] operator[<] operator[?] operator[>] operator[SEP] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[optionalValue] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[param] operator[SEP] Keyword[new] identifier[Parameter] operator[SEP] identifier[parameterName] , identifier[optionalValue] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[sqlType] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[param] operator[SEP] Keyword[new] identifier[Parameter] operator[SEP] identifier[parameterName] , Other[null] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[param] operator[SEP] Keyword[new] identifier[Parameter] operator[SEP] identifier[parameterName] , identifier[value] , identifier[sqlType] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private <R> CompletableFuture<R> supplyAsync(Callable<R> operation, String... segmentNames) {
Exceptions.checkNotClosed(this.closed.get(), this);
return this.taskProcessor.add(Arrays.asList(segmentNames), () -> execute(operation));
} | class class_name[name] begin[{]
method[supplyAsync, return_type[type[CompletableFuture]], modifier[private], parameter[operation, segmentNames]] begin[{]
call[Exceptions.checkNotClosed, parameter[THIS[member[None.closed]call[None.get, parameter[]]], THIS[]]]
return[THIS[member[None.taskProcessor]call[None.add, parameter[call[Arrays.asList, parameter[member[.segmentNames]]], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[])]]]]
end[}]
END[}] | Keyword[private] operator[<] identifier[R] operator[>] identifier[CompletableFuture] operator[<] identifier[R] operator[>] identifier[supplyAsync] operator[SEP] identifier[Callable] operator[<] identifier[R] operator[>] identifier[operation] , identifier[String] operator[...] identifier[segmentNames] operator[SEP] {
identifier[Exceptions] operator[SEP] identifier[checkNotClosed] operator[SEP] Keyword[this] operator[SEP] identifier[closed] operator[SEP] identifier[get] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[taskProcessor] operator[SEP] identifier[add] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[segmentNames] operator[SEP] , operator[SEP] operator[SEP] operator[->] identifier[execute] operator[SEP] identifier[operation] operator[SEP] operator[SEP] operator[SEP]
}
|
public List<String> getServicesIDByCategory(String category) {
Set<String> servicesID = services.keySet();
Iterator<String> it = servicesID.iterator();
List<String> ids = new ArrayList<String>();
if (category == null) {
return ids;
}
String key;
while (it.hasNext()) {
key = it.next();
DescribeService service = services.get(key);
if (service.containsCategory(category)) {
ids.add(key);
}
}
return ids;
} | class class_name[name] begin[{]
method[getServicesIDByCategory, return_type[type[List]], modifier[public], parameter[category]] begin[{]
local_variable[type[Set], servicesID]
local_variable[type[Iterator], it]
local_variable[type[List], ids]
if[binary_operation[member[.category], ==, literal[null]]] begin[{]
return[member[.ids]]
else begin[{]
None
end[}]
local_variable[type[String], key]
while[call[it.hasNext, parameter[]]] begin[{]
assign[member[.key], call[it.next, parameter[]]]
local_variable[type[DescribeService], service]
if[call[service.containsCategory, parameter[member[.category]]]] begin[{]
call[ids.add, parameter[member[.key]]]
else begin[{]
None
end[}]
end[}]
return[member[.ids]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getServicesIDByCategory] operator[SEP] identifier[String] identifier[category] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[servicesID] operator[=] identifier[services] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[it] operator[=] identifier[servicesID] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[ids] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[category] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[ids] operator[SEP]
}
identifier[String] identifier[key] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[key] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[DescribeService] identifier[service] operator[=] identifier[services] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[service] operator[SEP] identifier[containsCategory] operator[SEP] identifier[category] operator[SEP] operator[SEP] {
identifier[ids] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[ids] operator[SEP]
}
|
private static StringMap filterParam(StringMap params) {
final StringMap ret = new StringMap();
if (params == null) {
return ret;
}
params.forEach(new StringMap.Consumer() {
@Override
public void accept(String key, Object value) {
if (value == null) {
return;
}
String val = value.toString();
if ((key.startsWith("x:") || key.startsWith("x-qn-meta-")) && !val.equals("")) {
ret.put(key, val);
}
}
});
return ret;
} | class class_name[name] begin[{]
method[filterParam, return_type[type[StringMap]], modifier[private static], parameter[params]] begin[{]
local_variable[type[StringMap], ret]
if[binary_operation[member[.params], ==, literal[null]]] begin[{]
return[member[.ret]]
else begin[{]
None
end[}]
call[params.forEach, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, 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=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="x:")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="x-qn-meta-")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=val, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers=set(), name=key, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=value, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringMap, sub_type=ReferenceType(arguments=None, dimensions=None, name=Consumer, sub_type=None)))]]
return[member[.ret]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[StringMap] identifier[filterParam] operator[SEP] identifier[StringMap] identifier[params] operator[SEP] {
Keyword[final] identifier[StringMap] identifier[ret] operator[=] Keyword[new] identifier[StringMap] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[ret] operator[SEP]
}
identifier[params] operator[SEP] identifier[forEach] operator[SEP] Keyword[new] identifier[StringMap] operator[SEP] identifier[Consumer] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[accept] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[String] identifier[val] operator[=] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[val] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[ret] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[val] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
public ChannelManagementSyncClient build() {
final Builder okHttpClientBuilder = new Builder();
okHttpClientBuilder
.addInterceptor(buildAuthenticationInterceptor(channelTokenSupplier))
.addInterceptor(buildLoggingInterceptor());
final OkHttpClient okHttpClient = okHttpClientBuilder.build();
final Retrofit.Builder retrofitBuilder = createDefaultRetrofitBuilder();
retrofitBuilder.client(okHttpClient);
retrofitBuilder.baseUrl(apiEndPoint.toString());
final Retrofit retrofit = retrofitBuilder.build();
final ChannelManagementClientRetrofitIface retrofitIface =
retrofit.create(ChannelManagementClientRetrofitIface.class);
return ChannelManagementSyncClientImpl.of(retrofitIface);
} | class class_name[name] begin[{]
method[build, return_type[type[ChannelManagementSyncClient]], modifier[public], parameter[]] begin[{]
local_variable[type[Builder], okHttpClientBuilder]
call[okHttpClientBuilder.addInterceptor, parameter[call[.buildAuthenticationInterceptor, parameter[member[.channelTokenSupplier]]]]]
local_variable[type[OkHttpClient], okHttpClient]
local_variable[type[Retrofit], retrofitBuilder]
call[retrofitBuilder.client, parameter[member[.okHttpClient]]]
call[retrofitBuilder.baseUrl, parameter[call[apiEndPoint.toString, parameter[]]]]
local_variable[type[Retrofit], retrofit]
local_variable[type[ChannelManagementClientRetrofitIface], retrofitIface]
return[call[ChannelManagementSyncClientImpl.of, parameter[member[.retrofitIface]]]]
end[}]
END[}] | Keyword[public] identifier[ChannelManagementSyncClient] identifier[build] operator[SEP] operator[SEP] {
Keyword[final] identifier[Builder] identifier[okHttpClientBuilder] operator[=] Keyword[new] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[okHttpClientBuilder] operator[SEP] identifier[addInterceptor] operator[SEP] identifier[buildAuthenticationInterceptor] operator[SEP] identifier[channelTokenSupplier] operator[SEP] operator[SEP] operator[SEP] identifier[addInterceptor] operator[SEP] identifier[buildLoggingInterceptor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[OkHttpClient] identifier[okHttpClient] operator[=] identifier[okHttpClientBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Retrofit] operator[SEP] identifier[Builder] identifier[retrofitBuilder] operator[=] identifier[createDefaultRetrofitBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[retrofitBuilder] operator[SEP] identifier[client] operator[SEP] identifier[okHttpClient] operator[SEP] operator[SEP] identifier[retrofitBuilder] operator[SEP] identifier[baseUrl] operator[SEP] identifier[apiEndPoint] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Retrofit] identifier[retrofit] operator[=] identifier[retrofitBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ChannelManagementClientRetrofitIface] identifier[retrofitIface] operator[=] identifier[retrofit] operator[SEP] identifier[create] operator[SEP] identifier[ChannelManagementClientRetrofitIface] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[ChannelManagementSyncClientImpl] operator[SEP] identifier[of] operator[SEP] identifier[retrofitIface] operator[SEP] operator[SEP]
}
|
public List<TaskDetails> fetchTaskDetails(String cluster, String jobId)
throws IOException {
String urlString = String.format("http://%s/api/v1/tasks/%s/%s",
apiHostname, cluster, jobId);
return retrieveTaskDetailsFromUrl(urlString);
} | class class_name[name] begin[{]
method[fetchTaskDetails, return_type[type[List]], modifier[public], parameter[cluster, jobId]] begin[{]
local_variable[type[String], urlString]
return[call[.retrieveTaskDetailsFromUrl, parameter[member[.urlString]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[TaskDetails] operator[>] identifier[fetchTaskDetails] operator[SEP] identifier[String] identifier[cluster] , identifier[String] identifier[jobId] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[urlString] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[apiHostname] , identifier[cluster] , identifier[jobId] operator[SEP] operator[SEP] Keyword[return] identifier[retrieveTaskDetailsFromUrl] operator[SEP] identifier[urlString] operator[SEP] operator[SEP]
}
|
public JPanel addScrollbars(JComponent screen)
{
Dimension dimension = screen.getPreferredSize();
if ((dimension.height == 0) && (dimension.width == 0))
dimension = JScreenConstants.PREFERRED_SCREEN_SIZE;
else if ((screen.getBounds().width != 0) && (screen.getBounds().height != 0))
{
dimension.width = screen.getBounds().width;
dimension.height = screen.getBounds().height;
}
dimension.width = Math.max(JScreenConstants.MIN_SCREEN_SIZE.width, Math.min(dimension.width + 20, JScreenConstants.PREFERRED_SCREEN_SIZE.width));
dimension.height = Math.max(JScreenConstants.MIN_SCREEN_SIZE.height, Math.min(dimension.height + 20, JScreenConstants.PREFERRED_SCREEN_SIZE.height));
JScrollPane scrollpane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
if (dimension != null)
scrollpane.setPreferredSize(dimension);
scrollpane.setAlignmentX(Component.LEFT_ALIGNMENT);
scrollpane.getViewport().add(screen);
JPanel panel = new JPanel();
panel.setAlignmentX(Component.LEFT_ALIGNMENT);
panel.add(scrollpane);
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.setOpaque(false);
screen.setOpaque(false);
scrollpane.setOpaque(false);
scrollpane.getViewport().setOpaque(false);
return panel;
} | class class_name[name] begin[{]
method[addScrollbars, return_type[type[JPanel]], modifier[public], parameter[screen]] begin[{]
local_variable[type[Dimension], dimension]
if[binary_operation[binary_operation[member[dimension.height], ==, literal[0]], &&, binary_operation[member[dimension.width], ==, literal[0]]]] begin[{]
assign[member[.dimension], member[JScreenConstants.PREFERRED_SCREEN_SIZE]]
else begin[{]
if[binary_operation[binary_operation[call[screen.getBounds, parameter[]], !=, literal[0]], &&, binary_operation[call[screen.getBounds, parameter[]], !=, literal[0]]]] begin[{]
assign[member[dimension.width], call[screen.getBounds, parameter[]]]
assign[member[dimension.height], call[screen.getBounds, parameter[]]]
else begin[{]
None
end[}]
end[}]
assign[member[dimension.width], call[Math.max, parameter[member[JScreenConstants.MIN_SCREEN_SIZE.width], call[Math.min, parameter[binary_operation[member[dimension.width], +, literal[20]], member[JScreenConstants.PREFERRED_SCREEN_SIZE.width]]]]]]
assign[member[dimension.height], call[Math.max, parameter[member[JScreenConstants.MIN_SCREEN_SIZE.height], call[Math.min, parameter[binary_operation[member[dimension.height], +, literal[20]], member[JScreenConstants.PREFERRED_SCREEN_SIZE.height]]]]]]
local_variable[type[JScrollPane], scrollpane]
if[binary_operation[member[.dimension], !=, literal[null]]] begin[{]
call[scrollpane.setPreferredSize, parameter[member[.dimension]]]
else begin[{]
None
end[}]
call[scrollpane.setAlignmentX, parameter[member[Component.LEFT_ALIGNMENT]]]
call[scrollpane.getViewport, parameter[]]
local_variable[type[JPanel], panel]
call[panel.setAlignmentX, parameter[member[Component.LEFT_ALIGNMENT]]]
call[panel.add, parameter[member[.scrollpane]]]
call[panel.setLayout, parameter[ClassCreator(arguments=[MemberReference(member=panel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=Y_AXIS, postfix_operators=[], prefix_operators=[], qualifier=BoxLayout, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BoxLayout, sub_type=None))]]
call[panel.setOpaque, parameter[literal[false]]]
call[screen.setOpaque, parameter[literal[false]]]
call[scrollpane.setOpaque, parameter[literal[false]]]
call[scrollpane.getViewport, parameter[]]
return[member[.panel]]
end[}]
END[}] | Keyword[public] identifier[JPanel] identifier[addScrollbars] operator[SEP] identifier[JComponent] identifier[screen] operator[SEP] {
identifier[Dimension] identifier[dimension] operator[=] identifier[screen] operator[SEP] identifier[getPreferredSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[dimension] operator[SEP] identifier[height] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[dimension] operator[SEP] identifier[width] operator[==] Other[0] operator[SEP] operator[SEP] identifier[dimension] operator[=] identifier[JScreenConstants] operator[SEP] identifier[PREFERRED_SCREEN_SIZE] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[screen] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] identifier[width] operator[!=] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[screen] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] identifier[height] operator[!=] Other[0] operator[SEP] operator[SEP] {
identifier[dimension] operator[SEP] identifier[width] operator[=] identifier[screen] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] identifier[width] operator[SEP] identifier[dimension] operator[SEP] identifier[height] operator[=] identifier[screen] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] identifier[height] operator[SEP]
}
identifier[dimension] operator[SEP] identifier[width] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[JScreenConstants] operator[SEP] identifier[MIN_SCREEN_SIZE] operator[SEP] identifier[width] , identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[dimension] operator[SEP] identifier[width] operator[+] Other[20] , identifier[JScreenConstants] operator[SEP] identifier[PREFERRED_SCREEN_SIZE] operator[SEP] identifier[width] operator[SEP] operator[SEP] operator[SEP] identifier[dimension] operator[SEP] identifier[height] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[JScreenConstants] operator[SEP] identifier[MIN_SCREEN_SIZE] operator[SEP] identifier[height] , identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[dimension] operator[SEP] identifier[height] operator[+] Other[20] , identifier[JScreenConstants] operator[SEP] identifier[PREFERRED_SCREEN_SIZE] operator[SEP] identifier[height] operator[SEP] operator[SEP] operator[SEP] identifier[JScrollPane] identifier[scrollpane] operator[=] Keyword[new] identifier[JScrollPane] operator[SEP] identifier[ScrollPaneConstants] operator[SEP] identifier[VERTICAL_SCROLLBAR_AS_NEEDED] , identifier[ScrollPaneConstants] operator[SEP] identifier[HORIZONTAL_SCROLLBAR_AS_NEEDED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dimension] operator[!=] Other[null] operator[SEP] identifier[scrollpane] operator[SEP] identifier[setPreferredSize] operator[SEP] identifier[dimension] operator[SEP] operator[SEP] identifier[scrollpane] operator[SEP] identifier[setAlignmentX] operator[SEP] identifier[Component] operator[SEP] identifier[LEFT_ALIGNMENT] operator[SEP] operator[SEP] identifier[scrollpane] operator[SEP] identifier[getViewport] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[screen] operator[SEP] operator[SEP] identifier[JPanel] identifier[panel] operator[=] Keyword[new] identifier[JPanel] operator[SEP] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[setAlignmentX] operator[SEP] identifier[Component] operator[SEP] identifier[LEFT_ALIGNMENT] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[add] operator[SEP] identifier[scrollpane] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[BoxLayout] operator[SEP] identifier[panel] , identifier[BoxLayout] operator[SEP] identifier[Y_AXIS] operator[SEP] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[screen] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[scrollpane] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[scrollpane] operator[SEP] identifier[getViewport] operator[SEP] operator[SEP] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[panel] operator[SEP]
}
|
protected void compareComment(Comment control, Comment test,
DifferenceListener listener) throws DifferenceFoundException {
if (!XMLUnit.getIgnoreComments()) {
compareCharacterData(control, test, listener, COMMENT_VALUE);
}
} | class class_name[name] begin[{]
method[compareComment, return_type[void], modifier[protected], parameter[control, test, listener]] begin[{]
if[call[XMLUnit.getIgnoreComments, parameter[]]] begin[{]
call[.compareCharacterData, parameter[member[.control], member[.test], member[.listener], member[.COMMENT_VALUE]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[compareComment] operator[SEP] identifier[Comment] identifier[control] , identifier[Comment] identifier[test] , identifier[DifferenceListener] identifier[listener] operator[SEP] Keyword[throws] identifier[DifferenceFoundException] {
Keyword[if] operator[SEP] operator[!] identifier[XMLUnit] operator[SEP] identifier[getIgnoreComments] operator[SEP] operator[SEP] operator[SEP] {
identifier[compareCharacterData] operator[SEP] identifier[control] , identifier[test] , identifier[listener] , identifier[COMMENT_VALUE] operator[SEP] operator[SEP]
}
}
|
public GetMediaResourceResponse getMediaResource(GetMediaResourceRequest request) {
checkStringNotEmpty(request.getMediaId(), "Media ID should not be null or empty!");
InternalRequest internalRequest =
createRequest(HttpMethodName.GET, request, PATH_MEDIA, request.getMediaId());
return invokeHttpClient(internalRequest, GetMediaResourceResponse.class);
} | class class_name[name] begin[{]
method[getMediaResource, return_type[type[GetMediaResourceResponse]], modifier[public], parameter[request]] begin[{]
call[.checkStringNotEmpty, parameter[call[request.getMediaId, parameter[]], literal["Media ID should not be null or empty!"]]]
local_variable[type[InternalRequest], internalRequest]
return[call[.invokeHttpClient, parameter[member[.internalRequest], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetMediaResourceResponse, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[GetMediaResourceResponse] identifier[getMediaResource] operator[SEP] identifier[GetMediaResourceRequest] identifier[request] operator[SEP] {
identifier[checkStringNotEmpty] operator[SEP] identifier[request] operator[SEP] identifier[getMediaId] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[InternalRequest] identifier[internalRequest] operator[=] identifier[createRequest] operator[SEP] identifier[HttpMethodName] operator[SEP] identifier[GET] , identifier[request] , identifier[PATH_MEDIA] , identifier[request] operator[SEP] identifier[getMediaId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[invokeHttpClient] operator[SEP] identifier[internalRequest] , identifier[GetMediaResourceResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public List<AbstractPlugin> getPlugins() {
if (pluginCache.isEmpty()) {
LOGGER.info("Plugin cache miss, reload");
load();
}
final List<AbstractPlugin> ret = new ArrayList<>();
for (final Map.Entry<String, HashSet<AbstractPlugin>> entry : pluginCache.entrySet()) {
ret.addAll(entry.getValue());
}
return ret;
} | class class_name[name] begin[{]
method[getPlugins, return_type[type[List]], modifier[public], parameter[]] begin[{]
if[call[pluginCache.isEmpty, parameter[]]] begin[{]
call[LOGGER.info, parameter[literal["Plugin cache miss, reload"]]]
call[.load, parameter[]]
else begin[{]
None
end[}]
local_variable[type[List], ret]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=pluginCache, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AbstractPlugin, sub_type=None))], dimensions=[], name=HashSet, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[member[.ret]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[AbstractPlugin] operator[>] identifier[getPlugins] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[pluginCache] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[load] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[List] operator[<] identifier[AbstractPlugin] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[HashSet] operator[<] identifier[AbstractPlugin] operator[>] operator[>] identifier[entry] operator[:] identifier[pluginCache] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[ret] operator[SEP] identifier[addAll] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ret] operator[SEP]
}
|
public CreateImageBuilderRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | class class_name[name] begin[{]
method[withTags, return_type[type[CreateImageBuilderRequest]], modifier[public], parameter[tags]] begin[{]
call[.setTags, parameter[member[.tags]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[CreateImageBuilderRequest] identifier[withTags] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[SEP] {
identifier[setTags] operator[SEP] identifier[tags] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
static private StringBuilder replace(StringBuilder input, java.util.regex.Pattern pattern, String replacement) {
java.util.regex.Matcher m = pattern.matcher(input);
while (m.find()) {
if (isEscapedChar(input.toString(), m.start())) {
continue;
}
// since we're replacing the original string being matched,
// we have to reset the matcher so that it searches the new
// string
input.replace(m.start(), m.end(), replacement);
m.reset(input);
}
return input;
} | class class_name[name] begin[{]
method[replace, return_type[type[StringBuilder]], modifier[private static], parameter[input, pattern, replacement]] begin[{]
local_variable[type[java], m]
while[call[m.find, parameter[]]] begin[{]
if[call[.isEscapedChar, parameter[call[input.toString, parameter[]], call[m.start, parameter[]]]]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[input.replace, parameter[call[m.start, parameter[]], call[m.end, parameter[]], member[.replacement]]]
call[m.reset, parameter[member[.input]]]
end[}]
return[member[.input]]
end[}]
END[}] | Keyword[static] Keyword[private] identifier[StringBuilder] identifier[replace] operator[SEP] identifier[StringBuilder] identifier[input] , identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[regex] operator[SEP] identifier[Pattern] identifier[pattern] , identifier[String] identifier[replacement] operator[SEP] {
identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[regex] operator[SEP] identifier[Matcher] identifier[m] operator[=] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isEscapedChar] operator[SEP] identifier[input] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[m] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[input] operator[SEP] identifier[replace] operator[SEP] identifier[m] operator[SEP] identifier[start] operator[SEP] operator[SEP] , identifier[m] operator[SEP] identifier[end] operator[SEP] operator[SEP] , identifier[replacement] operator[SEP] operator[SEP] identifier[m] operator[SEP] identifier[reset] operator[SEP] identifier[input] operator[SEP] operator[SEP]
}
Keyword[return] identifier[input] operator[SEP]
}
|
public final void performDispatch(Notification notification, Context context) {
if (StringUtils.equals(notification.getType(), notificationType) || StringUtils.equals("", notificationType)) {
dispatch(notification, context);
}
} | class class_name[name] begin[{]
method[performDispatch, return_type[void], modifier[final public], parameter[notification, context]] begin[{]
if[binary_operation[call[StringUtils.equals, parameter[call[notification.getType, parameter[]], member[.notificationType]]], ||, call[StringUtils.equals, parameter[literal[""], member[.notificationType]]]]] begin[{]
call[.dispatch, parameter[member[.notification], member[.context]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[performDispatch] operator[SEP] identifier[Notification] identifier[notification] , identifier[Context] identifier[context] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[equals] operator[SEP] identifier[notification] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[notificationType] operator[SEP] operator[||] identifier[StringUtils] operator[SEP] identifier[equals] operator[SEP] literal[String] , identifier[notificationType] operator[SEP] operator[SEP] {
identifier[dispatch] operator[SEP] identifier[notification] , identifier[context] operator[SEP] operator[SEP]
}
}
|
public static <T> Collection<T> reject(
Iterable<T> iterable,
Predicate<? super T> predicate,
boolean allowReorderedResult)
{
return ParallelIterate.reject(iterable, predicate, null, allowReorderedResult);
} | class class_name[name] begin[{]
method[reject, return_type[type[Collection]], modifier[public static], parameter[iterable, predicate, allowReorderedResult]] begin[{]
return[call[ParallelIterate.reject, parameter[member[.iterable], member[.predicate], literal[null], member[.allowReorderedResult]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Collection] operator[<] identifier[T] operator[>] identifier[reject] operator[SEP] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[iterable] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[predicate] , Keyword[boolean] identifier[allowReorderedResult] operator[SEP] {
Keyword[return] identifier[ParallelIterate] operator[SEP] identifier[reject] operator[SEP] identifier[iterable] , identifier[predicate] , Other[null] , identifier[allowReorderedResult] operator[SEP] operator[SEP]
}
|
Rule ClefMiddle() {
return Sequence(
FirstOfS(IgnoreCase("m="), IgnoreCase("middle=")),
BaseNote(), OptionalS(Octave())
).label(ClefMiddle);
} | class class_name[name] begin[{]
method[ClefMiddle, return_type[type[Rule]], modifier[default], parameter[]] begin[{]
return[call[.Sequence, parameter[call[.FirstOfS, parameter[call[.IgnoreCase, parameter[literal["m="]]], call[.IgnoreCase, parameter[literal["middle="]]]]], call[.BaseNote, parameter[]], call[.OptionalS, parameter[call[.Octave, parameter[]]]]]]]
end[}]
END[}] | identifier[Rule] identifier[ClefMiddle] operator[SEP] operator[SEP] {
Keyword[return] identifier[Sequence] operator[SEP] identifier[FirstOfS] operator[SEP] identifier[IgnoreCase] operator[SEP] literal[String] operator[SEP] , identifier[IgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] , identifier[BaseNote] operator[SEP] operator[SEP] , identifier[OptionalS] operator[SEP] identifier[Octave] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[ClefMiddle] operator[SEP] operator[SEP]
}
|
public ArrayList<Long> serviceName_pca_pcaServiceName_billing_GET(String serviceName, String pcaServiceName, Boolean billed, Date date_from, Date date_to) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/billing";
StringBuilder sb = path(qPath, serviceName, pcaServiceName);
query(sb, "billed", billed);
query(sb, "date.from", date_from);
query(sb, "date.to", date_to);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t3);
} | class class_name[name] begin[{]
method[serviceName_pca_pcaServiceName_billing_GET, return_type[type[ArrayList]], modifier[public], parameter[serviceName, pcaServiceName, billed, date_from, date_to]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["billed"], member[.billed]]]
call[.query, parameter[member[.sb], literal["date.from"], member[.date_from]]]
call[.query, parameter[member[.sb], literal["date.to"], member[.date_to]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], member[.t3]]]]
end[}]
END[}] | Keyword[public] identifier[ArrayList] operator[<] identifier[Long] operator[>] identifier[serviceName_pca_pcaServiceName_billing_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[pcaServiceName] , identifier[Boolean] identifier[billed] , identifier[Date] identifier[date_from] , identifier[Date] identifier[date_to] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[pcaServiceName] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[billed] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[date_from] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[date_to] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t3] operator[SEP] operator[SEP]
}
|
public CounterSnapshot getCounterSnapshot(String counterId) throws IOException {
final CounterSnapshot snapshot = inMemSnapshot.getIfPresent(counterId);
if (snapshot != null) {
stats.recordCounterCacheHit();
return snapshot;
}
stats.recordCounterCacheMiss();
return refreshCounterSnapshot(counterId);
} | class class_name[name] begin[{]
method[getCounterSnapshot, return_type[type[CounterSnapshot]], modifier[public], parameter[counterId]] begin[{]
local_variable[type[CounterSnapshot], snapshot]
if[binary_operation[member[.snapshot], !=, literal[null]]] begin[{]
call[stats.recordCounterCacheHit, parameter[]]
return[member[.snapshot]]
else begin[{]
None
end[}]
call[stats.recordCounterCacheMiss, parameter[]]
return[call[.refreshCounterSnapshot, parameter[member[.counterId]]]]
end[}]
END[}] | Keyword[public] identifier[CounterSnapshot] identifier[getCounterSnapshot] operator[SEP] identifier[String] identifier[counterId] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[CounterSnapshot] identifier[snapshot] operator[=] identifier[inMemSnapshot] operator[SEP] identifier[getIfPresent] operator[SEP] identifier[counterId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[snapshot] operator[!=] Other[null] operator[SEP] {
identifier[stats] operator[SEP] identifier[recordCounterCacheHit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[snapshot] operator[SEP]
}
identifier[stats] operator[SEP] identifier[recordCounterCacheMiss] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[refreshCounterSnapshot] operator[SEP] identifier[counterId] operator[SEP] operator[SEP]
}
|
public static void setValue(ModelNode target, ModelType type, Object propValue) {
if (type.equals(ModelType.STRING)) {
target.set((String) propValue);
} else if (type.equals(ModelType.INT)) {
target.set((Integer) propValue);
} else if (type.equals(ModelType.DOUBLE)) {
target.set((Double) propValue);
} else if (type.equals(ModelType.LONG)) {
// in some cases the server returns the wrong model type for numeric values
// i.e the description affords a ModelType.LONG, but a ModelType.INTEGER is returned
try {
target.set((Long) propValue);
} catch (Throwable e) { // ClassCastException
target.set(Integer.valueOf((Integer) propValue));
}
} else if (type.equals(ModelType.BIG_DECIMAL)) {
// in some cases the server returns the wrong model type for numeric values
// i.e the description affords a ModelType.LONG, but a ModelType.INTEGER is returned
try {
target.set((BigDecimal) propValue);
} catch (Throwable e) { // ClassCastException
target.set(Double.valueOf((Double) propValue));
}
} else if (type.equals(ModelType.BOOLEAN)) {
target.set((Boolean) propValue);
} else if (type.equals(ModelType.LIST)) {
target.setEmptyList();
List list = (List) propValue;
for (Object item : list) {
target.add(String.valueOf(item));
}
} else {
Log.warn("Type conversionnot supported for " + type);
target.setEmptyObject();
}
} | class class_name[name] begin[{]
method[setValue, return_type[void], modifier[public static], parameter[target, type, propValue]] begin[{]
if[call[type.equals, parameter[member[ModelType.STRING]]]] begin[{]
call[target.set, parameter[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]
else begin[{]
if[call[type.equals, parameter[member[ModelType.INT]]]] begin[{]
call[target.set, parameter[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]]
else begin[{]
if[call[type.equals, parameter[member[ModelType.DOUBLE]]]] begin[{]
call[target.set, parameter[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))]]
else begin[{]
if[call[type.equals, parameter[member[ModelType.LONG]]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], member=set, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)
else begin[{]
if[call[type.equals, parameter[member[ModelType.BIG_DECIMAL]]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))], member=set, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)
else begin[{]
if[call[type.equals, parameter[member[ModelType.BOOLEAN]]]] begin[{]
call[target.set, parameter[Cast(expression=MemberReference(member=propValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))]]
else begin[{]
if[call[type.equals, parameter[member[ModelType.LIST]]]] begin[{]
call[target.setEmptyList, parameter[]]
local_variable[type[List], list]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
else begin[{]
call[Log.warn, parameter[binary_operation[literal["Type conversionnot supported for "], +, member[.type]]]]
call[target.setEmptyObject, parameter[]]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setValue] operator[SEP] identifier[ModelNode] identifier[target] , identifier[ModelType] identifier[type] , identifier[Object] identifier[propValue] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ModelType] operator[SEP] identifier[STRING] operator[SEP] operator[SEP] {
identifier[target] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[propValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ModelType] operator[SEP] identifier[INT] operator[SEP] operator[SEP] {
identifier[target] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[propValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ModelType] operator[SEP] identifier[DOUBLE] operator[SEP] operator[SEP] {
identifier[target] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[Double] operator[SEP] identifier[propValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ModelType] operator[SEP] identifier[LONG] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[target] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[Long] operator[SEP] identifier[propValue] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[target] operator[SEP] identifier[set] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[propValue] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ModelType] operator[SEP] identifier[BIG_DECIMAL] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[target] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[propValue] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[target] operator[SEP] identifier[set] operator[SEP] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[Double] operator[SEP] identifier[propValue] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ModelType] operator[SEP] identifier[BOOLEAN] operator[SEP] operator[SEP] {
identifier[target] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[propValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ModelType] operator[SEP] identifier[LIST] operator[SEP] operator[SEP] {
identifier[target] operator[SEP] identifier[setEmptyList] operator[SEP] operator[SEP] operator[SEP] identifier[List] identifier[list] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[propValue] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[item] operator[:] identifier[list] operator[SEP] {
identifier[target] operator[SEP] identifier[add] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[item] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[Log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[setEmptyObject] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static void setDefaultTooltipManager(final TooltipManager tooltipManager) {
try {
TooltipManager.getInstance();
Reflection.setFieldValue(ClassReflection.getDeclaredField(TooltipManager.class, "instance"), null,
tooltipManager);
} catch (final ReflectionException exception) {
throw new GdxRuntimeException("Unable to set default tooltip manager.", exception);
}
} | class class_name[name] begin[{]
method[setDefaultTooltipManager, return_type[void], modifier[public static], parameter[tooltipManager]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=TooltipManager, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TooltipManager, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="instance")], member=getDeclaredField, postfix_operators=[], prefix_operators=[], qualifier=ClassReflection, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=tooltipManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFieldValue, postfix_operators=[], prefix_operators=[], qualifier=Reflection, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to set default tooltip manager."), MemberReference(member=exception, 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=GdxRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['ReflectionException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setDefaultTooltipManager] operator[SEP] Keyword[final] identifier[TooltipManager] identifier[tooltipManager] operator[SEP] {
Keyword[try] {
identifier[TooltipManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[Reflection] operator[SEP] identifier[setFieldValue] operator[SEP] identifier[ClassReflection] operator[SEP] identifier[getDeclaredField] operator[SEP] identifier[TooltipManager] operator[SEP] Keyword[class] , literal[String] operator[SEP] , Other[null] , identifier[tooltipManager] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[ReflectionException] identifier[exception] operator[SEP] {
Keyword[throw] Keyword[new] identifier[GdxRuntimeException] operator[SEP] literal[String] , identifier[exception] operator[SEP] operator[SEP]
}
}
|
public static String getJavaCommand(final Path javaHome) {
final Path resolvedJavaHome = javaHome == null ? findJavaHome() : javaHome;
final String exe;
if (resolvedJavaHome == null) {
exe = "java";
} else {
exe = resolvedJavaHome.resolve("bin").resolve("java").toString();
}
if (exe.contains(" ")) {
return "\"" + exe + "\"";
}
if (WINDOWS) {
return exe + ".exe";
}
return exe;
} | class class_name[name] begin[{]
method[getJavaCommand, return_type[type[String]], modifier[public static], parameter[javaHome]] begin[{]
local_variable[type[Path], resolvedJavaHome]
local_variable[type[String], exe]
if[binary_operation[member[.resolvedJavaHome], ==, literal[null]]] begin[{]
assign[member[.exe], literal["java"]]
else begin[{]
assign[member[.exe], call[resolvedJavaHome.resolve, parameter[literal["bin"]]]]
end[}]
if[call[exe.contains, parameter[literal[" "]]]] begin[{]
return[binary_operation[binary_operation[literal["\""], +, member[.exe]], +, literal["\""]]]
else begin[{]
None
end[}]
if[member[.WINDOWS]] begin[{]
return[binary_operation[member[.exe], +, literal[".exe"]]]
else begin[{]
None
end[}]
return[member[.exe]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getJavaCommand] operator[SEP] Keyword[final] identifier[Path] identifier[javaHome] operator[SEP] {
Keyword[final] identifier[Path] identifier[resolvedJavaHome] operator[=] identifier[javaHome] operator[==] Other[null] operator[?] identifier[findJavaHome] operator[SEP] operator[SEP] operator[:] identifier[javaHome] operator[SEP] Keyword[final] identifier[String] identifier[exe] operator[SEP] Keyword[if] operator[SEP] identifier[resolvedJavaHome] operator[==] Other[null] operator[SEP] {
identifier[exe] operator[=] literal[String] operator[SEP]
}
Keyword[else] {
identifier[exe] operator[=] identifier[resolvedJavaHome] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[exe] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[+] identifier[exe] operator[+] literal[String] operator[SEP]
}
Keyword[if] operator[SEP] identifier[WINDOWS] operator[SEP] {
Keyword[return] identifier[exe] operator[+] literal[String] operator[SEP]
}
Keyword[return] identifier[exe] operator[SEP]
}
|
@SuppressWarnings("unchecked")
protected <I> I newHandler(Class<I> theInterface) {
if (theInterface == null) return null;
String className = null;
try {
className = Config.getValueWithGlobalDefault(this.getEngine(), theInterface.getSimpleName());
mLog.info(">>> className = " + className);
if (Strings.isNullOrEmpty(className)) {
mLog.error(String.format("Cannot determine classname for %s from configuration source [%s] %s",
theInterface.getSimpleName(), Config.getConfigHandler().getSource(), this.getEngine()));
return null;
}
Class<?> clazz = Class.forName(className);
if (Modifier.isAbstract(clazz.getModifiers())) {
throw new InstantiationError(String.format("Class %s is abstract and cannot be instantiated", className));
}
Constructor<ADDFFunctionalGroupHandler> cons = (Constructor<ADDFFunctionalGroupHandler>) clazz
.getDeclaredConstructor(new Class<?>[] { DDF.class });
if (cons != null) cons.setAccessible(true);
return cons != null ? (I) cons.newInstance(this) : null;
} catch (ClassNotFoundException cnfe) {
mLog.error(String.format("Cannot instantiate handler for [%s] %s/%s", this.getEngine(),
theInterface.getSimpleName(), className), cnfe);
} catch (NoSuchMethodException nsme) {
mLog.error(String.format("Cannot instantiate handler for [%s] %s/%s", this.getEngine(),
theInterface.getSimpleName(), className), nsme);
} catch (IllegalAccessException iae) {
mLog.error(String.format("Cannot instantiate handler for [%s] %s/%s", this.getEngine(),
theInterface.getSimpleName(), className), iae);
} catch (InstantiationException ie) {
mLog.error(String.format("Cannot instantiate handler for [%s] %s/%s", this.getEngine(),
theInterface.getSimpleName(), className), ie);
} catch (InvocationTargetException ite) {
mLog.error(String.format("Cannot instantiate handler for [%s] %s/%s", this.getEngine(),
theInterface.getSimpleName(), className), ite);
}
return null;
} | class class_name[name] begin[{]
method[newHandler, return_type[type[I]], modifier[protected], parameter[theInterface]] begin[{]
if[binary_operation[member[.theInterface], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], className]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=theInterface, selectors=[], type_arguments=None)], member=getValueWithGlobalDefault, postfix_operators=[], prefix_operators=[], qualifier=Config, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">>> className = "), operandr=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=mLog, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNullOrEmpty, postfix_operators=[], prefix_operators=[], qualifier=Strings, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot determine classname for %s from configuration source [%s] %s"), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=theInterface, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getConfigHandler, postfix_operators=[], prefix_operators=[], qualifier=Config, selectors=[MethodInvocation(arguments=[], member=getSource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=mLog, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None)], member=isAbstract, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], 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="Class %s is abstract and cannot be instantiated"), MemberReference(member=className, 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=InstantiationError, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DDF, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Class, sub_type=None))], member=getDeclaredConstructor, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ADDFFunctionalGroupHandler, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), name=cons)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ADDFFunctionalGroupHandler, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=cons, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=cons, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot instantiate handler for [%s] %s/%s"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=theInterface, selectors=[], type_arguments=None), MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=cnfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=mLog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot instantiate handler for [%s] %s/%s"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=theInterface, selectors=[], type_arguments=None), MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=nsme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=mLog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nsme, types=['NoSuchMethodException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot instantiate handler for [%s] %s/%s"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=theInterface, selectors=[], type_arguments=None), MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=iae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=mLog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['IllegalAccessException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot instantiate handler for [%s] %s/%s"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=theInterface, selectors=[], type_arguments=None), MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=ie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=mLog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ie, types=['InstantiationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot instantiate handler for [%s] %s/%s"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=theInterface, selectors=[], type_arguments=None), MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=ite, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=mLog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ite, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None)
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] operator[<] identifier[I] operator[>] identifier[I] identifier[newHandler] operator[SEP] identifier[Class] operator[<] identifier[I] operator[>] identifier[theInterface] operator[SEP] {
Keyword[if] operator[SEP] identifier[theInterface] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[String] identifier[className] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[className] operator[=] identifier[Config] operator[SEP] identifier[getValueWithGlobalDefault] operator[SEP] Keyword[this] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] , identifier[theInterface] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mLog] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[className] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[className] operator[SEP] operator[SEP] {
identifier[mLog] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[theInterface] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[Config] operator[SEP] identifier[getConfigHandler] operator[SEP] operator[SEP] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[className] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[clazz] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InstantiationError] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[className] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Constructor] operator[<] identifier[ADDFFunctionalGroupHandler] operator[>] identifier[cons] operator[=] operator[SEP] identifier[Constructor] operator[<] identifier[ADDFFunctionalGroupHandler] operator[>] operator[SEP] identifier[clazz] operator[SEP] identifier[getDeclaredConstructor] operator[SEP] Keyword[new] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] {
identifier[DDF] operator[SEP] Keyword[class]
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cons] operator[!=] Other[null] operator[SEP] identifier[cons] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[cons] operator[!=] Other[null] operator[?] operator[SEP] identifier[I] operator[SEP] identifier[cons] operator[SEP] identifier[newInstance] operator[SEP] Keyword[this] operator[SEP] operator[:] Other[null] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] {
identifier[mLog] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] , identifier[theInterface] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[className] operator[SEP] , identifier[cnfe] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[nsme] operator[SEP] {
identifier[mLog] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] , identifier[theInterface] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[className] operator[SEP] , identifier[nsme] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[iae] operator[SEP] {
identifier[mLog] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] , identifier[theInterface] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[className] operator[SEP] , identifier[iae] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[ie] operator[SEP] {
identifier[mLog] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] , identifier[theInterface] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[className] operator[SEP] , identifier[ie] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[ite] operator[SEP] {
identifier[mLog] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] , identifier[theInterface] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[className] operator[SEP] , identifier[ite] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void challengeReceived(String challenge) throws IOException {
byte response[];
if (challenge != null) {
response = sc
.evaluateChallenge(StringUtils.decodeBase64(challenge));
} else {
response = sc.evaluateChallenge(new byte[0]);
}
Packet responseStanza;
if (response == null) {
responseStanza = new Response();
} else {
responseStanza = new Response(StringUtils.encodeBase64(response,
false));
}
// Send the authentication to the server
getSASLAuthentication().send(responseStanza);
} | class class_name[name] begin[{]
method[challengeReceived, return_type[void], modifier[public], parameter[challenge]] begin[{]
local_variable[type[byte], response]
if[binary_operation[member[.challenge], !=, literal[null]]] begin[{]
assign[member[.response], call[sc.evaluateChallenge, parameter[call[StringUtils.decodeBase64, parameter[member[.challenge]]]]]]
else begin[{]
assign[member[.response], call[sc.evaluateChallenge, parameter[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))]]]
end[}]
local_variable[type[Packet], responseStanza]
if[binary_operation[member[.response], ==, literal[null]]] begin[{]
assign[member[.responseStanza], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))]
else begin[{]
assign[member[.responseStanza], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=encodeBase64, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))]
end[}]
call[.getSASLAuthentication, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[challengeReceived] operator[SEP] identifier[String] identifier[challenge] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[byte] identifier[response] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[challenge] operator[!=] Other[null] operator[SEP] {
identifier[response] operator[=] identifier[sc] operator[SEP] identifier[evaluateChallenge] operator[SEP] identifier[StringUtils] operator[SEP] identifier[decodeBase64] operator[SEP] identifier[challenge] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[response] operator[=] identifier[sc] operator[SEP] identifier[evaluateChallenge] operator[SEP] Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Packet] identifier[responseStanza] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[==] Other[null] operator[SEP] {
identifier[responseStanza] operator[=] Keyword[new] identifier[Response] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[responseStanza] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[StringUtils] operator[SEP] identifier[encodeBase64] operator[SEP] identifier[response] , literal[boolean] operator[SEP] operator[SEP] operator[SEP]
}
identifier[getSASLAuthentication] operator[SEP] operator[SEP] operator[SEP] identifier[send] operator[SEP] identifier[responseStanza] operator[SEP] operator[SEP]
}
|
protected void initializePortletWindowData(
HttpServletRequest request, PortletWindowData portletWindowData) {
final IStylesheetDescriptor stylesheetDescriptor = getThemeStylesheetDescriptor(request);
final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId();
final IPortletEntity portletEntity =
this.portletEntityRegistry.getPortletEntity(request, portletEntityId);
final WindowState entityWindowState = portletEntity.getWindowState(stylesheetDescriptor);
if (persistentWindowStates.contains(entityWindowState)) {
portletWindowData.setWindowState(entityWindowState);
} else if (entityWindowState != null) {
// Set of persistent window states must have changed, nuke the old value
this.logger.warn(
"PortletEntity.windowState="
+ entityWindowState
+ " but that state is not in the set of persistent WindowStates. PortletEntity.windowState will be set to null");
portletEntity.setWindowState(stylesheetDescriptor, null);
this.portletEntityRegistry.storePortletEntity(request, portletEntity);
}
} | class class_name[name] begin[{]
method[initializePortletWindowData, return_type[void], modifier[protected], parameter[request, portletWindowData]] begin[{]
local_variable[type[IStylesheetDescriptor], stylesheetDescriptor]
local_variable[type[IPortletEntityId], portletEntityId]
local_variable[type[IPortletEntity], portletEntity]
local_variable[type[WindowState], entityWindowState]
if[call[persistentWindowStates.contains, parameter[member[.entityWindowState]]]] begin[{]
call[portletWindowData.setWindowState, parameter[member[.entityWindowState]]]
else begin[{]
if[binary_operation[member[.entityWindowState], !=, literal[null]]] begin[{]
THIS[member[None.logger]call[None.warn, parameter[binary_operation[binary_operation[literal["PortletEntity.windowState="], +, member[.entityWindowState]], +, literal[" but that state is not in the set of persistent WindowStates. PortletEntity.windowState will be set to null"]]]]]
call[portletEntity.setWindowState, parameter[member[.stylesheetDescriptor], literal[null]]]
THIS[member[None.portletEntityRegistry]call[None.storePortletEntity, parameter[member[.request], member[.portletEntity]]]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[initializePortletWindowData] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[PortletWindowData] identifier[portletWindowData] operator[SEP] {
Keyword[final] identifier[IStylesheetDescriptor] identifier[stylesheetDescriptor] operator[=] identifier[getThemeStylesheetDescriptor] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[final] identifier[IPortletEntityId] identifier[portletEntityId] operator[=] identifier[portletWindowData] operator[SEP] identifier[getPortletEntityId] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[IPortletEntity] identifier[portletEntity] operator[=] Keyword[this] operator[SEP] identifier[portletEntityRegistry] operator[SEP] identifier[getPortletEntity] operator[SEP] identifier[request] , identifier[portletEntityId] operator[SEP] operator[SEP] Keyword[final] identifier[WindowState] identifier[entityWindowState] operator[=] identifier[portletEntity] operator[SEP] identifier[getWindowState] operator[SEP] identifier[stylesheetDescriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[persistentWindowStates] operator[SEP] identifier[contains] operator[SEP] identifier[entityWindowState] operator[SEP] operator[SEP] {
identifier[portletWindowData] operator[SEP] identifier[setWindowState] operator[SEP] identifier[entityWindowState] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[entityWindowState] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[entityWindowState] operator[+] literal[String] operator[SEP] operator[SEP] identifier[portletEntity] operator[SEP] identifier[setWindowState] operator[SEP] identifier[stylesheetDescriptor] , Other[null] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[portletEntityRegistry] operator[SEP] identifier[storePortletEntity] operator[SEP] identifier[request] , identifier[portletEntity] operator[SEP] operator[SEP]
}
}
|
public void lineTo(Point3d point) {
ensureSlots(true, 3);
this.types[this.numTypesProperty.get()] = PathElementType.LINE_TO;
this.numTypesProperty.set(this.numTypesProperty.get()+1);
this.coordsProperty[this.numCoordsProperty.get()] = point.xProperty;
this.numCoordsProperty.set(this.numCoordsProperty.get()+1);
this.coordsProperty[this.numCoordsProperty.get()] = point.yProperty;
this.numCoordsProperty.set(this.numCoordsProperty.get()+1);
this.coordsProperty[this.numCoordsProperty.get()] = point.zProperty;
this.numCoordsProperty.set(this.numCoordsProperty.get()+1);
this.isEmptyProperty = null;
this.graphicalBounds = null;
this.logicalBounds = null;
} | class class_name[name] begin[{]
method[lineTo, return_type[void], modifier[public], parameter[point]] begin[{]
call[.ensureSlots, parameter[literal[true], literal[3]]]
assign[THIS[member[None.types]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numTypesProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))], member[PathElementType.LINE_TO]]
THIS[member[None.numTypesProperty]call[None.set, parameter[binary_operation[THIS[member[None.numTypesProperty]call[None.get, parameter[]]], +, literal[1]]]]]
assign[THIS[member[None.coordsProperty]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numCoordsProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))], member[point.xProperty]]
THIS[member[None.numCoordsProperty]call[None.set, parameter[binary_operation[THIS[member[None.numCoordsProperty]call[None.get, parameter[]]], +, literal[1]]]]]
assign[THIS[member[None.coordsProperty]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numCoordsProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))], member[point.yProperty]]
THIS[member[None.numCoordsProperty]call[None.set, parameter[binary_operation[THIS[member[None.numCoordsProperty]call[None.get, parameter[]]], +, literal[1]]]]]
assign[THIS[member[None.coordsProperty]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numCoordsProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))], member[point.zProperty]]
THIS[member[None.numCoordsProperty]call[None.set, parameter[binary_operation[THIS[member[None.numCoordsProperty]call[None.get, parameter[]]], +, literal[1]]]]]
assign[THIS[member[None.isEmptyProperty]], literal[null]]
assign[THIS[member[None.graphicalBounds]], literal[null]]
assign[THIS[member[None.logicalBounds]], literal[null]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[lineTo] operator[SEP] identifier[Point3d] identifier[point] operator[SEP] {
identifier[ensureSlots] operator[SEP] literal[boolean] , Other[3] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[types] operator[SEP] Keyword[this] operator[SEP] identifier[numTypesProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[=] identifier[PathElementType] operator[SEP] identifier[LINE_TO] operator[SEP] Keyword[this] operator[SEP] identifier[numTypesProperty] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[numTypesProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[coordsProperty] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[=] identifier[point] operator[SEP] identifier[xProperty] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[coordsProperty] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[=] identifier[point] operator[SEP] identifier[yProperty] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[coordsProperty] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[=] identifier[point] operator[SEP] identifier[zProperty] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[numCoordsProperty] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[isEmptyProperty] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[graphicalBounds] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[logicalBounds] operator[=] Other[null] operator[SEP]
}
|
static Path create(final Iterable<String> commands, final boolean batch, final boolean failOnError) throws IOException {
final Path tempScript = Files.createTempFile("cli-scrpts", ".cli");
try (BufferedWriter writer = Files.newBufferedWriter(tempScript, StandardCharsets.UTF_8)) {
if (batch) {
writer.write("batch");
writer.newLine();
}
boolean inTry = false;
for (String cmd : commands) {
if (failOnError) {
writeCommand(writer, cmd);
} else {
if ("try".equals(cmd.trim())) {
inTry = true;
}
if (inTry) {
writeCommand(writer, cmd);
} else {
writeCommandInTry(writer, cmd);
}
if ("end-try".equals(cmd.trim())) {
inTry = false;
}
}
}
if (batch) {
writer.write("run-batch");
writer.newLine();
}
}
return tempScript;
} | class class_name[name] begin[{]
method[create, return_type[type[Path]], modifier[static], parameter[commands, batch, failOnError]] begin[{]
local_variable[type[Path], tempScript]
TryStatement(block=[IfStatement(condition=MemberReference(member=batch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="batch")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=newLine, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=inTry)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=failOnError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="try"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), IfStatement(condition=MemberReference(member=inTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeCommandInTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="end-try"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=commands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cmd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=batch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="run-batch")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=newLine, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=writer, type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=tempScript, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, selectors=[])], member=newBufferedWriter, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None))])
return[member[.tempScript]]
end[}]
END[}] | Keyword[static] identifier[Path] identifier[create] operator[SEP] Keyword[final] identifier[Iterable] operator[<] identifier[String] operator[>] identifier[commands] , Keyword[final] Keyword[boolean] identifier[batch] , Keyword[final] Keyword[boolean] identifier[failOnError] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[Path] identifier[tempScript] operator[=] identifier[Files] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedWriter] identifier[writer] operator[=] identifier[Files] operator[SEP] identifier[newBufferedWriter] operator[SEP] identifier[tempScript] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[batch] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[newLine] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[inTry] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[cmd] operator[:] identifier[commands] operator[SEP] {
Keyword[if] operator[SEP] identifier[failOnError] operator[SEP] {
identifier[writeCommand] operator[SEP] identifier[writer] , identifier[cmd] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[cmd] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[inTry] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[inTry] operator[SEP] {
identifier[writeCommand] operator[SEP] identifier[writer] , identifier[cmd] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[writeCommandInTry] operator[SEP] identifier[writer] , identifier[cmd] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[cmd] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[inTry] operator[=] literal[boolean] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[batch] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[newLine] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[tempScript] operator[SEP]
}
|
private void sendEmptyRequest(String path, String method) throws DatastoreEmulatorException {
HttpURLConnection connection = null;
try {
URL url = new URL(this.host + path);
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod(method);
connection.getOutputStream().close();
if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
throw new DatastoreEmulatorException(
String.format(
"%s request to %s returned HTTP status %s",
method, path, connection.getResponseCode()));
}
} catch (IOException e) {
throw new DatastoreEmulatorException(
String.format("Exception connecting to emulator on %s request to %s", method, path), e);
} finally {
if (connection != null) {
connection.disconnect();
}
}
} | class class_name[name] begin[{]
method[sendEmptyRequest, return_type[void], modifier[private], parameter[path, method]] begin[{]
local_variable[type[HttpURLConnection], connection]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=host, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=path, 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=URL, sub_type=None)), name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDoOutput, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRequestMethod, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), operandr=MemberReference(member=HTTP_OK, postfix_operators=[], prefix_operators=[], qualifier=HttpURLConnection, 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="%s request to %s returned HTTP status %s"), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=connection, 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=DatastoreEmulatorException, sub_type=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception connecting to emulator on %s request to %s"), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatastoreEmulatorException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[sendEmptyRequest] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[method] operator[SEP] Keyword[throws] identifier[DatastoreEmulatorException] {
identifier[HttpURLConnection] identifier[connection] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[URL] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] Keyword[this] operator[SEP] identifier[host] operator[+] identifier[path] operator[SEP] operator[SEP] identifier[connection] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[setRequestMethod] operator[SEP] identifier[method] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connection] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[!=] identifier[HttpURLConnection] operator[SEP] identifier[HTTP_OK] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatastoreEmulatorException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[method] , identifier[path] , identifier[connection] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatastoreEmulatorException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[method] , identifier[path] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[connection] operator[!=] Other[null] operator[SEP] {
identifier[connection] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Override
public IScan getNextScanAtSameMsLevel(IScan scan) {
return getNextScanAtMsLevel(scan.getNum(), scan.getMsLevel());
} | class class_name[name] begin[{]
method[getNextScanAtSameMsLevel, return_type[type[IScan]], modifier[public], parameter[scan]] begin[{]
return[call[.getNextScanAtMsLevel, parameter[call[scan.getNum, parameter[]], call[scan.getMsLevel, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[IScan] identifier[getNextScanAtSameMsLevel] operator[SEP] identifier[IScan] identifier[scan] operator[SEP] {
Keyword[return] identifier[getNextScanAtMsLevel] operator[SEP] identifier[scan] operator[SEP] identifier[getNum] operator[SEP] operator[SEP] , identifier[scan] operator[SEP] identifier[getMsLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private byte[] getContent()
throws IOException
{
InputStream is = null;
try
{
MessageDigest digest = MessageDigest.getInstance( "MD5" );
digest.reset();
byte[] buffer = new byte[8192];
int read;
try
{
is = entry.getInputStream();
while ( ( read = is.read( buffer ) ) > 0 )
{
digest.update( buffer, 0, read );
}
}
catch ( IOException e )
{
if ( is != null )
{
throw e;
}
}
final String md5 = StringUtils.leftPad( new BigInteger( 1, digest.digest() ).toString( 16 ), 32, "0" );
return md5.getBytes();
}
catch ( NoSuchAlgorithmException e )
{
IOException ioe = new IOException( "Unable to calculate hash" );
ioe.initCause( e );
throw ioe;
}
finally
{
IOUtils.closeQuietly( is );
}
} | class class_name[name] begin[{]
method[getContent, return_type[type[byte]], modifier[private], parameter[]] begin[{]
local_variable[type[InputStream], is]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MD5")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None), name=digest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MessageDigest, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=digest, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8192)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buffer)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=read)], modifiers=set(), type=BasicType(dimensions=[], name=int)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=[], prefix_operators=[], qualifier=digest, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=is, 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=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[], member=digest, postfix_operators=[], prefix_operators=[], qualifier=digest, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0")], member=leftPad, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=md5)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=md5, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to calculate hash")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), name=ioe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=ioe, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[InputStream] identifier[is] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[MessageDigest] identifier[digest] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[digest] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[8192] operator[SEP] operator[SEP] Keyword[int] identifier[read] operator[SEP] Keyword[try] {
identifier[is] operator[=] identifier[entry] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[read] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[digest] operator[SEP] identifier[update] operator[SEP] identifier[buffer] , Other[0] , identifier[read] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[is] operator[!=] Other[null] operator[SEP] {
Keyword[throw] identifier[e] operator[SEP]
}
}
Keyword[final] identifier[String] identifier[md5] operator[=] identifier[StringUtils] operator[SEP] identifier[leftPad] operator[SEP] Keyword[new] identifier[BigInteger] operator[SEP] Other[1] , identifier[digest] operator[SEP] identifier[digest] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] Other[16] operator[SEP] , Other[32] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[md5] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
identifier[IOException] identifier[ioe] operator[=] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ioe] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[ioe] operator[SEP]
}
Keyword[finally] {
identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[is] operator[SEP] operator[SEP]
}
}
|
public <T extends ConfigurationContainer> T getConfiguration(Class<T> type) {
if (!configurations.containsKey(type)) {
configurations.put(type, createConfiguration(type));
}
return (T) configurations.get(type);
} | class class_name[name] begin[{]
method[getConfiguration, return_type[type[T]], modifier[public], parameter[type]] begin[{]
if[call[configurations.containsKey, parameter[member[.type]]]] begin[{]
call[configurations.put, parameter[member[.type], call[.createConfiguration, parameter[member[.type]]]]]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=configurations, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[ConfigurationContainer] operator[>] identifier[T] identifier[getConfiguration] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[configurations] operator[SEP] identifier[containsKey] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
identifier[configurations] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[createConfiguration] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[configurations] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
|
private static String enc(String in) {
StringBuilder out = new StringBuilder(in.length() + 16);
enc(in, out);
return out.toString();
} | class class_name[name] begin[{]
method[enc, return_type[type[String]], modifier[private static], parameter[in]] begin[{]
local_variable[type[StringBuilder], out]
call[.enc, parameter[member[.in], member[.out]]]
return[call[out.toString, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[enc] operator[SEP] identifier[String] identifier[in] operator[SEP] {
identifier[StringBuilder] identifier[out] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[in] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[16] operator[SEP] operator[SEP] identifier[enc] operator[SEP] identifier[in] , identifier[out] operator[SEP] operator[SEP] Keyword[return] identifier[out] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static AuthHandler credentials(String jwtFile, String nkeyFile) {
return NatsImpl.credentials(jwtFile, nkeyFile);
} | class class_name[name] begin[{]
method[credentials, return_type[type[AuthHandler]], modifier[public static], parameter[jwtFile, nkeyFile]] begin[{]
return[call[NatsImpl.credentials, parameter[member[.jwtFile], member[.nkeyFile]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[AuthHandler] identifier[credentials] operator[SEP] identifier[String] identifier[jwtFile] , identifier[String] identifier[nkeyFile] operator[SEP] {
Keyword[return] identifier[NatsImpl] operator[SEP] identifier[credentials] operator[SEP] identifier[jwtFile] , identifier[nkeyFile] operator[SEP] operator[SEP]
}
|
private static Criteria buildCriteria(Object anExample)
{
Criteria criteria = new Criteria();
ClassDescriptor cld = MetadataManager.getInstance().getRepository().getDescriptorFor(anExample.getClass());
FieldDescriptor[] fds = cld.getFieldDescriptions();
PersistentField f;
Object value;
for (int i = 0; i < fds.length; i++)
{
try
{
f = fds[i].getPersistentField();
value = f.get(anExample);
if (value != null)
{
criteria.addEqualTo(f.getName(), value);
}
}
catch (Throwable ex)
{
LoggerFactory.getDefaultLogger().error(ex);
}
}
return criteria;
} | class class_name[name] begin[{]
method[buildCriteria, return_type[type[Criteria]], modifier[private static], parameter[anExample]] begin[{]
local_variable[type[Criteria], criteria]
local_variable[type[ClassDescriptor], cld]
local_variable[type[FieldDescriptor], fds]
local_variable[type[PersistentField], f]
local_variable[type[Object], value]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=fds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getPersistentField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=anExample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, 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=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addEqualTo, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefaultLogger, postfix_operators=[], prefix_operators=[], qualifier=LoggerFactory, selectors=[MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=fds, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.criteria]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Criteria] identifier[buildCriteria] operator[SEP] identifier[Object] identifier[anExample] operator[SEP] {
identifier[Criteria] identifier[criteria] operator[=] Keyword[new] identifier[Criteria] operator[SEP] operator[SEP] operator[SEP] identifier[ClassDescriptor] identifier[cld] operator[=] identifier[MetadataManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getDescriptorFor] operator[SEP] identifier[anExample] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[FieldDescriptor] operator[SEP] operator[SEP] identifier[fds] operator[=] identifier[cld] operator[SEP] identifier[getFieldDescriptions] operator[SEP] operator[SEP] operator[SEP] identifier[PersistentField] identifier[f] operator[SEP] identifier[Object] identifier[value] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[fds] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[try] {
identifier[f] operator[=] identifier[fds] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getPersistentField] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[f] operator[SEP] identifier[get] operator[SEP] identifier[anExample] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[criteria] operator[SEP] identifier[addEqualTo] operator[SEP] identifier[f] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] {
identifier[LoggerFactory] operator[SEP] identifier[getDefaultLogger] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[criteria] operator[SEP]
}
|
public byte[] getEncoded() throws SshException {
try {
return cert.getEncoded();
} catch (Throwable ex) {
throw new SshException("Failed to encoded key data",
SshException.INTERNAL_ERROR, ex);
}
} | class class_name[name] begin[{]
method[getEncoded, return_type[type[byte]], modifier[public], parameter[]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getEncoded, postfix_operators=[], prefix_operators=[], qualifier=cert, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to encoded key data"), MemberReference(member=INTERNAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=SshException, selectors=[]), 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=SshException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] Keyword[throws] identifier[SshException] {
Keyword[try] {
Keyword[return] identifier[cert] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SshException] operator[SEP] literal[String] , identifier[SshException] operator[SEP] identifier[INTERNAL_ERROR] , identifier[ex] operator[SEP] operator[SEP]
}
}
|
public Path createIndex() throws IOException {
Path indexPath = bamFile.getParent().resolve(bamFile.getFileName().toString() + ".bai");
return createIndex(indexPath);
} | class class_name[name] begin[{]
method[createIndex, return_type[type[Path]], modifier[public], parameter[]] begin[{]
local_variable[type[Path], indexPath]
return[call[.createIndex, parameter[member[.indexPath]]]]
end[}]
END[}] | Keyword[public] identifier[Path] identifier[createIndex] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Path] identifier[indexPath] operator[=] identifier[bamFile] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] identifier[bamFile] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[createIndex] operator[SEP] identifier[indexPath] operator[SEP] operator[SEP]
}
|
final public void MethodParameters() throws ParseException {
/*@bgen(jjtree) MethodParameters */
AstMethodParameters jjtn000 = new AstMethodParameters(JJTMETHODPARAMETERS);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case START_SET_OR_MAP:
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case STRING_LITERAL:
case TRUE:
case FALSE:
case NULL:
case LPAREN:
case LBRACK:
case NOT0:
case NOT1:
case EMPTY:
case MINUS:
case IDENTIFIER:
Expression();
label_15:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[37] = jj_gen;
break label_15;
}
jj_consume_token(COMMA);
Expression();
}
break;
default:
jj_la1[38] = jj_gen;
;
}
jj_consume_token(RPAREN);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
} | class class_name[name] begin[{]
method[MethodParameters, return_type[void], modifier[final public], parameter[]] begin[{]
local_variable[type[AstMethodParameters], jjtn000]
local_variable[type[boolean], jjtc000]
call[jjtree.openNodeScope, parameter[member[.jjtn000]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LPAREN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=jj_consume_token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=['START_SET_OR_MAP', 'INTEGER_LITERAL', 'FLOATING_POINT_LITERAL', 'STRING_LITERAL', 'TRUE', 'FALSE', 'NULL', 'LPAREN', 'LBRACK', 'NOT0', 'NOT1', 'EMPTY', 'MINUS', 'IDENTIFIER'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=Expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=['COMMA'], statements=[Statement(label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=jj_la1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=37))]), type==, value=MemberReference(member=jj_gen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=label_15, label=None)])], expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=MemberReference(member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=jj_consume_token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=Expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=label_15), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=jj_la1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=38))]), type==, value=MemberReference(member=jj_gen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), Statement(label=None)])], expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=MemberReference(member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RPAREN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=jj_consume_token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=jjtc000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=popNode, postfix_operators=[], prefix_operators=[], qualifier=jjtree, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jjtn000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clearNodeScope, postfix_operators=[], prefix_operators=[], qualifier=jjtree, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=jjtc000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jjte000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), else_statement=None, label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=jjte000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None)), label=None))])])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jjte000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ParseException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), else_statement=None, label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=jjte000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParseException, sub_type=None)), label=None))])])), BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), else_statement=None, label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=jjte000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), label=None))])], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=jjte000, types=['Throwable']))], finally_block=[IfStatement(condition=MemberReference(member=jjtc000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jjtn000, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=closeNodeScope, postfix_operators=[], prefix_operators=[], qualifier=jjtree, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | Keyword[final] Keyword[public] Keyword[void] identifier[MethodParameters] operator[SEP] operator[SEP] Keyword[throws] identifier[ParseException] {
identifier[AstMethodParameters] identifier[jjtn000] operator[=] Keyword[new] identifier[AstMethodParameters] operator[SEP] identifier[JJTMETHODPARAMETERS] operator[SEP] operator[SEP] Keyword[boolean] identifier[jjtc000] operator[=] literal[boolean] operator[SEP] identifier[jjtree] operator[SEP] identifier[openNodeScope] operator[SEP] identifier[jjtn000] operator[SEP] operator[SEP] Keyword[try] {
identifier[jj_consume_token] operator[SEP] identifier[LPAREN] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] operator[SEP] identifier[jj_ntk] operator[==] operator[-] Other[1] operator[SEP] operator[?] identifier[jj_ntk] operator[SEP] operator[SEP] operator[:] identifier[jj_ntk] operator[SEP] {
Keyword[case] identifier[START_SET_OR_MAP] operator[:] Keyword[case] identifier[INTEGER_LITERAL] operator[:] Keyword[case] identifier[FLOATING_POINT_LITERAL] operator[:] Keyword[case] identifier[STRING_LITERAL] operator[:] Keyword[case] identifier[TRUE] operator[:] Keyword[case] identifier[FALSE] operator[:] Keyword[case] identifier[NULL] operator[:] Keyword[case] identifier[LPAREN] operator[:] Keyword[case] identifier[LBRACK] operator[:] Keyword[case] identifier[NOT0] operator[:] Keyword[case] identifier[NOT1] operator[:] Keyword[case] identifier[EMPTY] operator[:] Keyword[case] identifier[MINUS] operator[:] Keyword[case] identifier[IDENTIFIER] operator[:] identifier[Expression] operator[SEP] operator[SEP] operator[SEP] identifier[label_15] operator[:] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[switch] operator[SEP] operator[SEP] identifier[jj_ntk] operator[==] operator[-] Other[1] operator[SEP] operator[?] identifier[jj_ntk] operator[SEP] operator[SEP] operator[:] identifier[jj_ntk] operator[SEP] {
Keyword[case] identifier[COMMA] operator[:] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[jj_la1] operator[SEP] Other[37] operator[SEP] operator[=] identifier[jj_gen] operator[SEP] Keyword[break] identifier[label_15] operator[SEP]
}
identifier[jj_consume_token] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP] identifier[Expression] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[jj_la1] operator[SEP] Other[38] operator[SEP] operator[=] identifier[jj_gen] operator[SEP] operator[SEP]
}
identifier[jj_consume_token] operator[SEP] identifier[RPAREN] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[jjte000] operator[SEP] {
Keyword[if] operator[SEP] identifier[jjtc000] operator[SEP] {
identifier[jjtree] operator[SEP] identifier[clearNodeScope] operator[SEP] identifier[jjtn000] operator[SEP] operator[SEP] identifier[jjtc000] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[jjtree] operator[SEP] identifier[popNode] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[jjte000] Keyword[instanceof] identifier[RuntimeException] operator[SEP] {
{
Keyword[if] operator[SEP] literal[boolean] operator[SEP] Keyword[throw] operator[SEP] identifier[RuntimeException] operator[SEP] identifier[jjte000] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[jjte000] Keyword[instanceof] identifier[ParseException] operator[SEP] {
{
Keyword[if] operator[SEP] literal[boolean] operator[SEP] Keyword[throw] operator[SEP] identifier[ParseException] operator[SEP] identifier[jjte000] operator[SEP]
}
} {
Keyword[if] operator[SEP] literal[boolean] operator[SEP] Keyword[throw] operator[SEP] identifier[Error] operator[SEP] identifier[jjte000] operator[SEP]
}
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[jjtc000] operator[SEP] {
identifier[jjtree] operator[SEP] identifier[closeNodeScope] operator[SEP] identifier[jjtn000] , literal[boolean] operator[SEP] operator[SEP]
}
}
}
|
@SuppressWarnings("deprecation")
private CmsNewResourceInfo createResourceTypeInfo(I_CmsResourceType resType, CmsResource copyResource) {
String name = resType.getTypeName();
Locale locale = getWorkplaceLocale();
String subtitle = CmsWorkplaceMessages.getResourceTypeDescription(locale, name);
if (CmsStringUtil.isEmptyOrWhitespaceOnly(subtitle)) {
subtitle = CmsWorkplaceMessages.getResourceTypeName(locale, name);
}
if (copyResource != null) {
CmsNewResourceInfo info = new CmsNewResourceInfo(
copyResource.getTypeId(),
name,
CmsWorkplaceMessages.getResourceTypeName(locale, name),
CmsWorkplaceMessages.getResourceTypeDescription(locale, name),
copyResource.getStructureId(),
false,
subtitle);
info.setBigIconClasses(CmsIconUtil.getIconClasses(name, null, false));
return info;
} else {
CmsNewResourceInfo info = new CmsNewResourceInfo(
resType.getTypeId(),
name,
CmsWorkplaceMessages.getResourceTypeName(locale, name),
CmsWorkplaceMessages.getResourceTypeDescription(locale, name),
null,
false,
subtitle);
info.setBigIconClasses(CmsIconUtil.getIconClasses(name, null, false));
return info;
}
} | class class_name[name] begin[{]
method[createResourceTypeInfo, return_type[type[CmsNewResourceInfo]], modifier[private], parameter[resType, copyResource]] begin[{]
local_variable[type[String], name]
local_variable[type[Locale], locale]
local_variable[type[String], subtitle]
if[call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[member[.subtitle]]]] begin[{]
assign[member[.subtitle], call[CmsWorkplaceMessages.getResourceTypeName, parameter[member[.locale], member[.name]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.copyResource], !=, literal[null]]] begin[{]
local_variable[type[CmsNewResourceInfo], info]
call[info.setBigIconClasses, parameter[call[CmsIconUtil.getIconClasses, parameter[member[.name], literal[null], literal[false]]]]]
return[member[.info]]
else begin[{]
local_variable[type[CmsNewResourceInfo], info]
call[info.setBigIconClasses, parameter[call[CmsIconUtil.getIconClasses, parameter[member[.name], literal[null], literal[false]]]]]
return[member[.info]]
end[}]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] identifier[CmsNewResourceInfo] identifier[createResourceTypeInfo] operator[SEP] identifier[I_CmsResourceType] identifier[resType] , identifier[CmsResource] identifier[copyResource] operator[SEP] {
identifier[String] identifier[name] operator[=] identifier[resType] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[Locale] identifier[locale] operator[=] identifier[getWorkplaceLocale] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[subtitle] operator[=] identifier[CmsWorkplaceMessages] operator[SEP] identifier[getResourceTypeDescription] operator[SEP] identifier[locale] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[subtitle] operator[SEP] operator[SEP] {
identifier[subtitle] operator[=] identifier[CmsWorkplaceMessages] operator[SEP] identifier[getResourceTypeName] operator[SEP] identifier[locale] , identifier[name] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[copyResource] operator[!=] Other[null] operator[SEP] {
identifier[CmsNewResourceInfo] identifier[info] operator[=] Keyword[new] identifier[CmsNewResourceInfo] operator[SEP] identifier[copyResource] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] , identifier[name] , identifier[CmsWorkplaceMessages] operator[SEP] identifier[getResourceTypeName] operator[SEP] identifier[locale] , identifier[name] operator[SEP] , identifier[CmsWorkplaceMessages] operator[SEP] identifier[getResourceTypeDescription] operator[SEP] identifier[locale] , identifier[name] operator[SEP] , identifier[copyResource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] , literal[boolean] , identifier[subtitle] operator[SEP] operator[SEP] identifier[info] operator[SEP] identifier[setBigIconClasses] operator[SEP] identifier[CmsIconUtil] operator[SEP] identifier[getIconClasses] operator[SEP] identifier[name] , Other[null] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[info] operator[SEP]
}
Keyword[else] {
identifier[CmsNewResourceInfo] identifier[info] operator[=] Keyword[new] identifier[CmsNewResourceInfo] operator[SEP] identifier[resType] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] , identifier[name] , identifier[CmsWorkplaceMessages] operator[SEP] identifier[getResourceTypeName] operator[SEP] identifier[locale] , identifier[name] operator[SEP] , identifier[CmsWorkplaceMessages] operator[SEP] identifier[getResourceTypeDescription] operator[SEP] identifier[locale] , identifier[name] operator[SEP] , Other[null] , literal[boolean] , identifier[subtitle] operator[SEP] operator[SEP] identifier[info] operator[SEP] identifier[setBigIconClasses] operator[SEP] identifier[CmsIconUtil] operator[SEP] identifier[getIconClasses] operator[SEP] identifier[name] , Other[null] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[info] operator[SEP]
}
}
|
private ProjectFile read() throws Exception
{
m_project = new ProjectFile();
m_eventManager = m_project.getEventManager();
ProjectConfig config = m_project.getProjectConfig();
config.setAutoCalendarUniqueID(false);
config.setAutoTaskID(false);
config.setAutoTaskUniqueID(false);
config.setAutoResourceUniqueID(false);
config.setAutoWBS(false);
config.setAutoOutlineNumber(false);
m_project.getProjectProperties().setFileApplication("FastTrack");
m_project.getProjectProperties().setFileType("FTS");
m_eventManager.addProjectListeners(m_projectListeners);
// processProject();
// processCalendars();
processResources();
processTasks();
processDependencies();
processAssignments();
return m_project;
} | class class_name[name] begin[{]
method[read, return_type[type[ProjectFile]], modifier[private], parameter[]] begin[{]
assign[member[.m_project], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProjectFile, sub_type=None))]
assign[member[.m_eventManager], call[m_project.getEventManager, parameter[]]]
local_variable[type[ProjectConfig], config]
call[config.setAutoCalendarUniqueID, parameter[literal[false]]]
call[config.setAutoTaskID, parameter[literal[false]]]
call[config.setAutoTaskUniqueID, parameter[literal[false]]]
call[config.setAutoResourceUniqueID, parameter[literal[false]]]
call[config.setAutoWBS, parameter[literal[false]]]
call[config.setAutoOutlineNumber, parameter[literal[false]]]
call[m_project.getProjectProperties, parameter[]]
call[m_project.getProjectProperties, parameter[]]
call[m_eventManager.addProjectListeners, parameter[member[.m_projectListeners]]]
call[.processResources, parameter[]]
call[.processTasks, parameter[]]
call[.processDependencies, parameter[]]
call[.processAssignments, parameter[]]
return[member[.m_project]]
end[}]
END[}] | Keyword[private] identifier[ProjectFile] identifier[read] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[m_project] operator[=] Keyword[new] identifier[ProjectFile] operator[SEP] operator[SEP] operator[SEP] identifier[m_eventManager] operator[=] identifier[m_project] operator[SEP] identifier[getEventManager] operator[SEP] operator[SEP] operator[SEP] identifier[ProjectConfig] identifier[config] operator[=] identifier[m_project] operator[SEP] identifier[getProjectConfig] operator[SEP] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setAutoCalendarUniqueID] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setAutoTaskID] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setAutoTaskUniqueID] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setAutoResourceUniqueID] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setAutoWBS] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setAutoOutlineNumber] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[m_project] operator[SEP] identifier[getProjectProperties] operator[SEP] operator[SEP] operator[SEP] identifier[setFileApplication] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_project] operator[SEP] identifier[getProjectProperties] operator[SEP] operator[SEP] operator[SEP] identifier[setFileType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_eventManager] operator[SEP] identifier[addProjectListeners] operator[SEP] identifier[m_projectListeners] operator[SEP] operator[SEP] identifier[processResources] operator[SEP] operator[SEP] operator[SEP] identifier[processTasks] operator[SEP] operator[SEP] operator[SEP] identifier[processDependencies] operator[SEP] operator[SEP] operator[SEP] identifier[processAssignments] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[m_project] operator[SEP]
}
|
@Override
public List<String> getSendAuthnContextClassRefs(ProfileRequestContext<?, ?> context, List<String> assuranceURIs,
boolean idpSupportsSignMessage) throws ExternalAutenticationErrorCodeException {
final String logId = this.getLogString(context);
AuthnContextClassContext authnContextClassContext = this.getAuthnContextClassContext(context);
authnContextClassContext.setProxiedIdPSupportsSignMessage(idpSupportsSignMessage);
// Intermediate list holding the URI:s that should be sent in the AuthnRequest to the IdP.
//
List<String> urisToSend = new ArrayList<>();
if (assuranceURIs == null || assuranceURIs.isEmpty()) {
log.info("No assurance certification specified by IdP - No matching against SP AuthnContext URI:s will be performed [{}]", logId);
urisToSend.addAll(authnContextClassContext.getAuthnContextClassRefs());
}
else {
// If the IdP understands sign message, we simply delete the requested URI:s that are not supported
// by the IdP.
//
if (idpSupportsSignMessage) {
for (String uri : authnContextClassContext.getAuthnContextClassRefs()) {
if (this.isSupported(context, uri, assuranceURIs)) {
urisToSend.add(uri);
}
else {
log.info("Requested AuthnContext URI '{}' is not supported by receiving IdP - will remove [{}]", uri, logId);
authnContextClassContext.deleteAuthnContextClassRef(uri);
}
}
}
// Otherwise it is a bit trickier, we have to remove requested sigmessage URI:s based on their base URI:s
// if the base URI is not supported by the IdP.
else {
for (String uri : authnContextClassContext.getAuthnContextClassRefs()) {
String baseUri = this.toBaseURI(uri);
if (this.isSupported(context, baseUri, assuranceURIs)) {
urisToSend.add(baseUri);
}
else {
log.info("Requested AuthnContext URI '{}' is not supported by receiving IdP - will remove [{}]", uri, logId);
authnContextClassContext.deleteAuthnContextClassRef(uri);
}
}
}
}
// There may be duplicates in the list.
//
urisToSend.stream().distinct().collect(Collectors.toList());
// Transform list so that the IdP understands it.
//
urisToSend = this.transformForIdp(context, urisToSend);
// Now, if no more AuthContext URI:s remain, we must fail since there is not point is sending a request
// to the IdP and get back an Assertion that we can't return back to the SP.
//
if (urisToSend.isEmpty()) {
final String msg = "No matching AuthnContext URI:s remain after matching against IdP declared assurance certification";
log.info("{} - failing [{}]", msg, logId);
throw new ExternalAutenticationErrorCodeException(AuthnEventIds.REQUEST_UNSUPPORTED, msg);
}
authnContextClassContext.setProxiedAuthnContextClassRefs(urisToSend);
log.debug("Will include the following AuthnContextClassRef URI:s in AuthnContext: {} [{}]", urisToSend, logId);
return authnContextClassContext.getProxiedAuthnContextClassRefs();
} | class class_name[name] begin[{]
method[getSendAuthnContextClassRefs, return_type[type[List]], modifier[public], parameter[context, assuranceURIs, idpSupportsSignMessage]] begin[{]
local_variable[type[String], logId]
local_variable[type[AuthnContextClassContext], authnContextClassContext]
call[authnContextClassContext.setProxiedIdPSupportsSignMessage, parameter[member[.idpSupportsSignMessage]]]
local_variable[type[List], urisToSend]
if[binary_operation[binary_operation[member[.assuranceURIs], ==, literal[null]], ||, call[assuranceURIs.isEmpty, parameter[]]]] begin[{]
call[log.info, parameter[literal["No assurance certification specified by IdP - No matching against SP AuthnContext URI:s will be performed [{}]"], member[.logId]]]
call[urisToSend.addAll, parameter[call[authnContextClassContext.getAuthnContextClassRefs, parameter[]]]]
else begin[{]
if[member[.idpSupportsSignMessage]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=assuranceURIs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSupported, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Requested AuthnContext URI '{}' is not supported by receiving IdP - will remove [{}]"), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=logId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteAuthnContextClassRef, postfix_operators=[], prefix_operators=[], qualifier=authnContextClassContext, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=urisToSend, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAuthnContextClassRefs, postfix_operators=[], prefix_operators=[], qualifier=authnContextClassContext, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBaseURI, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=baseUri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=baseUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=assuranceURIs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSupported, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Requested AuthnContext URI '{}' is not supported by receiving IdP - will remove [{}]"), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=logId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteAuthnContextClassRef, postfix_operators=[], prefix_operators=[], qualifier=authnContextClassContext, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=baseUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=urisToSend, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAuthnContextClassRefs, postfix_operators=[], prefix_operators=[], qualifier=authnContextClassContext, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
end[}]
call[urisToSend.stream, parameter[]]
assign[member[.urisToSend], THIS[call[None.transformForIdp, parameter[member[.context], member[.urisToSend]]]]]
if[call[urisToSend.isEmpty, parameter[]]] begin[{]
local_variable[type[String], msg]
call[log.info, parameter[literal["{} - failing [{}]"], member[.msg], member[.logId]]]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=REQUEST_UNSUPPORTED, postfix_operators=[], prefix_operators=[], qualifier=AuthnEventIds, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExternalAutenticationErrorCodeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[authnContextClassContext.setProxiedAuthnContextClassRefs, parameter[member[.urisToSend]]]
call[log.debug, parameter[literal["Will include the following AuthnContextClassRef URI:s in AuthnContext: {} [{}]"], member[.urisToSend], member[.logId]]]
return[call[authnContextClassContext.getProxiedAuthnContextClassRefs, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getSendAuthnContextClassRefs] operator[SEP] identifier[ProfileRequestContext] operator[<] operator[?] , operator[?] operator[>] identifier[context] , identifier[List] operator[<] identifier[String] operator[>] identifier[assuranceURIs] , Keyword[boolean] identifier[idpSupportsSignMessage] operator[SEP] Keyword[throws] identifier[ExternalAutenticationErrorCodeException] {
Keyword[final] identifier[String] identifier[logId] operator[=] Keyword[this] operator[SEP] identifier[getLogString] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[AuthnContextClassContext] identifier[authnContextClassContext] operator[=] Keyword[this] operator[SEP] identifier[getAuthnContextClassContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[authnContextClassContext] operator[SEP] identifier[setProxiedIdPSupportsSignMessage] operator[SEP] identifier[idpSupportsSignMessage] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[urisToSend] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[assuranceURIs] operator[==] Other[null] operator[||] identifier[assuranceURIs] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[logId] operator[SEP] operator[SEP] identifier[urisToSend] operator[SEP] identifier[addAll] operator[SEP] identifier[authnContextClassContext] operator[SEP] identifier[getAuthnContextClassRefs] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[idpSupportsSignMessage] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[uri] operator[:] identifier[authnContextClassContext] operator[SEP] identifier[getAuthnContextClassRefs] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isSupported] operator[SEP] identifier[context] , identifier[uri] , identifier[assuranceURIs] operator[SEP] operator[SEP] {
identifier[urisToSend] operator[SEP] identifier[add] operator[SEP] identifier[uri] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[uri] , identifier[logId] operator[SEP] operator[SEP] identifier[authnContextClassContext] operator[SEP] identifier[deleteAuthnContextClassRef] operator[SEP] identifier[uri] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[String] identifier[uri] operator[:] identifier[authnContextClassContext] operator[SEP] identifier[getAuthnContextClassRefs] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[baseUri] operator[=] Keyword[this] operator[SEP] identifier[toBaseURI] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isSupported] operator[SEP] identifier[context] , identifier[baseUri] , identifier[assuranceURIs] operator[SEP] operator[SEP] {
identifier[urisToSend] operator[SEP] identifier[add] operator[SEP] identifier[baseUri] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[uri] , identifier[logId] operator[SEP] operator[SEP] identifier[authnContextClassContext] operator[SEP] identifier[deleteAuthnContextClassRef] operator[SEP] identifier[uri] operator[SEP] operator[SEP]
}
}
}
}
identifier[urisToSend] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[distinct] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[urisToSend] operator[=] Keyword[this] operator[SEP] identifier[transformForIdp] operator[SEP] identifier[context] , identifier[urisToSend] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[urisToSend] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[msg] operator[=] literal[String] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[msg] , identifier[logId] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ExternalAutenticationErrorCodeException] operator[SEP] identifier[AuthnEventIds] operator[SEP] identifier[REQUEST_UNSUPPORTED] , identifier[msg] operator[SEP] operator[SEP]
}
identifier[authnContextClassContext] operator[SEP] identifier[setProxiedAuthnContextClassRefs] operator[SEP] identifier[urisToSend] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[urisToSend] , identifier[logId] operator[SEP] operator[SEP] Keyword[return] identifier[authnContextClassContext] operator[SEP] identifier[getProxiedAuthnContextClassRefs] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void status(String statusText) {
try {
getEventManager().fireLocalEvent(STATUS_EVENT, statusText == null ? "" : statusText);
} catch (Throwable e) {
log.error(e);
}
} | class class_name[name] begin[{]
method[status, return_type[void], modifier[public static], parameter[statusText]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getEventManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=STATUS_EVENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=statusText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=statusText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], member=fireLocalEvent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[status] operator[SEP] identifier[String] identifier[statusText] operator[SEP] {
Keyword[try] {
identifier[getEventManager] operator[SEP] operator[SEP] operator[SEP] identifier[fireLocalEvent] operator[SEP] identifier[STATUS_EVENT] , identifier[statusText] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[statusText] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
private static PrivateKey privateKeyFromBigInteger(BigInteger priv) {
if (priv == null) {
return null;
} else {
try {
return ECKeyFactory.getInstance(SpongyCastleProvider.getInstance())
.generatePrivate(new ECPrivateKeySpec(priv, CURVE_SPEC));
} catch (InvalidKeySpecException ex) {
throw new AssertionError("Assumed correct key spec statically");
}
}
} | class class_name[name] begin[{]
method[privateKeyFromBigInteger, return_type[type[PrivateKey]], modifier[private static], parameter[priv]] begin[{]
if[binary_operation[member[.priv], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SpongyCastleProvider, selectors=[], type_arguments=None)], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=ECKeyFactory, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=priv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CURVE_SPEC, 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=ECPrivateKeySpec, sub_type=None))], member=generatePrivate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Assumed correct key spec statically")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InvalidKeySpecException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[PrivateKey] identifier[privateKeyFromBigInteger] operator[SEP] identifier[BigInteger] identifier[priv] operator[SEP] {
Keyword[if] operator[SEP] identifier[priv] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[try] {
Keyword[return] identifier[ECKeyFactory] operator[SEP] identifier[getInstance] operator[SEP] identifier[SpongyCastleProvider] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[generatePrivate] operator[SEP] Keyword[new] identifier[ECPrivateKeySpec] operator[SEP] identifier[priv] , identifier[CURVE_SPEC] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvalidKeySpecException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
|
public static void throwIfUnchecked(Throwable t) {
Preconditions.checkNotNull(t);
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
if (t instanceof Error) {
throw (Error) t;
}
} | class class_name[name] begin[{]
method[throwIfUnchecked, return_type[void], modifier[public static], parameter[t]] begin[{]
call[Preconditions.checkNotNull, parameter[member[.t]]]
if[binary_operation[member[.t], instanceof, type[RuntimeException]]] begin[{]
ThrowStatement(expression=Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.t], instanceof, type[Error]]] begin[{]
ThrowStatement(expression=Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[throwIfUnchecked] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[RuntimeException] operator[SEP] {
Keyword[throw] operator[SEP] identifier[RuntimeException] operator[SEP] identifier[t] operator[SEP]
}
Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[Error] operator[SEP] {
Keyword[throw] operator[SEP] identifier[Error] operator[SEP] identifier[t] operator[SEP]
}
}
|
public void runBenchmark() throws Exception {
System.out.print(HORIZONTAL_RULE);
System.out.println(" Setup & Initialization");
System.out.println(HORIZONTAL_RULE);
// connect to one or more servers, loop until success
connect(config.servers);
System.out.print(HORIZONTAL_RULE);
System.out.println(" Starting Benchmark");
System.out.println(HORIZONTAL_RULE);
// reset the stats after warmup
fullStatsContext.fetchAndResetBaseline();
periodicStatsContext.fetchAndResetBaseline();
// print periodic statistics to the console
benchmarkStartTS = System.currentTimeMillis();
schedulePeriodicStats();
// Run the benchmark loop for the requested duration
// The throughput may be throttled depending on client configuration
System.out.println("\nRunning benchmark...");
final long benchmarkEndTime = System.currentTimeMillis() + (1000l * config.duration);
while (benchmarkEndTime > System.currentTimeMillis()) {
long[] pair = generator.getNextAppIdAndUniqueDeviceId();
int appId = (int) pair[0];
long nextValue = pair[1];
long hashedValue = MurmurHash.hash64(nextValue);
client.callProcedure(new CountCallback(),
"CountDeviceEstimate",
appId,
hashedValue);
}
// cancel periodic stats printing
timer.cancel();
// block until all outstanding txns return
client.drain();
// print the summary results
printResults();
// close down the client connections
client.close();
} | class class_name[name] begin[{]
method[runBenchmark, return_type[void], modifier[public], parameter[]] begin[{]
call[System.out.print, parameter[member[.HORIZONTAL_RULE]]]
call[System.out.println, parameter[literal[" Setup & Initialization"]]]
call[System.out.println, parameter[member[.HORIZONTAL_RULE]]]
call[.connect, parameter[member[config.servers]]]
call[System.out.print, parameter[member[.HORIZONTAL_RULE]]]
call[System.out.println, parameter[literal[" Starting Benchmark"]]]
call[System.out.println, parameter[member[.HORIZONTAL_RULE]]]
call[fullStatsContext.fetchAndResetBaseline, parameter[]]
call[periodicStatsContext.fetchAndResetBaseline, parameter[]]
assign[member[.benchmarkStartTS], call[System.currentTimeMillis, parameter[]]]
call[.schedulePeriodicStats, parameter[]]
call[System.out.println, parameter[literal["\nRunning benchmark..."]]]
local_variable[type[long], benchmarkEndTime]
while[binary_operation[member[.benchmarkEndTime], >, call[System.currentTimeMillis, parameter[]]]] begin[{]
local_variable[type[long], pair]
local_variable[type[int], appId]
local_variable[type[long], nextValue]
local_variable[type[long], hashedValue]
call[client.callProcedure, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CountCallback, sub_type=None)), literal["CountDeviceEstimate"], member[.appId], member[.hashedValue]]]
end[}]
call[timer.cancel, parameter[]]
call[client.drain, parameter[]]
call[.printResults, parameter[]]
call[client.close, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[runBenchmark] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[HORIZONTAL_RULE] 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] identifier[HORIZONTAL_RULE] operator[SEP] operator[SEP] identifier[connect] operator[SEP] identifier[config] operator[SEP] identifier[servers] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[HORIZONTAL_RULE] 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] identifier[HORIZONTAL_RULE] operator[SEP] operator[SEP] identifier[fullStatsContext] operator[SEP] identifier[fetchAndResetBaseline] operator[SEP] operator[SEP] operator[SEP] identifier[periodicStatsContext] operator[SEP] identifier[fetchAndResetBaseline] operator[SEP] operator[SEP] operator[SEP] identifier[benchmarkStartTS] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[schedulePeriodicStats] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[benchmarkEndTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] operator[SEP] Other[1000l] operator[*] identifier[config] operator[SEP] identifier[duration] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[benchmarkEndTime] operator[>] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] {
Keyword[long] operator[SEP] operator[SEP] identifier[pair] operator[=] identifier[generator] operator[SEP] identifier[getNextAppIdAndUniqueDeviceId] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[appId] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[pair] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[long] identifier[nextValue] operator[=] identifier[pair] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[long] identifier[hashedValue] operator[=] identifier[MurmurHash] operator[SEP] identifier[hash64] operator[SEP] identifier[nextValue] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[callProcedure] operator[SEP] Keyword[new] identifier[CountCallback] operator[SEP] operator[SEP] , literal[String] , identifier[appId] , identifier[hashedValue] operator[SEP] operator[SEP]
}
identifier[timer] operator[SEP] identifier[cancel] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[drain] operator[SEP] operator[SEP] operator[SEP] identifier[printResults] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
|
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> doAfterNext(Consumer<? super T> onAfterNext) {
ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is null");
return RxJavaPlugins.onAssembly(new ObservableDoAfterNext<T>(this, onAfterNext));
} | class class_name[name] begin[{]
method[doAfterNext, return_type[type[Observable]], modifier[final public], parameter[onAfterNext]] begin[{]
call[ObjectHelper.requireNonNull, parameter[member[.onAfterNext], literal["onAfterNext is null"]]]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=onAfterNext, 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=ObservableDoAfterNext, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[final] identifier[Observable] operator[<] identifier[T] operator[>] identifier[doAfterNext] operator[SEP] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[onAfterNext] operator[SEP] {
identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[onAfterNext] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ObservableDoAfterNext] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[onAfterNext] operator[SEP] operator[SEP] operator[SEP]
}
|
@BetaApi
public final Policy getIamPolicyInstanceTemplate(
ProjectGlobalInstanceTemplateResourceName resource) {
GetIamPolicyInstanceTemplateHttpRequest request =
GetIamPolicyInstanceTemplateHttpRequest.newBuilder()
.setResource(resource == null ? null : resource.toString())
.build();
return getIamPolicyInstanceTemplate(request);
} | class class_name[name] begin[{]
method[getIamPolicyInstanceTemplate, return_type[type[Policy]], modifier[final public], parameter[resource]] begin[{]
local_variable[type[GetIamPolicyInstanceTemplateHttpRequest], request]
return[call[.getIamPolicyInstanceTemplate, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Policy] identifier[getIamPolicyInstanceTemplate] operator[SEP] identifier[ProjectGlobalInstanceTemplateResourceName] identifier[resource] operator[SEP] {
identifier[GetIamPolicyInstanceTemplateHttpRequest] identifier[request] operator[=] identifier[GetIamPolicyInstanceTemplateHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setResource] operator[SEP] identifier[resource] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[resource] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getIamPolicyInstanceTemplate] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void applySequenceConditionToRequest(final HttpURLConnection request) {
if (this.ifSequenceNumberLessThanOrEqual != null) {
request.setRequestProperty(
Constants.HeaderConstants.IF_SEQUENCE_NUMBER_LESS_THAN_OR_EQUAL,
this.ifSequenceNumberLessThanOrEqual.toString());
}
if (this.ifSequenceNumberLessThan != null) {
request.setRequestProperty(
Constants.HeaderConstants.IF_SEQUENCE_NUMBER_LESS_THAN,
this.ifSequenceNumberLessThan.toString());
}
if (this.ifSequenceNumberEqual != null) {
request.setRequestProperty(
Constants.HeaderConstants.IF_SEQUENCE_NUMBER_EQUAL,
this.ifSequenceNumberEqual.toString());
}
} | class class_name[name] begin[{]
method[applySequenceConditionToRequest, return_type[void], modifier[public], parameter[request]] begin[{]
if[binary_operation[THIS[member[None.ifSequenceNumberLessThanOrEqual]], !=, literal[null]]] begin[{]
call[request.setRequestProperty, parameter[member[Constants.HeaderConstants.IF_SEQUENCE_NUMBER_LESS_THAN_OR_EQUAL], THIS[member[None.ifSequenceNumberLessThanOrEqual]call[None.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.ifSequenceNumberLessThan]], !=, literal[null]]] begin[{]
call[request.setRequestProperty, parameter[member[Constants.HeaderConstants.IF_SEQUENCE_NUMBER_LESS_THAN], THIS[member[None.ifSequenceNumberLessThan]call[None.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.ifSequenceNumberEqual]], !=, literal[null]]] begin[{]
call[request.setRequestProperty, parameter[member[Constants.HeaderConstants.IF_SEQUENCE_NUMBER_EQUAL], THIS[member[None.ifSequenceNumberEqual]call[None.toString, parameter[]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[applySequenceConditionToRequest] operator[SEP] Keyword[final] identifier[HttpURLConnection] identifier[request] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[ifSequenceNumberLessThanOrEqual] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[IF_SEQUENCE_NUMBER_LESS_THAN_OR_EQUAL] , Keyword[this] operator[SEP] identifier[ifSequenceNumberLessThanOrEqual] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[ifSequenceNumberLessThan] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[IF_SEQUENCE_NUMBER_LESS_THAN] , Keyword[this] operator[SEP] identifier[ifSequenceNumberLessThan] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[ifSequenceNumberEqual] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[IF_SEQUENCE_NUMBER_EQUAL] , Keyword[this] operator[SEP] identifier[ifSequenceNumberEqual] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public List<Object> sortAndFilter() {
final List filteredList = getFilteredValue();
filteredList.clear();
rowMap = new HashMap<>();
rowNumbers = new HashMap<>();
final Collection<?> values = (Collection<?>) getValue();
if (values == null || values.isEmpty()) {
return filteredList;
}
remapRows();
boolean filters = false;
for (final SheetColumn col : getColumns()) {
if (!LangUtils.isValueBlank(col.getFilterValue())) {
filters = true;
break;
}
}
final FacesContext context = FacesContext.getCurrentInstance();
final Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
final String var = getVar();
if (filters) {
// iterate and add those matching the filters
for (final Object obj : values) {
requestMap.put(var, obj);
if (matchesFilter(obj)) {
filteredList.add(obj);
}
}
}
else {
filteredList.addAll(values);
}
final ValueExpression veSortBy = getValueExpression(PropertyKeys.sortBy.name());
if (veSortBy != null) {
Collections.sort(filteredList, new BeanPropertyComparator(veSortBy, var, convertSortOrder(), null,
isCaseSensitiveSort(), Locale.ENGLISH, getNullSortOrder()));
}
// map filtered rows
remapFilteredList(filteredList);
return filteredList;
} | class class_name[name] begin[{]
method[sortAndFilter, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], filteredList]
call[filteredList.clear, parameter[]]
assign[member[.rowMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
assign[member[.rowNumbers], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
local_variable[type[Collection], values]
if[binary_operation[binary_operation[member[.values], ==, literal[null]], ||, call[values.isEmpty, parameter[]]]] begin[{]
return[member[.filteredList]]
else begin[{]
None
end[}]
call[.remapRows, parameter[]]
local_variable[type[boolean], filters]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFilterValue, postfix_operators=[], prefix_operators=[], qualifier=col, selectors=[], type_arguments=None)], member=isValueBlank, postfix_operators=[], prefix_operators=['!'], qualifier=LangUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=filters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=col)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SheetColumn, sub_type=None))), label=None)
local_variable[type[FacesContext], context]
local_variable[type[Map], requestMap]
local_variable[type[String], var]
if[member[.filters]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=requestMap, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matchesFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=filteredList, 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=obj)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
else begin[{]
call[filteredList.addAll, parameter[member[.values]]]
end[}]
local_variable[type[ValueExpression], veSortBy]
if[binary_operation[member[.veSortBy], !=, literal[null]]] begin[{]
call[Collections.sort, parameter[member[.filteredList], ClassCreator(arguments=[MemberReference(member=veSortBy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=convertSortOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=isCaseSensitiveSort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=ENGLISH, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[]), MethodInvocation(arguments=[], member=getNullSortOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BeanPropertyComparator, sub_type=None))]]
else begin[{]
None
end[}]
call[.remapFilteredList, parameter[member[.filteredList]]]
return[member[.filteredList]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[Object] operator[>] identifier[sortAndFilter] operator[SEP] operator[SEP] {
Keyword[final] identifier[List] identifier[filteredList] operator[=] identifier[getFilteredValue] operator[SEP] operator[SEP] operator[SEP] identifier[filteredList] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[rowMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[rowNumbers] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Collection] operator[<] operator[?] operator[>] identifier[values] operator[=] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[==] Other[null] operator[||] identifier[values] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[filteredList] operator[SEP]
}
identifier[remapRows] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[filters] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[SheetColumn] identifier[col] operator[:] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[LangUtils] operator[SEP] identifier[isValueBlank] operator[SEP] identifier[col] operator[SEP] identifier[getFilterValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[filters] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[final] identifier[FacesContext] identifier[context] operator[=] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[requestMap] operator[=] identifier[context] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestMap] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[var] operator[=] identifier[getVar] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filters] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[Object] identifier[obj] operator[:] identifier[values] operator[SEP] {
identifier[requestMap] operator[SEP] identifier[put] operator[SEP] identifier[var] , identifier[obj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matchesFilter] operator[SEP] identifier[obj] operator[SEP] operator[SEP] {
identifier[filteredList] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[filteredList] operator[SEP] identifier[addAll] operator[SEP] identifier[values] operator[SEP] operator[SEP]
}
Keyword[final] identifier[ValueExpression] identifier[veSortBy] operator[=] identifier[getValueExpression] operator[SEP] identifier[PropertyKeys] operator[SEP] identifier[sortBy] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[veSortBy] operator[!=] Other[null] operator[SEP] {
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[filteredList] , Keyword[new] identifier[BeanPropertyComparator] operator[SEP] identifier[veSortBy] , identifier[var] , identifier[convertSortOrder] operator[SEP] operator[SEP] , Other[null] , identifier[isCaseSensitiveSort] operator[SEP] operator[SEP] , identifier[Locale] operator[SEP] identifier[ENGLISH] , identifier[getNullSortOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[remapFilteredList] operator[SEP] identifier[filteredList] operator[SEP] operator[SEP] Keyword[return] identifier[filteredList] operator[SEP]
}
|
private void generateSetJspContext(TagInfo tagInfo) {
boolean nestedSeen = false;
boolean atBeginSeen = false;
boolean atEndSeen = false;
// Determine if there are any aliases
boolean aliasSeen = false;
TagVariableInfo[] tagVars = tagInfo.getTagVariableInfos();
for (int i = 0; i < tagVars.length; i++) {
if (tagVars[i].getNameFromAttribute() != null
&& tagVars[i].getNameGiven() != null) {
aliasSeen = true;
break;
}
}
if (aliasSeen) {
out.printil(
"public void setJspContext(JspContext ctx, java.util.Map aliasMap) {");
} else {
out.printil("public void setJspContext(JspContext ctx) {");
}
out.pushIndent();
out.printil("super.setJspContext(ctx);");
out.printil("java.util.ArrayList<String> _jspx_nested = null;");
out.printil("java.util.ArrayList<String> _jspx_at_begin = null;");
out.printil("java.util.ArrayList<String> _jspx_at_end = null;");
for (int i = 0; i < tagVars.length; i++) {
switch (tagVars[i].getScope()) {
case VariableInfo.NESTED :
if (!nestedSeen) {
out.printil(
"_jspx_nested = new java.util.ArrayList<String>();");
nestedSeen = true;
}
out.printin("_jspx_nested.add(");
break;
case VariableInfo.AT_BEGIN :
if (!atBeginSeen) {
out.printil(
"_jspx_at_begin = new java.util.ArrayList<String>();");
atBeginSeen = true;
}
out.printin("_jspx_at_begin.add(");
break;
case VariableInfo.AT_END :
if (!atEndSeen) {
out.printil(
"_jspx_at_end = new java.util.ArrayList<String>();");
atEndSeen = true;
}
out.printin("_jspx_at_end.add(");
break;
} // switch
out.print(quote(tagVars[i].getNameGiven()));
out.println(");");
}
if (aliasSeen) {
out.printil(
"this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, aliasMap);");
} else {
out.printil(
"this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);");
}
out.popIndent();
out.printil("}");
out.println();
out.printil("public JspContext getJspContext() {");
out.pushIndent();
out.printil("return this.jspContext;");
out.popIndent();
out.printil("}");
} | class class_name[name] begin[{]
method[generateSetJspContext, return_type[void], modifier[private], parameter[tagInfo]] begin[{]
local_variable[type[boolean], nestedSeen]
local_variable[type[boolean], atBeginSeen]
local_variable[type[boolean], atEndSeen]
local_variable[type[boolean], aliasSeen]
local_variable[type[TagVariableInfo], tagVars]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tagVars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getNameFromAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=tagVars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getNameGiven, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=aliasSeen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tagVars, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[.aliasSeen]] begin[{]
call[out.printil, parameter[literal["public void setJspContext(JspContext ctx, java.util.Map aliasMap) {"]]]
else begin[{]
call[out.printil, parameter[literal["public void setJspContext(JspContext ctx) {"]]]
end[}]
call[out.pushIndent, parameter[]]
call[out.printil, parameter[literal["super.setJspContext(ctx);"]]]
call[out.printil, parameter[literal["java.util.ArrayList<String> _jspx_nested = null;"]]]
call[out.printil, parameter[literal["java.util.ArrayList<String> _jspx_at_begin = null;"]]]
call[out.printil, parameter[literal["java.util.ArrayList<String> _jspx_at_end = null;"]]]
ForStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=NESTED, postfix_operators=[], prefix_operators=[], qualifier=VariableInfo, selectors=[])], statements=[IfStatement(condition=MemberReference(member=nestedSeen, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_jspx_nested = new java.util.ArrayList<String>();")], member=printil, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nestedSeen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_jspx_nested.add(")], member=printin, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=AT_BEGIN, postfix_operators=[], prefix_operators=[], qualifier=VariableInfo, selectors=[])], statements=[IfStatement(condition=MemberReference(member=atBeginSeen, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_jspx_at_begin = new java.util.ArrayList<String>();")], member=printil, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=atBeginSeen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_jspx_at_begin.add(")], member=printin, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=AT_END, postfix_operators=[], prefix_operators=[], qualifier=VariableInfo, selectors=[])], statements=[IfStatement(condition=MemberReference(member=atEndSeen, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_jspx_at_end = new java.util.ArrayList<String>();")], member=printil, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=atEndSeen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_jspx_at_end.add(")], member=printin, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=tagVars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getScope, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=tagVars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getNameGiven, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=quote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=");")], member=println, postfix_operators=[], prefix_operators=[], qualifier=out, 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=tagVars, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[.aliasSeen]] begin[{]
call[out.printil, parameter[literal["this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, aliasMap);"]]]
else begin[{]
call[out.printil, parameter[literal["this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);"]]]
end[}]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["}"]]]
call[out.println, parameter[]]
call[out.printil, parameter[literal["public JspContext getJspContext() {"]]]
call[out.pushIndent, parameter[]]
call[out.printil, parameter[literal["return this.jspContext;"]]]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["}"]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[generateSetJspContext] operator[SEP] identifier[TagInfo] identifier[tagInfo] operator[SEP] {
Keyword[boolean] identifier[nestedSeen] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[atBeginSeen] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[atEndSeen] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[aliasSeen] operator[=] literal[boolean] operator[SEP] identifier[TagVariableInfo] operator[SEP] operator[SEP] identifier[tagVars] operator[=] identifier[tagInfo] operator[SEP] identifier[getTagVariableInfos] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tagVars] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[tagVars] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getNameFromAttribute] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[tagVars] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getNameGiven] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[aliasSeen] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[aliasSeen] operator[SEP] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[out] operator[SEP] identifier[pushIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tagVars] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[switch] operator[SEP] identifier[tagVars] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getScope] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[VariableInfo] operator[SEP] identifier[NESTED] operator[:] Keyword[if] operator[SEP] operator[!] identifier[nestedSeen] operator[SEP] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[nestedSeen] operator[=] literal[boolean] operator[SEP]
}
identifier[out] operator[SEP] identifier[printin] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[VariableInfo] operator[SEP] identifier[AT_BEGIN] operator[:] Keyword[if] operator[SEP] operator[!] identifier[atBeginSeen] operator[SEP] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[atBeginSeen] operator[=] literal[boolean] operator[SEP]
}
identifier[out] operator[SEP] identifier[printin] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[VariableInfo] operator[SEP] identifier[AT_END] operator[:] Keyword[if] operator[SEP] operator[!] identifier[atEndSeen] operator[SEP] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[atEndSeen] operator[=] literal[boolean] operator[SEP]
}
identifier[out] operator[SEP] identifier[printin] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[quote] operator[SEP] identifier[tagVars] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getNameGiven] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[aliasSeen] operator[SEP] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[pushIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public void removeGroup(int removed) {
List<L> cards = getGroups();
if (removed >= 0 && removed < cards.size()) {
boolean changed = cards.remove(removed) != null;
if (changed) {
setData(cards);
}
}
} | class class_name[name] begin[{]
method[removeGroup, return_type[void], modifier[public], parameter[removed]] begin[{]
local_variable[type[List], cards]
if[binary_operation[binary_operation[member[.removed], >=, literal[0]], &&, binary_operation[member[.removed], <, call[cards.size, parameter[]]]]] begin[{]
local_variable[type[boolean], changed]
if[member[.changed]] begin[{]
call[.setData, parameter[member[.cards]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[removeGroup] operator[SEP] Keyword[int] identifier[removed] operator[SEP] {
identifier[List] operator[<] identifier[L] operator[>] identifier[cards] operator[=] identifier[getGroups] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[removed] operator[>=] Other[0] operator[&&] identifier[removed] operator[<] identifier[cards] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[changed] operator[=] identifier[cards] operator[SEP] identifier[remove] operator[SEP] identifier[removed] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[changed] operator[SEP] {
identifier[setData] operator[SEP] identifier[cards] operator[SEP] operator[SEP]
}
}
}
|
public BaseHttp2ServerBuilder setTrustedServerCertificateChain(final X509Certificate... certificates) {
this.trustedClientCertificatePemFile = null;
this.trustedClientCertificateInputStream = null;
this.trustedClientCertificates = certificates;
return this;
} | class class_name[name] begin[{]
method[setTrustedServerCertificateChain, return_type[type[BaseHttp2ServerBuilder]], modifier[public], parameter[certificates]] begin[{]
assign[THIS[member[None.trustedClientCertificatePemFile]], literal[null]]
assign[THIS[member[None.trustedClientCertificateInputStream]], literal[null]]
assign[THIS[member[None.trustedClientCertificates]], member[.certificates]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[BaseHttp2ServerBuilder] identifier[setTrustedServerCertificateChain] operator[SEP] Keyword[final] identifier[X509Certificate] operator[...] identifier[certificates] operator[SEP] {
Keyword[this] operator[SEP] identifier[trustedClientCertificatePemFile] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[trustedClientCertificateInputStream] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[trustedClientCertificates] operator[=] identifier[certificates] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public void write(OutputStream out, Map<String, String> outputProperties) throws TransformerException {
write(new Utf8Writer(out), outputProperties);
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[out, outputProperties]] begin[{]
call[.write, parameter[ClassCreator(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Utf8Writer, sub_type=None)), member[.outputProperties]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[OutputStream] identifier[out] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[outputProperties] operator[SEP] Keyword[throws] identifier[TransformerException] {
identifier[write] operator[SEP] Keyword[new] identifier[Utf8Writer] operator[SEP] identifier[out] operator[SEP] , identifier[outputProperties] operator[SEP] operator[SEP]
}
|
public final void entryRuleXPrimaryExpression() throws RecognitionException {
try {
// InternalXbase.g:659:1: ( ruleXPrimaryExpression EOF )
// InternalXbase.g:660:1: ruleXPrimaryExpression EOF
{
if ( state.backtracking==0 ) {
before(grammarAccess.getXPrimaryExpressionRule());
}
pushFollow(FOLLOW_1);
ruleXPrimaryExpression();
state._fsp--;
if (state.failed) return ;
if ( state.backtracking==0 ) {
after(grammarAccess.getXPrimaryExpressionRule());
}
match(input,EOF,FOLLOW_2); if (state.failed) return ;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
} | class class_name[name] begin[{]
method[entryRuleXPrimaryExpression, return_type[void], modifier[final public], parameter[]] begin[{]
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=getXPrimaryExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=before, 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=MethodInvocation(arguments=[], member=ruleXPrimaryExpression, 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=None, 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=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXPrimaryExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=after, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=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=None, label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[None]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[entryRuleXPrimaryExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
{
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXPrimaryExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pushFollow] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[ruleXPrimaryExpression] 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] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXPrimaryExpressionRule] operator[SEP] operator[SEP] operator[SEP] 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] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] operator[SEP]
}
|
protected Object createCacheEntry(String host, String[] ips) {
try {
long expiration = System.currentTimeMillis() + EXPIRATION;// 10年失效
InetAddress[] addresses = new InetAddress[ips.length];
for (int i = 0; i < addresses.length; i++) {
// addresses[i] = InetAddress.getByAddress(host, toBytes(ips[i]));
addresses[i] = InetAddress.getByAddress(host, InetAddress.getByName(ips[i]).getAddress());
}
String className = "java.net.InetAddress$CacheEntry";
Class<?> clazz = Class.forName(className);
Constructor<?> constructor = clazz.getDeclaredConstructors()[0];
constructor.setAccessible(true);
return constructor.newInstance(addresses, expiration);
}
catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[createCacheEntry, return_type[type[Object]], modifier[protected], parameter[host, ips]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MemberReference(member=EXPIRATION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=expiration)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ips, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetAddress, sub_type=None)), name=addresses)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=InetAddress, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=ips, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getByName, postfix_operators=[], prefix_operators=[], qualifier=InetAddress, selectors=[MethodInvocation(arguments=[], member=getAddress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getByAddress, postfix_operators=[], prefix_operators=[], qualifier=InetAddress, 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=addresses, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.net.InetAddress$CacheEntry"), name=className)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDeclaredConstructors, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None), name=constructor)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Constructor, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=addresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expiration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, 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[protected] identifier[Object] identifier[createCacheEntry] operator[SEP] identifier[String] identifier[host] , identifier[String] operator[SEP] operator[SEP] identifier[ips] operator[SEP] {
Keyword[try] {
Keyword[long] identifier[expiration] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] identifier[EXPIRATION] operator[SEP] identifier[InetAddress] operator[SEP] operator[SEP] identifier[addresses] operator[=] Keyword[new] identifier[InetAddress] operator[SEP] identifier[ips] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[addresses] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[addresses] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[InetAddress] operator[SEP] identifier[getByAddress] operator[SEP] identifier[host] , identifier[InetAddress] operator[SEP] identifier[getByName] operator[SEP] identifier[ips] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[className] operator[=] literal[String] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[className] operator[SEP] operator[SEP] identifier[Constructor] operator[<] operator[?] operator[>] identifier[constructor] operator[=] identifier[clazz] operator[SEP] identifier[getDeclaredConstructors] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[constructor] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[constructor] operator[SEP] identifier[newInstance] operator[SEP] identifier[addresses] , identifier[expiration] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public java.util.List<FileSystemDescription> getFileSystems() {
if (fileSystems == null) {
fileSystems = new com.amazonaws.internal.SdkInternalList<FileSystemDescription>();
}
return fileSystems;
} | class class_name[name] begin[{]
method[getFileSystems, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.fileSystems], ==, literal[null]]] begin[{]
assign[member[.fileSystems], 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=FileSystemDescription, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.fileSystems]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[FileSystemDescription] operator[>] identifier[getFileSystems] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[fileSystems] operator[==] Other[null] operator[SEP] {
identifier[fileSystems] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[FileSystemDescription] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fileSystems] operator[SEP]
}
|
public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler,
BootstrapModule... bootstrapModules) {
RxServer<ByteBuf, ByteBuf> server = RxNetty.newTcpServerBuilder(port, handler).build();
return new RxNettyServerBackedServer(server, bootstrapModules);
} | class class_name[name] begin[{]
method[forTcpConnectionHandler, return_type[type[KaryonServer]], modifier[public static], parameter[port, handler, bootstrapModules]] begin[{]
local_variable[type[RxServer], server]
return[ClassCreator(arguments=[MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bootstrapModules, 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=RxNettyServerBackedServer, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[KaryonServer] identifier[forTcpConnectionHandler] operator[SEP] Keyword[int] identifier[port] , identifier[ConnectionHandler] operator[<] identifier[ByteBuf] , identifier[ByteBuf] operator[>] identifier[handler] , identifier[BootstrapModule] operator[...] identifier[bootstrapModules] operator[SEP] {
identifier[RxServer] operator[<] identifier[ByteBuf] , identifier[ByteBuf] operator[>] identifier[server] operator[=] identifier[RxNetty] operator[SEP] identifier[newTcpServerBuilder] operator[SEP] identifier[port] , identifier[handler] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[RxNettyServerBackedServer] operator[SEP] identifier[server] , identifier[bootstrapModules] operator[SEP] operator[SEP]
}
|
@InterfaceAudience.Private
protected Status updateIndexes(List<View> views) throws CouchbaseLiteException {
List<ViewStore> storages = new ArrayList<ViewStore>();
for (View view : views) {
storages.add(view.viewStore);
}
return viewStore.updateIndexes(storages);
} | class class_name[name] begin[{]
method[updateIndexes, return_type[type[Status]], modifier[protected], parameter[views]] begin[{]
local_variable[type[List], storages]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=viewStore, postfix_operators=[], prefix_operators=[], qualifier=view, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=storages, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=views, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=view)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=View, sub_type=None))), label=None)
return[call[viewStore.updateIndexes, parameter[member[.storages]]]]
end[}]
END[}] | annotation[@] identifier[InterfaceAudience] operator[SEP] identifier[Private] Keyword[protected] identifier[Status] identifier[updateIndexes] operator[SEP] identifier[List] operator[<] identifier[View] operator[>] identifier[views] operator[SEP] Keyword[throws] identifier[CouchbaseLiteException] {
identifier[List] operator[<] identifier[ViewStore] operator[>] identifier[storages] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ViewStore] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[View] identifier[view] operator[:] identifier[views] operator[SEP] {
identifier[storages] operator[SEP] identifier[add] operator[SEP] identifier[view] operator[SEP] identifier[viewStore] operator[SEP] operator[SEP]
}
Keyword[return] identifier[viewStore] operator[SEP] identifier[updateIndexes] operator[SEP] identifier[storages] operator[SEP] operator[SEP]
}
|
public Result with(String headerName, String headerContent) {
headers.put(headerName, headerContent);
return this;
} | class class_name[name] begin[{]
method[with, return_type[type[Result]], modifier[public], parameter[headerName, headerContent]] begin[{]
call[headers.put, parameter[member[.headerName], member[.headerContent]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Result] identifier[with] operator[SEP] identifier[String] identifier[headerName] , identifier[String] identifier[headerContent] operator[SEP] {
identifier[headers] operator[SEP] identifier[put] operator[SEP] identifier[headerName] , identifier[headerContent] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static int previousClearBit(long v, int start) {
if(start < 0) {
return -1;
}
start = start < Long.SIZE ? start : Long.SIZE - 1;
long cur = ~v & (LONG_ALL_BITS >>> -(start + 1));
return cur == 0 ? -1 : 63 - Long.numberOfLeadingZeros(cur);
} | class class_name[name] begin[{]
method[previousClearBit, return_type[type[int]], modifier[public static], parameter[v, start]] begin[{]
if[binary_operation[member[.start], <, literal[0]]] begin[{]
return[literal[1]]
else begin[{]
None
end[}]
assign[member[.start], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator=<), if_false=BinaryOperation(operandl=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), if_true=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
local_variable[type[long], cur]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=63), operandr=MethodInvocation(arguments=[MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=numberOfLeadingZeros, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), operator=-), if_true=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1))]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[previousClearBit] operator[SEP] Keyword[long] identifier[v] , Keyword[int] identifier[start] operator[SEP] {
Keyword[if] operator[SEP] identifier[start] operator[<] Other[0] operator[SEP] {
Keyword[return] operator[-] Other[1] operator[SEP]
}
identifier[start] operator[=] identifier[start] operator[<] identifier[Long] operator[SEP] identifier[SIZE] operator[?] identifier[start] operator[:] identifier[Long] operator[SEP] identifier[SIZE] operator[-] Other[1] operator[SEP] Keyword[long] identifier[cur] operator[=] operator[~] identifier[v] operator[&] operator[SEP] identifier[LONG_ALL_BITS] operator[>] operator[>] operator[>] operator[-] operator[SEP] identifier[start] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cur] operator[==] Other[0] operator[?] operator[-] Other[1] operator[:] Other[63] operator[-] identifier[Long] operator[SEP] identifier[numberOfLeadingZeros] operator[SEP] identifier[cur] operator[SEP] operator[SEP]
}
|
public SVG build() throws SVGParseException {
if (data == null) {
throw new IllegalStateException("SVG input not specified. Call one of the readFrom...() methods first.");
}
try {
final SVGHandler handler = new SVGHandler();
handler.setColorSwap(searchColor, replaceColor, overideOpacity);
handler.setWhiteMode(whiteMode);
if (strokeColorFilter != null) {
handler.strokePaint.setColorFilter(strokeColorFilter);
}
if (fillColorFilter != null) {
handler.fillPaint.setColorFilter(fillColorFilter);
}
// SVGZ support (based on https://github.com/josefpavlik/svg-android/commit/fc0522b2e1):
if(!data.markSupported())
data = new BufferedInputStream(data); // decorate stream so we can use mark/reset
try {
data.mark(4);
byte[] magic = new byte[2];
int r = data.read(magic, 0, 2);
int magicInt = (magic[0] + ((magic[1]) << 8)) & 0xffff;
data.reset();
if (r == 2 && magicInt == GZIPInputStream.GZIP_MAGIC) {
// Log.d(SVGParser.TAG, "SVG is gzipped");
GZIPInputStream gin = new GZIPInputStream(data);
data = gin;
}
} catch (IOException ioe) {
throw new SVGParseException(ioe);
}
final SVG svg = SVGParser.parse(new InputSource(data), handler);
return svg;
} finally {
if (closeInputStream) {
try {
data.close();
} catch (IOException e) {
Log.e(SVGParser.TAG, "Error closing SVG input stream.", e);
}
}
}
} | class class_name[name] begin[{]
method[build, return_type[type[SVG]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.data], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SVG input not specified. Call one of the readFrom...() methods first.")], 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[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SVGHandler, sub_type=None)), name=handler)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SVGHandler, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=searchColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=replaceColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=overideOpacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setColorSwap, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=whiteMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setWhiteMode, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=strokeColorFilter, 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=strokeColorFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setColorFilter, postfix_operators=[], prefix_operators=[], qualifier=handler.strokePaint, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fillColorFilter, 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=fillColorFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setColorFilter, postfix_operators=[], prefix_operators=[], qualifier=handler.fillPaint, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=markSupported, postfix_operators=[], prefix_operators=['!'], qualifier=data, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=data, 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=BufferedInputStream, sub_type=None))), label=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=mark, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=magic)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=magic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=read, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=magic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=BinaryOperation(operandl=MemberReference(member=magic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffff), operator=&), name=magicInt)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), operandr=BinaryOperation(operandl=MemberReference(member=magicInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=GZIP_MAGIC, postfix_operators=[], prefix_operators=[], qualifier=GZIPInputStream, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=data, 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=GZIPInputStream, sub_type=None)), name=gin)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GZIPInputStream, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ioe, 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=SVGParseException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=data, 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=InputSource, sub_type=None)), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=SVGParser, selectors=[], type_arguments=None), name=svg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SVG, sub_type=None)), ReturnStatement(expression=MemberReference(member=svg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=closeInputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=SVGParser, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error closing SVG input stream."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, 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)]))], label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[SVG] identifier[build] operator[SEP] operator[SEP] Keyword[throws] identifier[SVGParseException] {
Keyword[if] operator[SEP] identifier[data] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[final] identifier[SVGHandler] identifier[handler] operator[=] Keyword[new] identifier[SVGHandler] operator[SEP] operator[SEP] operator[SEP] identifier[handler] operator[SEP] identifier[setColorSwap] operator[SEP] identifier[searchColor] , identifier[replaceColor] , identifier[overideOpacity] operator[SEP] operator[SEP] identifier[handler] operator[SEP] identifier[setWhiteMode] operator[SEP] identifier[whiteMode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strokeColorFilter] operator[!=] Other[null] operator[SEP] {
identifier[handler] operator[SEP] identifier[strokePaint] operator[SEP] identifier[setColorFilter] operator[SEP] identifier[strokeColorFilter] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[fillColorFilter] operator[!=] Other[null] operator[SEP] {
identifier[handler] operator[SEP] identifier[fillPaint] operator[SEP] identifier[setColorFilter] operator[SEP] identifier[fillColorFilter] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[data] operator[SEP] identifier[markSupported] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[try] {
identifier[data] operator[SEP] identifier[mark] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[magic] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[r] operator[=] identifier[data] operator[SEP] identifier[read] operator[SEP] identifier[magic] , Other[0] , Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[magicInt] operator[=] operator[SEP] identifier[magic] operator[SEP] Other[0] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[magic] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[<<] Other[8] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] identifier[data] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[==] Other[2] operator[&&] identifier[magicInt] operator[==] identifier[GZIPInputStream] operator[SEP] identifier[GZIP_MAGIC] operator[SEP] {
identifier[GZIPInputStream] identifier[gin] operator[=] Keyword[new] identifier[GZIPInputStream] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[gin] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SVGParseException] operator[SEP] identifier[ioe] operator[SEP] operator[SEP]
}
Keyword[final] identifier[SVG] identifier[svg] operator[=] identifier[SVGParser] operator[SEP] identifier[parse] operator[SEP] Keyword[new] identifier[InputSource] operator[SEP] identifier[data] operator[SEP] , identifier[handler] operator[SEP] operator[SEP] Keyword[return] identifier[svg] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[closeInputStream] operator[SEP] {
Keyword[try] {
identifier[data] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[SVGParser] operator[SEP] identifier[TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
}
}
|
public static void reloadLibrary(String key) {
if (key.startsWith(DicLibrary.DEFAULT)) {
DicLibrary.reload(key);
} else if (key.startsWith(StopLibrary.DEFAULT)) {
StopLibrary.reload(key);
} else if (key.startsWith(SynonymsLibrary.DEFAULT)) {
SynonymsLibrary.reload(key);
} else if (key.startsWith(AmbiguityLibrary.DEFAULT)) {
AmbiguityLibrary.reload(key);
} else if (key.startsWith(CrfLibrary.DEFAULT)) {
CrfLibrary.reload(key);
} else {
throw new LibraryException(key + " type err must start with dic,stop,ambiguity,synonyms");
}
} | class class_name[name] begin[{]
method[reloadLibrary, return_type[void], modifier[public static], parameter[key]] begin[{]
if[call[key.startsWith, parameter[member[DicLibrary.DEFAULT]]]] begin[{]
call[DicLibrary.reload, parameter[member[.key]]]
else begin[{]
if[call[key.startsWith, parameter[member[StopLibrary.DEFAULT]]]] begin[{]
call[StopLibrary.reload, parameter[member[.key]]]
else begin[{]
if[call[key.startsWith, parameter[member[SynonymsLibrary.DEFAULT]]]] begin[{]
call[SynonymsLibrary.reload, parameter[member[.key]]]
else begin[{]
if[call[key.startsWith, parameter[member[AmbiguityLibrary.DEFAULT]]]] begin[{]
call[AmbiguityLibrary.reload, parameter[member[.key]]]
else begin[{]
if[call[key.startsWith, parameter[member[CrfLibrary.DEFAULT]]]] begin[{]
call[CrfLibrary.reload, parameter[member[.key]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" type err must start with dic,stop,ambiguity,synonyms"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LibraryException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[reloadLibrary] operator[SEP] identifier[String] identifier[key] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] identifier[DicLibrary] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] {
identifier[DicLibrary] operator[SEP] identifier[reload] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] identifier[StopLibrary] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] {
identifier[StopLibrary] operator[SEP] identifier[reload] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] identifier[SynonymsLibrary] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] {
identifier[SynonymsLibrary] operator[SEP] identifier[reload] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] identifier[AmbiguityLibrary] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] {
identifier[AmbiguityLibrary] operator[SEP] identifier[reload] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] identifier[CrfLibrary] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] {
identifier[CrfLibrary] operator[SEP] identifier[reload] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[LibraryException] operator[SEP] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
@XmlElementDecl(namespace = "http://www.drugbank.ca", name = "protein-name", scope = SnpEffectType.class)
public JAXBElement<String> createSnpEffectTypeProteinName(String value) {
return new JAXBElement<String>(_SnpAdverseDrugReactionTypeProteinName_QNAME, String.class, SnpEffectType.class, value);
} | class class_name[name] begin[{]
method[createSnpEffectTypeProteinName, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_SnpAdverseDrugReactionTypeProteinName_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SnpEffectType, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[SnpEffectType] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[String] operator[>] identifier[createSnpEffectTypeProteinName] operator[SEP] identifier[String] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[String] operator[>] operator[SEP] identifier[_SnpAdverseDrugReactionTypeProteinName_QNAME] , identifier[String] operator[SEP] Keyword[class] , identifier[SnpEffectType] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP]
}
|
public static void writeFile(CompoundTag tag, String path, boolean compressed, boolean littleEndian) throws IOException {
writeFile(tag, new File(path), compressed, littleEndian);
} | class class_name[name] begin[{]
method[writeFile, return_type[void], modifier[public static], parameter[tag, path, compressed, littleEndian]] begin[{]
call[.writeFile, parameter[member[.tag], ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), member[.compressed], member[.littleEndian]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[writeFile] operator[SEP] identifier[CompoundTag] identifier[tag] , identifier[String] identifier[path] , Keyword[boolean] identifier[compressed] , Keyword[boolean] identifier[littleEndian] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[writeFile] operator[SEP] identifier[tag] , Keyword[new] identifier[File] operator[SEP] identifier[path] operator[SEP] , identifier[compressed] , identifier[littleEndian] operator[SEP] operator[SEP]
}
|
private void constructExample() {
add(new WHeading(HeadingLevel.H3, "ACCORDION tabs"));
WTabSet tabset1c = new SampleWTabset(TabSetType.ACCORDION);
add(tabset1c);
/* Content height */
add(new WHeading(HeadingLevel.H2, "Examples showing content height property."));
add(new WHeading(HeadingLevel.H3, "Tall content."));
WTabSet htabset1c = new SampleWTabset(TabSetType.ACCORDION);
htabset1c.setContentHeight(TALL_CONTENT);
add(htabset1c);
add(new WHeading(HeadingLevel.H3, "Short content."));
WTabSet htabset1g = new SampleWTabset(TabSetType.ACCORDION);
htabset1g.setContentHeight(SHORT_CONTENT);
add(htabset1g);
add(new WHeading(HeadingLevel.H2, "Examples showing accordion's single property."));
WTabSet singleOpenAccordionabset = new SampleWTabset(WTabSet.TYPE_ACCORDION);
singleOpenAccordionabset.setSingle(true);
add(singleOpenAccordionabset);
add(new WHeading(HeadingLevel.H2, "Using WSubordinateControl"));
WTabSet targetTabset = new SampleWTabset(TabSetType.ACCORDION);
add(targetTabset);
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
add(layout);
final WCheckBox disabledControllerCb = new WCheckBox();
final WCheckBox hiddenControllerCb = new WCheckBox();
layout.addField("disable tabset", disabledControllerCb);
layout.addField("hide tabset", hiddenControllerCb);
// Build & add the subordinate
SubordinateBuilder builder = new SubordinateBuilder();
builder.condition().equals(hiddenControllerCb, String.valueOf(true));
builder.whenTrue().hide(targetTabset);
builder.whenFalse().show(targetTabset);
add(builder.build());
builder = new SubordinateBuilder();
builder.condition().equals(disabledControllerCb, String.valueOf(true));
builder.whenTrue().disable(targetTabset);
builder.whenFalse().enable(targetTabset);
add(builder.build());
} | class class_name[name] begin[{]
method[constructExample, return_type[void], modifier[private], parameter[]] begin[{]
call[.add, parameter[ClassCreator(arguments=[MemberReference(member=H3, postfix_operators=[], prefix_operators=[], qualifier=HeadingLevel, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ACCORDION tabs")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WHeading, sub_type=None))]]
local_variable[type[WTabSet], tabset1c]
call[.add, parameter[member[.tabset1c]]]
call[.add, parameter[ClassCreator(arguments=[MemberReference(member=H2, postfix_operators=[], prefix_operators=[], qualifier=HeadingLevel, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Examples showing content height property.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WHeading, sub_type=None))]]
call[.add, parameter[ClassCreator(arguments=[MemberReference(member=H3, postfix_operators=[], prefix_operators=[], qualifier=HeadingLevel, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tall content.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WHeading, sub_type=None))]]
local_variable[type[WTabSet], htabset1c]
call[htabset1c.setContentHeight, parameter[member[.TALL_CONTENT]]]
call[.add, parameter[member[.htabset1c]]]
call[.add, parameter[ClassCreator(arguments=[MemberReference(member=H3, postfix_operators=[], prefix_operators=[], qualifier=HeadingLevel, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Short content.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WHeading, sub_type=None))]]
local_variable[type[WTabSet], htabset1g]
call[htabset1g.setContentHeight, parameter[member[.SHORT_CONTENT]]]
call[.add, parameter[member[.htabset1g]]]
call[.add, parameter[ClassCreator(arguments=[MemberReference(member=H2, postfix_operators=[], prefix_operators=[], qualifier=HeadingLevel, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Examples showing accordion's single property.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WHeading, sub_type=None))]]
local_variable[type[WTabSet], singleOpenAccordionabset]
call[singleOpenAccordionabset.setSingle, parameter[literal[true]]]
call[.add, parameter[member[.singleOpenAccordionabset]]]
call[.add, parameter[ClassCreator(arguments=[MemberReference(member=H2, postfix_operators=[], prefix_operators=[], qualifier=HeadingLevel, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Using WSubordinateControl")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WHeading, sub_type=None))]]
local_variable[type[WTabSet], targetTabset]
call[.add, parameter[member[.targetTabset]]]
local_variable[type[WFieldLayout], layout]
call[.add, parameter[member[.layout]]]
local_variable[type[WCheckBox], disabledControllerCb]
local_variable[type[WCheckBox], hiddenControllerCb]
call[layout.addField, parameter[literal["disable tabset"], member[.disabledControllerCb]]]
call[layout.addField, parameter[literal["hide tabset"], member[.hiddenControllerCb]]]
local_variable[type[SubordinateBuilder], builder]
call[builder.condition, parameter[]]
call[builder.whenTrue, parameter[]]
call[builder.whenFalse, parameter[]]
call[.add, parameter[call[builder.build, parameter[]]]]
assign[member[.builder], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SubordinateBuilder, sub_type=None))]
call[builder.condition, parameter[]]
call[builder.whenTrue, parameter[]]
call[builder.whenFalse, parameter[]]
call[.add, parameter[call[builder.build, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[constructExample] operator[SEP] operator[SEP] {
identifier[add] operator[SEP] Keyword[new] identifier[WHeading] operator[SEP] identifier[HeadingLevel] operator[SEP] identifier[H3] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[WTabSet] identifier[tabset1c] operator[=] Keyword[new] identifier[SampleWTabset] operator[SEP] identifier[TabSetType] operator[SEP] identifier[ACCORDION] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[tabset1c] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WHeading] operator[SEP] identifier[HeadingLevel] operator[SEP] identifier[H2] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WHeading] operator[SEP] identifier[HeadingLevel] operator[SEP] identifier[H3] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[WTabSet] identifier[htabset1c] operator[=] Keyword[new] identifier[SampleWTabset] operator[SEP] identifier[TabSetType] operator[SEP] identifier[ACCORDION] operator[SEP] operator[SEP] identifier[htabset1c] operator[SEP] identifier[setContentHeight] operator[SEP] identifier[TALL_CONTENT] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[htabset1c] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WHeading] operator[SEP] identifier[HeadingLevel] operator[SEP] identifier[H3] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[WTabSet] identifier[htabset1g] operator[=] Keyword[new] identifier[SampleWTabset] operator[SEP] identifier[TabSetType] operator[SEP] identifier[ACCORDION] operator[SEP] operator[SEP] identifier[htabset1g] operator[SEP] identifier[setContentHeight] operator[SEP] identifier[SHORT_CONTENT] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[htabset1g] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WHeading] operator[SEP] identifier[HeadingLevel] operator[SEP] identifier[H2] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[WTabSet] identifier[singleOpenAccordionabset] operator[=] Keyword[new] identifier[SampleWTabset] operator[SEP] identifier[WTabSet] operator[SEP] identifier[TYPE_ACCORDION] operator[SEP] operator[SEP] identifier[singleOpenAccordionabset] operator[SEP] identifier[setSingle] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[singleOpenAccordionabset] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WHeading] operator[SEP] identifier[HeadingLevel] operator[SEP] identifier[H2] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[WTabSet] identifier[targetTabset] operator[=] Keyword[new] identifier[SampleWTabset] operator[SEP] identifier[TabSetType] operator[SEP] identifier[ACCORDION] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[targetTabset] operator[SEP] operator[SEP] identifier[WFieldLayout] identifier[layout] operator[=] Keyword[new] identifier[WFieldLayout] operator[SEP] identifier[WFieldLayout] operator[SEP] identifier[LAYOUT_STACKED] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[layout] operator[SEP] operator[SEP] Keyword[final] identifier[WCheckBox] identifier[disabledControllerCb] operator[=] Keyword[new] identifier[WCheckBox] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[WCheckBox] identifier[hiddenControllerCb] operator[=] Keyword[new] identifier[WCheckBox] operator[SEP] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[addField] operator[SEP] literal[String] , identifier[disabledControllerCb] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[addField] operator[SEP] literal[String] , identifier[hiddenControllerCb] operator[SEP] operator[SEP] identifier[SubordinateBuilder] identifier[builder] operator[=] Keyword[new] identifier[SubordinateBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[condition] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[hiddenControllerCb] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[whenTrue] operator[SEP] operator[SEP] operator[SEP] identifier[hide] operator[SEP] identifier[targetTabset] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[whenFalse] operator[SEP] operator[SEP] operator[SEP] identifier[show] operator[SEP] identifier[targetTabset] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[=] Keyword[new] identifier[SubordinateBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[condition] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[disabledControllerCb] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[whenTrue] operator[SEP] operator[SEP] operator[SEP] identifier[disable] operator[SEP] identifier[targetTabset] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[whenFalse] operator[SEP] operator[SEP] operator[SEP] identifier[enable] operator[SEP] identifier[targetTabset] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized static int getColor(String name) throws IOException, IllegalArgumentException {
if (name == null) throw new NullPointerException("name is null");
name = name.trim();
if (name.length() == 0) throw new IllegalArgumentException("name is empty");
// Load the colors if not already done
if (colors == null) {
// Load the colors
colors = new HashMap<>();
try (BufferedReader in = new BufferedReader(new InputStreamReader(RGBColor.class.getResourceAsStream("rgb.txt")))) {
String line;
while ((line = in.readLine()) != null) {
int len = line.length();
if (len > 13) {
// Ignore comments
int ch = line.charAt(0);
if (ch != '!' && ch != '#') {
try {
colors.put(
line.substring(13).trim(),
(Integer.parseInt(line.substring(0, 3).trim()) << 16)
| (Integer.parseInt(line.substring(4, 7).trim()) << 8)
| Integer.parseInt(line.substring(8, 11).trim())
);
} catch (NumberFormatException err) {
throw new IOException("Unable to parse line: "+line, err);
}
}
}
}
}
}
// Look in the color hash first
name = name.toLowerCase(Locale.ROOT);
Integer I = colors.get(name);
if (I != null) return I;
int start = 0;
if (name.length() >= 1 && name.charAt(0) == '#') start = 1;
else if (name.length() >= 2 && name.charAt(0) == '0' && name.charAt(1) == 'x') start = 2;
int nameLen = name.length() - start;
if (nameLen != 6) throw new IllegalArgumentException("name should be 6 digits, name is " + nameLen + " digits");
// Get the number
int color = 0;
for(
int i = start, end=start+6;
i < end;
i++
) {
char ch = name.charAt(i);
int value;
if (ch >= '0' && ch < '9') value = ch - '0';
else if (ch >= 'a' && ch <= 'f') value = ch - 'a' + 10;
else throw new IllegalArgumentException("Invalid character in name: " + ch);
color |= (value << ((5 - i) << 2));
}
return color;
} | class class_name[name] begin[{]
method[getColor, return_type[type[int]], modifier[synchronized public static], parameter[name]] begin[{]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.name], call[name.trim, parameter[]]]
if[binary_operation[call[name.length, parameter[]], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name is empty")], 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[.colors], ==, literal[null]]] begin[{]
assign[member[.colors], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=13), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=ch)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='!'), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='#'), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=13)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=|), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=|)], member=put, postfix_operators=[], prefix_operators=[], qualifier=colors, 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 parse line: "), operandr=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=err, 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=err, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)]))]))]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=in, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rgb.txt")], member=getResourceAsStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=RGBColor, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)))])
else begin[{]
None
end[}]
assign[member[.name], call[name.toLowerCase, parameter[member[Locale.ROOT]]]]
local_variable[type[Integer], I]
if[binary_operation[member[.I], !=, literal[null]]] begin[{]
return[member[.I]]
else begin[{]
None
end[}]
local_variable[type[int], start]
if[binary_operation[binary_operation[call[name.length, parameter[]], >=, literal[1]], &&, binary_operation[call[name.charAt, parameter[literal[0]]], ==, literal['#']]]] begin[{]
assign[member[.start], literal[1]]
else begin[{]
if[binary_operation[binary_operation[binary_operation[call[name.length, parameter[]], >=, literal[2]], &&, binary_operation[call[name.charAt, parameter[literal[0]]], ==, literal['0']]], &&, binary_operation[call[name.charAt, parameter[literal[1]]], ==, literal['x']]]] begin[{]
assign[member[.start], literal[2]]
else begin[{]
None
end[}]
end[}]
local_variable[type[int], nameLen]
if[binary_operation[member[.nameLen], !=, literal[6]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name should be 6 digits, name is "), operandr=MemberReference(member=nameLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" digits"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], color]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), name=ch)], modifiers=set(), type=BasicType(dimensions=[], name=char)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), operator=<=), operator=&&), else_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid character in name: "), operandr=MemberReference(member=ch, 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), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=+)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=-)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=<<), operator=<<)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=+), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.color]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[static] Keyword[int] identifier[getColor] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[IOException] , identifier[IllegalArgumentException] {
Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[name] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colors] operator[==] Other[null] operator[SEP] {
identifier[colors] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedReader] identifier[in] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[RGBColor] operator[SEP] Keyword[class] operator[SEP] identifier[getResourceAsStream] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[13] operator[SEP] {
Keyword[int] identifier[ch] operator[=] identifier[line] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[!=] literal[String] operator[&&] identifier[ch] operator[!=] literal[String] operator[SEP] {
Keyword[try] {
identifier[colors] operator[SEP] identifier[put] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[13] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[3] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[4] , Other[7] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[<<] Other[8] operator[SEP] operator[|] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[8] , Other[11] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[err] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[line] , identifier[err] operator[SEP] operator[SEP]
}
}
}
}
}
}
identifier[name] operator[=] identifier[name] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ROOT] operator[SEP] operator[SEP] identifier[Integer] identifier[I] operator[=] identifier[colors] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[I] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[I] operator[SEP] Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>=] Other[1] operator[&&] identifier[name] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] identifier[start] operator[=] Other[1] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>=] Other[2] operator[&&] identifier[name] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[name] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] identifier[start] operator[=] Other[2] operator[SEP] Keyword[int] identifier[nameLen] operator[=] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[nameLen] operator[!=] Other[6] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[nameLen] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[color] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[start] , identifier[end] operator[=] identifier[start] operator[+] Other[6] operator[SEP] identifier[i] operator[<] identifier[end] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[ch] operator[=] identifier[name] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<] literal[String] operator[SEP] identifier[value] operator[=] identifier[ch] operator[-] literal[String] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] identifier[value] operator[=] identifier[ch] operator[-] literal[String] operator[+] Other[10] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[ch] operator[SEP] operator[SEP] identifier[color] operator[|=] operator[SEP] identifier[value] operator[<<] operator[SEP] operator[SEP] Other[5] operator[-] identifier[i] operator[SEP] operator[<<] Other[2] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[color] operator[SEP]
}
|
public static NetHttpTransport createNetHttpTransport(
@Nullable URI proxyUri, @Nullable PasswordAuthentication proxyAuth)
throws IOException, GeneralSecurityException {
checkArgument(
proxyUri != null || proxyAuth == null,
"if proxyUri is null than proxyAuth should be null too");
if (proxyAuth != null) {
Authenticator.setDefault(
new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
if (getRequestorType() == RequestorType.PROXY
&& getRequestingHost().equalsIgnoreCase(proxyUri.getHost())
&& getRequestingPort() == proxyUri.getPort()) {
return proxyAuth;
}
return null;
}
});
}
return new NetHttpTransport.Builder()
.trustCertificates(GoogleUtils.getCertificateTrustStore())
.setProxy(
proxyUri == null
? null
: new Proxy(
Proxy.Type.HTTP, new InetSocketAddress(proxyUri.getHost(), proxyUri.getPort())))
.build();
} | class class_name[name] begin[{]
method[createNetHttpTransport, return_type[type[NetHttpTransport]], modifier[public static], parameter[proxyUri, proxyAuth]] begin[{]
call[.checkArgument, parameter[binary_operation[binary_operation[member[.proxyUri], !=, literal[null]], ||, binary_operation[member[.proxyAuth], ==, literal[null]]], literal["if proxyUri is null than proxyAuth should be null too"]]]
if[binary_operation[member[.proxyAuth], !=, literal[null]]] begin[{]
call[Authenticator.setDefault, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRequestorType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=PROXY, postfix_operators=[], prefix_operators=[], qualifier=RequestorType, selectors=[]), operator===), operandr=MethodInvocation(arguments=[], member=getRequestingHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=proxyUri, selectors=[], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRequestingPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getPort, postfix_operators=[], prefix_operators=[], qualifier=proxyUri, selectors=[], type_arguments=None), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=proxyAuth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'protected'}, name=getPasswordAuthentication, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=PasswordAuthentication, sub_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=Authenticator, sub_type=None))]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCertificateTrustStore, postfix_operators=[], prefix_operators=[], qualifier=GoogleUtils, selectors=[], type_arguments=None)], member=trustCertificates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=proxyUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MemberReference(member=HTTP, postfix_operators=[], prefix_operators=[], qualifier=Proxy.Type, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=proxyUri, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPort, postfix_operators=[], prefix_operators=[], qualifier=proxyUri, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Proxy, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))], member=setProxy, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=NetHttpTransport, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[NetHttpTransport] identifier[createNetHttpTransport] operator[SEP] annotation[@] identifier[Nullable] identifier[URI] identifier[proxyUri] , annotation[@] identifier[Nullable] identifier[PasswordAuthentication] identifier[proxyAuth] operator[SEP] Keyword[throws] identifier[IOException] , identifier[GeneralSecurityException] {
identifier[checkArgument] operator[SEP] identifier[proxyUri] operator[!=] Other[null] operator[||] identifier[proxyAuth] operator[==] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proxyAuth] operator[!=] Other[null] operator[SEP] {
identifier[Authenticator] operator[SEP] identifier[setDefault] operator[SEP] Keyword[new] identifier[Authenticator] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[protected] identifier[PasswordAuthentication] identifier[getPasswordAuthentication] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[getRequestorType] operator[SEP] operator[SEP] operator[==] identifier[RequestorType] operator[SEP] identifier[PROXY] operator[&&] identifier[getRequestingHost] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[proxyUri] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[getRequestingPort] operator[SEP] operator[SEP] operator[==] identifier[proxyUri] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[proxyAuth] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[NetHttpTransport] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[trustCertificates] operator[SEP] identifier[GoogleUtils] operator[SEP] identifier[getCertificateTrustStore] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setProxy] operator[SEP] identifier[proxyUri] operator[==] Other[null] operator[?] Other[null] operator[:] Keyword[new] identifier[Proxy] operator[SEP] identifier[Proxy] operator[SEP] identifier[Type] operator[SEP] identifier[HTTP] , Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[proxyUri] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] , identifier[proxyUri] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
private void createSchemaOnDb() {
StringBuilder sql = new StringBuilder();
sql.append(topology.getSqlgGraph().getSqlDialect().createSchemaStatement(this.name));
if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {
sql.append(";");
}
if (logger.isDebugEnabled()) {
logger.debug(sql.toString());
}
Connection conn = this.sqlgGraph.tx().getConnection();
try (Statement stmt = conn.createStatement()) {
stmt.execute(sql.toString());
} catch (SQLException e) {
logger.error("schema creation failed " + this.sqlgGraph.toString(), e);
throw new RuntimeException(e);
}
} | class class_name[name] begin[{]
method[createSchemaOnDb, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[StringBuilder], sql]
call[sql.append, parameter[call[topology.getSqlgGraph, parameter[]]]]
if[THIS[member[None.sqlgGraph]call[None.getSqlDialect, parameter[]]call[None.needsSemicolon, parameter[]]]] begin[{]
call[sql.append, parameter[literal[";"]]]
else begin[{]
None
end[}]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[call[sql.toString, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[Connection], conn]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None)], member=execute, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="schema creation failed "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sqlgGraph, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stmt, type=ReferenceType(arguments=None, dimensions=[], name=Statement, sub_type=None), value=MethodInvocation(arguments=[], member=createStatement, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None))])
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createSchemaOnDb] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[sql] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[topology] operator[SEP] identifier[getSqlgGraph] operator[SEP] operator[SEP] operator[SEP] identifier[getSqlDialect] operator[SEP] operator[SEP] operator[SEP] identifier[createSchemaStatement] operator[SEP] Keyword[this] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[sqlgGraph] operator[SEP] identifier[getSqlDialect] operator[SEP] operator[SEP] operator[SEP] identifier[needsSemicolon] operator[SEP] operator[SEP] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[sql] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Connection] identifier[conn] operator[=] Keyword[this] operator[SEP] identifier[sqlgGraph] operator[SEP] identifier[tx] operator[SEP] operator[SEP] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[Statement] identifier[stmt] operator[=] identifier[conn] operator[SEP] identifier[createStatement] operator[SEP] operator[SEP] operator[SEP] {
identifier[stmt] operator[SEP] identifier[execute] operator[SEP] identifier[sql] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[sqlgGraph] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
static public void makeRootDirectory() {
File dir = new File(root);
if (!dir.exists())
if (!dir.mkdirs())
throw new IllegalStateException("DiskCache.setRootDirectory(): could not create root directory <" + root + ">.");
checkExist = true;
} | class class_name[name] begin[{]
method[makeRootDirectory, return_type[void], modifier[public static], parameter[]] begin[{]
local_variable[type[File], dir]
if[call[dir.exists, parameter[]]] begin[{]
if[call[dir.mkdirs, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DiskCache.setRootDirectory(): could not create root directory <"), operandr=MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
assign[member[.checkExist], literal[true]]
end[}]
END[}] | Keyword[static] Keyword[public] Keyword[void] identifier[makeRootDirectory] operator[SEP] operator[SEP] {
identifier[File] identifier[dir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[root] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[dir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[dir] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[root] operator[+] literal[String] operator[SEP] operator[SEP] identifier[checkExist] operator[=] literal[boolean] operator[SEP]
}
|
@Override
public CPInstance remove(Serializable primaryKey)
throws NoSuchCPInstanceException {
Session session = null;
try {
session = openSession();
CPInstance cpInstance = (CPInstance)session.get(CPInstanceImpl.class,
primaryKey);
if (cpInstance == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchCPInstanceException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(cpInstance);
}
catch (NoSuchCPInstanceException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | class class_name[name] begin[{]
method[remove, return_type[type[CPInstance]], modifier[public], parameter[primaryKey]] begin[{]
local_variable[type[Session], session]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CPInstanceImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CPInstance, sub_type=None)), name=cpInstance)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CPInstance, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cpInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=_NO_SUCH_ENTITY_WITH_PRIMARY_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=_NO_SUCH_ENTITY_WITH_PRIMARY_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=primaryKey, 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=NoSuchCPInstanceException, sub_type=None)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=cpInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=nsee, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nsee, types=['NoSuchCPInstanceException'])), CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CPInstance] identifier[remove] operator[SEP] identifier[Serializable] identifier[primaryKey] operator[SEP] Keyword[throws] identifier[NoSuchCPInstanceException] {
identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[CPInstance] identifier[cpInstance] operator[=] operator[SEP] identifier[CPInstance] operator[SEP] identifier[session] operator[SEP] identifier[get] operator[SEP] identifier[CPInstanceImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cpInstance] 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[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[NoSuchCPInstanceException] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP]
}
Keyword[return] identifier[remove] operator[SEP] identifier[cpInstance] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchCPInstanceException] identifier[nsee] operator[SEP] {
Keyword[throw] identifier[nsee] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP]
}
}
|
public void process(GrayF32 intensityImage,
@Nullable QueueCorner candidatesMin, @Nullable QueueCorner candidatesMax,
QueueCorner foundMin , QueueCorner foundMax ) {
this.input = intensityImage;
// pixels indexes larger than these should not be examined
endBorderX = intensityImage.width-ignoreBorder;
endBorderY = intensityImage.height-ignoreBorder;
search.initialize(intensityImage);
if( candidatesMin != null ) {
foundMin.reset();
examineMinimum(intensityImage, candidatesMin, foundMin);
}
if( candidatesMax != null ) {
foundMax.reset();
examineMaximum(intensityImage, candidatesMax, foundMax);
}
} | class class_name[name] begin[{]
method[process, return_type[void], modifier[public], parameter[intensityImage, candidatesMin, candidatesMax, foundMin, foundMax]] begin[{]
assign[THIS[member[None.input]], member[.intensityImage]]
assign[member[.endBorderX], binary_operation[member[intensityImage.width], -, member[.ignoreBorder]]]
assign[member[.endBorderY], binary_operation[member[intensityImage.height], -, member[.ignoreBorder]]]
call[search.initialize, parameter[member[.intensityImage]]]
if[binary_operation[member[.candidatesMin], !=, literal[null]]] begin[{]
call[foundMin.reset, parameter[]]
call[.examineMinimum, parameter[member[.intensityImage], member[.candidatesMin], member[.foundMin]]]
else begin[{]
None
end[}]
if[binary_operation[member[.candidatesMax], !=, literal[null]]] begin[{]
call[foundMax.reset, parameter[]]
call[.examineMaximum, parameter[member[.intensityImage], member[.candidatesMax], member[.foundMax]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[process] operator[SEP] identifier[GrayF32] identifier[intensityImage] , annotation[@] identifier[Nullable] identifier[QueueCorner] identifier[candidatesMin] , annotation[@] identifier[Nullable] identifier[QueueCorner] identifier[candidatesMax] , identifier[QueueCorner] identifier[foundMin] , identifier[QueueCorner] identifier[foundMax] operator[SEP] {
Keyword[this] operator[SEP] identifier[input] operator[=] identifier[intensityImage] operator[SEP] identifier[endBorderX] operator[=] identifier[intensityImage] operator[SEP] identifier[width] operator[-] identifier[ignoreBorder] operator[SEP] identifier[endBorderY] operator[=] identifier[intensityImage] operator[SEP] identifier[height] operator[-] identifier[ignoreBorder] operator[SEP] identifier[search] operator[SEP] identifier[initialize] operator[SEP] identifier[intensityImage] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[candidatesMin] operator[!=] Other[null] operator[SEP] {
identifier[foundMin] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[examineMinimum] operator[SEP] identifier[intensityImage] , identifier[candidatesMin] , identifier[foundMin] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[candidatesMax] operator[!=] Other[null] operator[SEP] {
identifier[foundMax] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[examineMaximum] operator[SEP] identifier[intensityImage] , identifier[candidatesMax] , identifier[foundMax] operator[SEP] operator[SEP]
}
}
|
@Override
public EClass getIfcCostItem() {
if (ifcCostItemEClass == null) {
ifcCostItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(149);
}
return ifcCostItemEClass;
} | class class_name[name] begin[{]
method[getIfcCostItem, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcCostItemEClass], ==, literal[null]]] begin[{]
assign[member[.ifcCostItemEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=149)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcCostItemEClass]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcCostItem] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcCostItemEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcCostItemEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[149] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcCostItemEClass] operator[SEP]
}
|
public static <T> List<T> flip(final List<T> src, List<T> dest, final int start, final int length)
{
if (dest == null)
dest = new ArrayList<T>();
else if (!dest.isEmpty())
dest.clear();
final int last = start + length - 1;
for (int i = last; i >= start; i--)
{
dest.add(src.get(i));
}
return dest;
} | class class_name[name] begin[{]
method[flip, return_type[type[List]], modifier[public static], parameter[src, dest, start, length]] begin[{]
if[binary_operation[member[.dest], ==, literal[null]]] begin[{]
assign[member[.dest], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
if[call[dest.isEmpty, parameter[]]] begin[{]
call[dest.clear, parameter[]]
else begin[{]
None
end[}]
end[}]
local_variable[type[int], last]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dest, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.dest]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[flip] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[T] operator[>] identifier[src] , identifier[List] operator[<] identifier[T] operator[>] identifier[dest] , Keyword[final] Keyword[int] identifier[start] , Keyword[final] Keyword[int] identifier[length] operator[SEP] {
Keyword[if] operator[SEP] identifier[dest] operator[==] Other[null] operator[SEP] identifier[dest] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[dest] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[last] operator[=] identifier[start] operator[+] identifier[length] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[last] operator[SEP] identifier[i] operator[>=] identifier[start] operator[SEP] identifier[i] operator[--] operator[SEP] {
identifier[dest] operator[SEP] identifier[add] operator[SEP] identifier[src] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[dest] operator[SEP]
}
|
boolean set(long index) {
if (!get(index)) {
data[(int) (index >>> 6)] |= (1L << index);
bitCount++;
return true;
}
return false;
} | class class_name[name] begin[{]
method[set, return_type[type[boolean]], modifier[default], parameter[index]] begin[{]
if[call[.get, parameter[member[.index]]]] begin[{]
assign[member[.data], binary_operation[literal[1L], <<, member[.index]]]
member[.bitCount]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[boolean] identifier[set] operator[SEP] Keyword[long] identifier[index] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] {
identifier[data] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] operator[>] Other[6] operator[SEP] operator[SEP] operator[|=] operator[SEP] Other[1L] operator[<<] identifier[index] operator[SEP] operator[SEP] identifier[bitCount] operator[++] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public Condition withAttributeValueList(AttributeValue... attributeValueList) {
if (this.attributeValueList == null) {
setAttributeValueList(new java.util.ArrayList<AttributeValue>(attributeValueList.length));
}
for (AttributeValue ele : attributeValueList) {
this.attributeValueList.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withAttributeValueList, return_type[type[Condition]], modifier[public], parameter[attributeValueList]] begin[{]
if[binary_operation[THIS[member[None.attributeValueList]], ==, literal[null]]] begin[{]
call[.setAttributeValueList, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributeValueList, 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=AttributeValue, 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=attributeValueList, 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=attributeValueList, 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=AttributeValue, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Condition] identifier[withAttributeValueList] operator[SEP] identifier[AttributeValue] operator[...] identifier[attributeValueList] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[attributeValueList] operator[==] Other[null] operator[SEP] {
identifier[setAttributeValueList] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[AttributeValue] operator[>] operator[SEP] identifier[attributeValueList] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[AttributeValue] identifier[ele] operator[:] identifier[attributeValueList] operator[SEP] {
Keyword[this] operator[SEP] identifier[attributeValueList] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public void setForegroundBaseColor(final Color COLOR) {
if (null == titleColor) { _titleColor = COLOR; } else { titleColor.set(COLOR); }
if (null == descriptionColor) { _descriptionColor = COLOR; } else { descriptionColor.set(COLOR); }
if (null == unitColor) { _unitColor = COLOR; } else { unitColor.set(COLOR); }
if (null == valueColor) { _valueColor = COLOR; } else { valueColor.set(COLOR); }
if (null == textColor) { _textColor = COLOR; } else { textColor.set(COLOR); }
if (null == foregroundColor) { _foregroundColor = COLOR; } else { foregroundColor.set(COLOR); }
fireTileEvent(REDRAW_EVENT);
} | class class_name[name] begin[{]
method[setForegroundBaseColor, return_type[void], modifier[public], parameter[COLOR]] begin[{]
if[binary_operation[literal[null], ==, member[.titleColor]]] begin[{]
assign[member[._titleColor], member[.COLOR]]
else begin[{]
call[titleColor.set, parameter[member[.COLOR]]]
end[}]
if[binary_operation[literal[null], ==, member[.descriptionColor]]] begin[{]
assign[member[._descriptionColor], member[.COLOR]]
else begin[{]
call[descriptionColor.set, parameter[member[.COLOR]]]
end[}]
if[binary_operation[literal[null], ==, member[.unitColor]]] begin[{]
assign[member[._unitColor], member[.COLOR]]
else begin[{]
call[unitColor.set, parameter[member[.COLOR]]]
end[}]
if[binary_operation[literal[null], ==, member[.valueColor]]] begin[{]
assign[member[._valueColor], member[.COLOR]]
else begin[{]
call[valueColor.set, parameter[member[.COLOR]]]
end[}]
if[binary_operation[literal[null], ==, member[.textColor]]] begin[{]
assign[member[._textColor], member[.COLOR]]
else begin[{]
call[textColor.set, parameter[member[.COLOR]]]
end[}]
if[binary_operation[literal[null], ==, member[.foregroundColor]]] begin[{]
assign[member[._foregroundColor], member[.COLOR]]
else begin[{]
call[foregroundColor.set, parameter[member[.COLOR]]]
end[}]
call[.fireTileEvent, parameter[member[.REDRAW_EVENT]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setForegroundBaseColor] operator[SEP] Keyword[final] identifier[Color] identifier[COLOR] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[titleColor] operator[SEP] {
identifier[_titleColor] operator[=] identifier[COLOR] operator[SEP]
}
Keyword[else] {
identifier[titleColor] operator[SEP] identifier[set] operator[SEP] identifier[COLOR] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[==] identifier[descriptionColor] operator[SEP] {
identifier[_descriptionColor] operator[=] identifier[COLOR] operator[SEP]
}
Keyword[else] {
identifier[descriptionColor] operator[SEP] identifier[set] operator[SEP] identifier[COLOR] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[==] identifier[unitColor] operator[SEP] {
identifier[_unitColor] operator[=] identifier[COLOR] operator[SEP]
}
Keyword[else] {
identifier[unitColor] operator[SEP] identifier[set] operator[SEP] identifier[COLOR] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[==] identifier[valueColor] operator[SEP] {
identifier[_valueColor] operator[=] identifier[COLOR] operator[SEP]
}
Keyword[else] {
identifier[valueColor] operator[SEP] identifier[set] operator[SEP] identifier[COLOR] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[==] identifier[textColor] operator[SEP] {
identifier[_textColor] operator[=] identifier[COLOR] operator[SEP]
}
Keyword[else] {
identifier[textColor] operator[SEP] identifier[set] operator[SEP] identifier[COLOR] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[==] identifier[foregroundColor] operator[SEP] {
identifier[_foregroundColor] operator[=] identifier[COLOR] operator[SEP]
}
Keyword[else] {
identifier[foregroundColor] operator[SEP] identifier[set] operator[SEP] identifier[COLOR] operator[SEP] operator[SEP]
}
identifier[fireTileEvent] operator[SEP] identifier[REDRAW_EVENT] operator[SEP] operator[SEP]
}
|
public Observable<LifecycleState> addNode(final NetworkAddress hostname, final NetworkAddress alternate) {
Node node = nodeBy(hostname);
if (node != null) {
LOGGER.debug("Node {} already registered, skipping.", hostname);
return Observable.just(node.state());
}
return addNode(new CouchbaseNode(hostname, ctx, alternate));
} | class class_name[name] begin[{]
method[addNode, return_type[type[Observable]], modifier[public], parameter[hostname, alternate]] begin[{]
local_variable[type[Node], node]
if[binary_operation[member[.node], !=, literal[null]]] begin[{]
call[LOGGER.debug, parameter[literal["Node {} already registered, skipping."], member[.hostname]]]
return[call[Observable.just, parameter[call[node.state, parameter[]]]]]
else begin[{]
None
end[}]
return[call[.addNode, parameter[ClassCreator(arguments=[MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alternate, 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=CouchbaseNode, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[LifecycleState] operator[>] identifier[addNode] operator[SEP] Keyword[final] identifier[NetworkAddress] identifier[hostname] , Keyword[final] identifier[NetworkAddress] identifier[alternate] operator[SEP] {
identifier[Node] identifier[node] operator[=] identifier[nodeBy] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[hostname] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[node] operator[SEP] identifier[state] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[addNode] operator[SEP] Keyword[new] identifier[CouchbaseNode] operator[SEP] identifier[hostname] , identifier[ctx] , identifier[alternate] operator[SEP] operator[SEP] operator[SEP]
}
|
public Observable<DeploymentExtendedInner> getByResourceGroupAsync(String resourceGroupName, String deploymentName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1<ServiceResponse<DeploymentExtendedInner>, DeploymentExtendedInner>() {
@Override
public DeploymentExtendedInner call(ServiceResponse<DeploymentExtendedInner> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[getByResourceGroupAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, deploymentName]] begin[{]
return[call[.getByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.deploymentName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[DeploymentExtendedInner] operator[>] identifier[getByResourceGroupAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[deploymentName] operator[SEP] {
Keyword[return] identifier[getByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[deploymentName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[DeploymentExtendedInner] operator[>] , identifier[DeploymentExtendedInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[DeploymentExtendedInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[DeploymentExtendedInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public void start() {
if(started.compareAndSet(false, true)) {
logger.info("Opening ServiceTracker to search for {} services...", serviceType.getCanonicalName());
serviceTracker.open(true);
} else {
logger.warn("ServiceTracker already open, searching for {} services.", serviceType.getCanonicalName());
}
} | class class_name[name] begin[{]
method[start, return_type[void], modifier[public], parameter[]] begin[{]
if[call[started.compareAndSet, parameter[literal[false], literal[true]]]] begin[{]
call[logger.info, parameter[literal["Opening ServiceTracker to search for {} services..."], call[serviceType.getCanonicalName, parameter[]]]]
call[serviceTracker.open, parameter[literal[true]]]
else begin[{]
call[logger.warn, parameter[literal["ServiceTracker already open, searching for {} services."], call[serviceType.getCanonicalName, parameter[]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[started] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[serviceType] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[serviceTracker] operator[SEP] identifier[open] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[serviceType] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public HashRangeExpressionBuilder put(Integer value1, Integer value2) {
m_builder.put(value1, value2);
return this;
} | class class_name[name] begin[{]
method[put, return_type[type[HashRangeExpressionBuilder]], modifier[public], parameter[value1, value2]] begin[{]
call[m_builder.put, parameter[member[.value1], member[.value2]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[HashRangeExpressionBuilder] identifier[put] operator[SEP] identifier[Integer] identifier[value1] , identifier[Integer] identifier[value2] operator[SEP] {
identifier[m_builder] operator[SEP] identifier[put] operator[SEP] identifier[value1] , identifier[value2] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public void titleMatches(double seconds, String expectedTitle) {
double end = System.currentTimeMillis() + (seconds * 1000);
while (!app.get().title().matches(expectedTitle) && System.currentTimeMillis() < end) ;
double timeTook = Math.min((seconds * 1000) - (end - System.currentTimeMillis()), seconds * 1000) / 1000;
checkTitleMatches(expectedTitle, seconds, timeTook);
} | class class_name[name] begin[{]
method[titleMatches, return_type[void], modifier[public], parameter[seconds, expectedTitle]] begin[{]
local_variable[type[double], end]
while[binary_operation[call[app.get, parameter[]], &&, binary_operation[call[System.currentTimeMillis, parameter[]], <, member[.end]]]] begin[{]
Statement(label=None)
end[}]
local_variable[type[double], timeTook]
call[.checkTitleMatches, parameter[member[.expectedTitle], member[.seconds], member[.timeTook]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[titleMatches] operator[SEP] Keyword[double] identifier[seconds] , identifier[String] identifier[expectedTitle] operator[SEP] {
Keyword[double] identifier[end] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] operator[SEP] identifier[seconds] operator[*] Other[1000] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[app] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[title] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] identifier[expectedTitle] operator[SEP] operator[&&] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[<] identifier[end] operator[SEP] operator[SEP] Keyword[double] identifier[timeTook] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] operator[SEP] identifier[seconds] operator[*] Other[1000] operator[SEP] operator[-] operator[SEP] identifier[end] operator[-] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] , identifier[seconds] operator[*] Other[1000] operator[SEP] operator[/] Other[1000] operator[SEP] identifier[checkTitleMatches] operator[SEP] identifier[expectedTitle] , identifier[seconds] , identifier[timeTook] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "skipCount", scope = GetCheckedOutDocs.class)
public JAXBElement<BigInteger> createGetCheckedOutDocsSkipCount(
BigInteger value) {
return new JAXBElement<BigInteger>(_GetTypeChildrenSkipCount_QNAME,
BigInteger.class, GetCheckedOutDocs.class, value);
} | class class_name[name] begin[{]
method[createGetCheckedOutDocsSkipCount, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_GetTypeChildrenSkipCount_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetCheckedOutDocs, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[GetCheckedOutDocs] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[BigInteger] operator[>] identifier[createGetCheckedOutDocsSkipCount] operator[SEP] identifier[BigInteger] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[BigInteger] operator[>] operator[SEP] identifier[_GetTypeChildrenSkipCount_QNAME] , identifier[BigInteger] operator[SEP] Keyword[class] , identifier[GetCheckedOutDocs] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP]
}
|
public Page<Table> listTablesFromId(String projectId, String datasetName) {
// [START bigquery_list_tables]
DatasetId datasetId = DatasetId.of(projectId, datasetName);
Page<Table> tables = bigquery.listTables(datasetId, TableListOption.pageSize(100));
for (Table table : tables.iterateAll()) {
// do something with the table
}
// [END bigquery_list_tables]
return tables;
} | class class_name[name] begin[{]
method[listTablesFromId, return_type[type[Page]], modifier[public], parameter[projectId, datasetName]] begin[{]
local_variable[type[DatasetId], datasetId]
local_variable[type[Page], tables]
ForStatement(body=BlockStatement(label=None, statements=[]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=iterateAll, postfix_operators=[], prefix_operators=[], qualifier=tables, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=table)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))), label=None)
return[member[.tables]]
end[}]
END[}] | Keyword[public] identifier[Page] operator[<] identifier[Table] operator[>] identifier[listTablesFromId] operator[SEP] identifier[String] identifier[projectId] , identifier[String] identifier[datasetName] operator[SEP] {
identifier[DatasetId] identifier[datasetId] operator[=] identifier[DatasetId] operator[SEP] identifier[of] operator[SEP] identifier[projectId] , identifier[datasetName] operator[SEP] operator[SEP] identifier[Page] operator[<] identifier[Table] operator[>] identifier[tables] operator[=] identifier[bigquery] operator[SEP] identifier[listTables] operator[SEP] identifier[datasetId] , identifier[TableListOption] operator[SEP] identifier[pageSize] operator[SEP] Other[100] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Table] identifier[table] operator[:] identifier[tables] operator[SEP] identifier[iterateAll] operator[SEP] operator[SEP] operator[SEP] {
}
Keyword[return] identifier[tables] operator[SEP]
}
|
public static Point3d get3DCentreOfMass(IAtomContainer ac) {
double xsum = 0.0;
double ysum = 0.0;
double zsum = 0.0;
double totalmass = 0.0;
Isotopes isotopes;
try {
isotopes = Isotopes.getInstance();
} catch (IOException e) {
throw new RuntimeException("Could not initialize Isotopes");
}
for (IAtom a : ac.atoms()) {
Double mass = a.getExactMass();
// some sanity checking
if (a.getPoint3d() == null) return null;
if (mass == null)
mass = isotopes.getNaturalMass(a);
totalmass += mass;
xsum += mass * a.getPoint3d().x;
ysum += mass * a.getPoint3d().y;
zsum += mass * a.getPoint3d().z;
}
return new Point3d(xsum / totalmass, ysum / totalmass, zsum / totalmass);
} | class class_name[name] begin[{]
method[get3DCentreOfMass, return_type[type[Point3d]], modifier[public static], parameter[ac]] begin[{]
local_variable[type[double], xsum]
local_variable[type[double], ysum]
local_variable[type[double], zsum]
local_variable[type[double], totalmass]
local_variable[type[Isotopes], isotopes]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isotopes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Isotopes, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not initialize Isotopes")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getExactMass, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), name=mass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPoint3d, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=mass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNaturalMass, postfix_operators=[], prefix_operators=[], qualifier=isotopes, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalmass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=mass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=xsum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=mass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getPoint3d, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[MemberReference(member=x, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ysum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=mass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getPoint3d, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[MemberReference(member=y, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=zsum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=mass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getPoint3d, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[MemberReference(member=z, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=*)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=atoms, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))), label=None)
return[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=xsum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=totalmass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), BinaryOperation(operandl=MemberReference(member=ysum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=totalmass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), BinaryOperation(operandl=MemberReference(member=zsum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=totalmass, 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=Point3d, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Point3d] identifier[get3DCentreOfMass] operator[SEP] identifier[IAtomContainer] identifier[ac] operator[SEP] {
Keyword[double] identifier[xsum] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[ysum] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[zsum] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[totalmass] operator[=] literal[Float] operator[SEP] identifier[Isotopes] identifier[isotopes] operator[SEP] Keyword[try] {
identifier[isotopes] operator[=] identifier[Isotopes] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[IAtom] identifier[a] operator[:] identifier[ac] operator[SEP] identifier[atoms] operator[SEP] operator[SEP] operator[SEP] {
identifier[Double] identifier[mass] operator[=] identifier[a] operator[SEP] identifier[getExactMass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[mass] operator[==] Other[null] operator[SEP] identifier[mass] operator[=] identifier[isotopes] operator[SEP] identifier[getNaturalMass] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[totalmass] operator[+=] identifier[mass] operator[SEP] identifier[xsum] operator[+=] identifier[mass] operator[*] identifier[a] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[ysum] operator[+=] identifier[mass] operator[*] identifier[a] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] identifier[y] operator[SEP] identifier[zsum] operator[+=] identifier[mass] operator[*] identifier[a] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] identifier[z] operator[SEP]
}
Keyword[return] Keyword[new] identifier[Point3d] operator[SEP] identifier[xsum] operator[/] identifier[totalmass] , identifier[ysum] operator[/] identifier[totalmass] , identifier[zsum] operator[/] identifier[totalmass] operator[SEP] operator[SEP]
}
|
public boolean hasModelGroupParent() {
boolean result = false;
Element parent = getElement().getParentElement();
while (parent != null) {
if (parent.getPropertyBoolean(PROP_IS_MODEL_GROUP)) {
result = true;
break;
}
parent = parent.getParentElement();
}
return result;
} | class class_name[name] begin[{]
method[hasModelGroupParent, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
local_variable[type[boolean], result]
local_variable[type[Element], parent]
while[binary_operation[member[.parent], !=, literal[null]]] begin[{]
if[call[parent.getPropertyBoolean, parameter[member[.PROP_IS_MODEL_GROUP]]]] begin[{]
assign[member[.result], literal[true]]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
assign[member[.parent], call[parent.getParentElement, parameter[]]]
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[hasModelGroupParent] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] identifier[Element] identifier[parent] operator[=] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getParentElement] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[parent] operator[SEP] identifier[getPropertyBoolean] operator[SEP] identifier[PROP_IS_MODEL_GROUP] operator[SEP] operator[SEP] {
identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
identifier[parent] operator[=] identifier[parent] operator[SEP] identifier[getParentElement] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static String replaceAll(final String text, final Pattern regex, final String replacement) {
if (text == null || regex == null || replacement == null) {
return text;
}
return regex.matcher(text).replaceAll(replacement);
} | class class_name[name] begin[{]
method[replaceAll, return_type[type[String]], modifier[public static], parameter[text, regex, replacement]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.text], ==, literal[null]], ||, binary_operation[member[.regex], ==, literal[null]]], ||, binary_operation[member[.replacement], ==, literal[null]]]] begin[{]
return[member[.text]]
else begin[{]
None
end[}]
return[call[regex.matcher, parameter[member[.text]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[replaceAll] operator[SEP] Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[Pattern] identifier[regex] , Keyword[final] identifier[String] identifier[replacement] operator[SEP] {
Keyword[if] operator[SEP] identifier[text] operator[==] Other[null] operator[||] identifier[regex] operator[==] Other[null] operator[||] identifier[replacement] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[text] operator[SEP]
}
Keyword[return] identifier[regex] operator[SEP] identifier[matcher] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[replacement] operator[SEP] operator[SEP]
}
|
Group replaceGroup(String id, Group group, AccessToken accessToken) {
return replaceResource(id, group, accessToken);
} | class class_name[name] begin[{]
method[replaceGroup, return_type[type[Group]], modifier[default], parameter[id, group, accessToken]] begin[{]
return[call[.replaceResource, parameter[member[.id], member[.group], member[.accessToken]]]]
end[}]
END[}] | identifier[Group] identifier[replaceGroup] operator[SEP] identifier[String] identifier[id] , identifier[Group] identifier[group] , identifier[AccessToken] identifier[accessToken] operator[SEP] {
Keyword[return] identifier[replaceResource] operator[SEP] identifier[id] , identifier[group] , identifier[accessToken] operator[SEP] operator[SEP]
}
|
@Override
public void writeTo(ByteBuffer buffer) {
//field->id
int id=0;
id=getId();
buffer.writeInt(id);
//field->name
String name=null;
name=getName();
if (name!=null){
buffer.writeBoolean(true);
buffer.writeUTF(name);
}else{ buffer.writeBoolean(false);}
//field->time
Date time=null;
time=getTime();
if (time!=null){
buffer.writeBoolean(true);
buffer.writeLong(time.getTime());
}else{ buffer.writeBoolean(false);}
//field->age
Integer age=null;
age=getAge();
if (age!=null){
buffer.writeBoolean(true);
buffer.writeInt(age);
}else{ buffer.writeBoolean(false);}
//field->array
int[] array=null;
array=getArray();
if (array!=null){
buffer.writeBoolean(true);
int array_l=array.length;
buffer.writeInt(array_l);
for(int array_i=0;array_i<array_l;array_i++){
int array_d=array[array_i];
buffer.writeInt(array_d);
}
}else{ buffer.writeBoolean(false);}
//field->listArray
List<int[]> listArray=null;
listArray=getListArray();
if (listArray!=null){
buffer.writeBoolean(true);
int listArray_ls=listArray.size();
buffer.writeInt(listArray_ls);
for(int[] listArray_lv:listArray){
int listArray_lv_l=listArray_lv.length;
buffer.writeInt(listArray_lv_l);
for(int listArray_lv_i=0;listArray_lv_i<listArray_lv_l;listArray_lv_i++){
int listArray_lv_d=listArray_lv[listArray_lv_i];
buffer.writeInt(listArray_lv_d);
}
}
}else{ buffer.writeBoolean(false);}
//field->setArray
Set<java.lang.Integer[]> setArray=null;
setArray=getSetArray();
if (setArray!=null){
buffer.writeBoolean(true);
int setArray_ls=setArray.size();
buffer.writeInt(setArray_ls);
for(Integer[] setArray_lv:setArray){
int setArray_lv_l=setArray_lv.length;
buffer.writeInt(setArray_lv_l);
for(int setArray_lv_i=0;setArray_lv_i<setArray_lv_l;setArray_lv_i++){
Integer setArray_lv_d=setArray_lv[setArray_lv_i];
buffer.writeInt(setArray_lv_d);
}
}
}else{ buffer.writeBoolean(false);}
//field->queues
Queue<java.lang.Byte[]> queues=null;
queues=getQueues();
if (queues!=null){
buffer.writeBoolean(true);
int queues_ls=queues.size();
buffer.writeInt(queues_ls);
for(Byte[] queues_lv:queues){
int queues_lv_l=queues_lv.length;
buffer.writeInt(queues_lv_l);
for(int queues_lv_i=0;queues_lv_i<queues_lv_l;queues_lv_i++){
Byte queues_lv_d=queues_lv[queues_lv_i];
buffer.writeByte(queues_lv_d);
}
}
}else{ buffer.writeBoolean(false);}
//field->map
Map<java.util.List<int[]>,java.util.Set<java.lang.Integer>> map=null;
map=getMap();
if (map!=null){
buffer.writeBoolean(true);
int map_ms=map.size();
buffer.writeInt(map_ms);
for(List<int[]> map_mk:map.keySet()){
Set<java.lang.Integer> map_mv=map.get(map_mk);
int map_mk_ls=map_mk.size();
buffer.writeInt(map_mk_ls);
for(int[] map_mk_lv:map_mk){
int map_mk_lv_l=map_mk_lv.length;
buffer.writeInt(map_mk_lv_l);
for(int map_mk_lv_i=0;map_mk_lv_i<map_mk_lv_l;map_mk_lv_i++){
int map_mk_lv_d=map_mk_lv[map_mk_lv_i];
buffer.writeInt(map_mk_lv_d);
}
}
int map_mv_ls=map_mv.size();
buffer.writeInt(map_mv_ls);
for(Integer map_mv_lv:map_mv){
buffer.writeInt(map_mv_lv);
}
}
}else{ buffer.writeBoolean(false);}
} | class class_name[name] begin[{]
method[writeTo, return_type[void], modifier[public], parameter[buffer]] begin[{]
local_variable[type[int], id]
assign[member[.id], call[.getId, parameter[]]]
call[buffer.writeInt, parameter[member[.id]]]
local_variable[type[String], name]
assign[member[.name], call[.getName, parameter[]]]
if[binary_operation[member[.name], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
call[buffer.writeUTF, parameter[member[.name]]]
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
local_variable[type[Date], time]
assign[member[.time], call[.getTime, parameter[]]]
if[binary_operation[member[.time], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
call[buffer.writeLong, parameter[call[time.getTime, parameter[]]]]
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
local_variable[type[Integer], age]
assign[member[.age], call[.getAge, parameter[]]]
if[binary_operation[member[.age], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
call[buffer.writeInt, parameter[member[.age]]]
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
local_variable[type[int], array]
assign[member[.array], call[.getArray, parameter[]]]
if[binary_operation[member[.array], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
local_variable[type[int], array_l]
call[buffer.writeInt, parameter[member[.array_l]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=array_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=array_d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=array_d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=array_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=array_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=array_i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=array_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
local_variable[type[List], listArray]
assign[member[.listArray], call[.getListArray, parameter[]]]
if[binary_operation[member[.listArray], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
local_variable[type[int], listArray_ls]
call[buffer.writeInt, parameter[member[.listArray_ls]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=listArray_lv, selectors=[]), name=listArray_lv_l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=listArray_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=listArray_lv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=listArray_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=listArray_lv_d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=listArray_lv_d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=listArray_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=listArray_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=listArray_lv_i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=listArray_lv_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=listArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listArray_lv)], modifiers=set(), type=BasicType(dimensions=[None], name=int))), label=None)
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
local_variable[type[Set], setArray]
assign[member[.setArray], call[.getSetArray, parameter[]]]
if[binary_operation[member[.setArray], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
local_variable[type[int], setArray_ls]
call[buffer.writeInt, parameter[member[.setArray_ls]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=setArray_lv, selectors=[]), name=setArray_lv_l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=setArray_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=setArray_lv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=setArray_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=setArray_lv_d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=setArray_lv_d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=setArray_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=setArray_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=setArray_lv_i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=setArray_lv_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=setArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=setArray_lv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Integer, sub_type=None))), label=None)
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
local_variable[type[Queue], queues]
assign[member[.queues], call[.getQueues, parameter[]]]
if[binary_operation[member[.queues], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
local_variable[type[int], queues_ls]
call[buffer.writeInt, parameter[member[.queues_ls]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=queues_lv, selectors=[]), name=queues_lv_l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=queues_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=queues_lv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=queues_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=queues_lv_d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Byte, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=queues_lv_d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeByte, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=queues_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=queues_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=queues_lv_i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=queues_lv_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=queues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=queues_lv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Byte, sub_type=None))), label=None)
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
local_variable[type[Map], map]
assign[member[.map], call[.getMap, parameter[]]]
if[binary_operation[member[.map], !=, literal[null]]] begin[{]
call[buffer.writeBoolean, parameter[literal[true]]]
local_variable[type[int], map_ms]
call[buffer.writeInt, parameter[member[.map_ms]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=map_mk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), name=map_mv)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=lang, sub_type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))))], dimensions=[], name=Set, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=map_mk, selectors=[], type_arguments=None), name=map_mk_ls)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=map_mk_ls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=map_mk_lv, selectors=[]), name=map_mk_lv_l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=map_mk_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=map_mk_lv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=map_mk_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=map_mk_lv_d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=map_mk_lv_d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=map_mk_lv_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=map_mk_lv_l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=map_mk_lv_i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=map_mk_lv_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=map_mk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=map_mk_lv)], modifiers=set(), type=BasicType(dimensions=[None], name=int))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=map_mv, selectors=[], type_arguments=None), name=map_mv_ls)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=map_mv_ls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=map_mv_lv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=map_mv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=map_mv_lv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=map_mk)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=BasicType(dimensions=[None], name=int))], dimensions=[], name=List, sub_type=None))), label=None)
else begin[{]
call[buffer.writeBoolean, parameter[literal[false]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeTo] operator[SEP] identifier[ByteBuffer] identifier[buffer] operator[SEP] {
Keyword[int] identifier[id] operator[=] Other[0] operator[SEP] identifier[id] operator[=] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] identifier[name] operator[=] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeUTF] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[Date] identifier[time] operator[=] Other[null] operator[SEP] identifier[time] operator[=] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[time] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeLong] operator[SEP] identifier[time] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[Integer] identifier[age] operator[=] Other[null] operator[SEP] identifier[age] operator[=] identifier[getAge] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[age] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[age] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[int] operator[SEP] operator[SEP] identifier[array] operator[=] Other[null] operator[SEP] identifier[array] operator[=] identifier[getArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[array] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[array_l] operator[=] identifier[array] operator[SEP] identifier[length] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[array_l] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[array_i] operator[=] Other[0] operator[SEP] identifier[array_i] operator[<] identifier[array_l] operator[SEP] identifier[array_i] operator[++] operator[SEP] {
Keyword[int] identifier[array_d] operator[=] identifier[array] operator[SEP] identifier[array_i] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[array_d] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[List] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[>] identifier[listArray] operator[=] Other[null] operator[SEP] identifier[listArray] operator[=] identifier[getListArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listArray] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[listArray_ls] operator[=] identifier[listArray] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[listArray_ls] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[listArray_lv] operator[:] identifier[listArray] operator[SEP] {
Keyword[int] identifier[listArray_lv_l] operator[=] identifier[listArray_lv] operator[SEP] identifier[length] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[listArray_lv_l] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[listArray_lv_i] operator[=] Other[0] operator[SEP] identifier[listArray_lv_i] operator[<] identifier[listArray_lv_l] operator[SEP] identifier[listArray_lv_i] operator[++] operator[SEP] {
Keyword[int] identifier[listArray_lv_d] operator[=] identifier[listArray_lv] operator[SEP] identifier[listArray_lv_i] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[listArray_lv_d] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[Set] operator[<] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Integer] operator[SEP] operator[SEP] operator[>] identifier[setArray] operator[=] Other[null] operator[SEP] identifier[setArray] operator[=] identifier[getSetArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[setArray] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[setArray_ls] operator[=] identifier[setArray] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[setArray_ls] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] operator[SEP] operator[SEP] identifier[setArray_lv] operator[:] identifier[setArray] operator[SEP] {
Keyword[int] identifier[setArray_lv_l] operator[=] identifier[setArray_lv] operator[SEP] identifier[length] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[setArray_lv_l] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[setArray_lv_i] operator[=] Other[0] operator[SEP] identifier[setArray_lv_i] operator[<] identifier[setArray_lv_l] operator[SEP] identifier[setArray_lv_i] operator[++] operator[SEP] {
identifier[Integer] identifier[setArray_lv_d] operator[=] identifier[setArray_lv] operator[SEP] identifier[setArray_lv_i] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[setArray_lv_d] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[Queue] operator[<] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Byte] operator[SEP] operator[SEP] operator[>] identifier[queues] operator[=] Other[null] operator[SEP] identifier[queues] operator[=] identifier[getQueues] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[queues] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[queues_ls] operator[=] identifier[queues] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[queues_ls] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Byte] operator[SEP] operator[SEP] identifier[queues_lv] operator[:] identifier[queues] operator[SEP] {
Keyword[int] identifier[queues_lv_l] operator[=] identifier[queues_lv] operator[SEP] identifier[length] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[queues_lv_l] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[queues_lv_i] operator[=] Other[0] operator[SEP] identifier[queues_lv_i] operator[<] identifier[queues_lv_l] operator[SEP] identifier[queues_lv_i] operator[++] operator[SEP] {
identifier[Byte] identifier[queues_lv_d] operator[=] identifier[queues_lv] operator[SEP] identifier[queues_lv_i] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeByte] operator[SEP] identifier[queues_lv_d] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[Map] operator[<] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[>] , identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Set] operator[<] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Integer] operator[>] operator[>] identifier[map] operator[=] Other[null] operator[SEP] identifier[map] operator[=] identifier[getMap] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[map] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[map_ms] operator[=] identifier[map] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[map_ms] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[>] identifier[map_mk] operator[:] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Integer] operator[>] identifier[map_mv] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[map_mk] operator[SEP] operator[SEP] Keyword[int] identifier[map_mk_ls] operator[=] identifier[map_mk] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[map_mk_ls] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[map_mk_lv] operator[:] identifier[map_mk] operator[SEP] {
Keyword[int] identifier[map_mk_lv_l] operator[=] identifier[map_mk_lv] operator[SEP] identifier[length] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[map_mk_lv_l] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[map_mk_lv_i] operator[=] Other[0] operator[SEP] identifier[map_mk_lv_i] operator[<] identifier[map_mk_lv_l] operator[SEP] identifier[map_mk_lv_i] operator[++] operator[SEP] {
Keyword[int] identifier[map_mk_lv_d] operator[=] identifier[map_mk_lv] operator[SEP] identifier[map_mk_lv_i] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[map_mk_lv_d] operator[SEP] operator[SEP]
}
}
Keyword[int] identifier[map_mv_ls] operator[=] identifier[map_mv] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[map_mv_ls] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[map_mv_lv] operator[:] identifier[map_mv] operator[SEP] {
identifier[buffer] operator[SEP] identifier[writeInt] operator[SEP] identifier[map_mv_lv] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[writeBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings({ "rawtypes", "unchecked" })
private static <D> ResourcePathNode<D> createRootPathSegment(CharSequenceScanner scanner, String originalPath,
Function<ResourcePathNode<D>, D> dataFunction) {
char first = scanner.peek();
if (first == PATH_SEGMENT_SEPARATOR_CHAR) {
if (originalPath.startsWith(UNC_PATH_PREFIX)) {
scanner.setCurrentIndex(UNC_PATH_PREFIX.length());
String uncSegment = scanner.readUntil(CharFilter.FILE_SEPARATOR_FILTER, true);
return new ResourcePathRootUnc<>(uncSegment, dataFunction);
}
if (((Function) dataFunction) == VOID_FUNCTION) {
return (ResourcePathNode<D>) ROOT_ABSOLUTE;
} else {
return new ResourcePathRootAbsolute<>(dataFunction);
}
} else {
if (first == HOME_PATH_CHAR) {
// home root
scanner.setCurrentIndex(1);
String user = scanner.readUntil(PATH_SEGMENT_SEPARATOR_CHAR, true);
if (user.isEmpty()) {
if (((Function) dataFunction) == VOID_FUNCTION) {
return (ResourcePathNode<D>) ROOT_HOME;
} else {
return new ResourcePathRootHome<>(dataFunction);
}
}
return new ResourcePathRootHome<>(user, dataFunction);
} else if (CharFilter.ASCII_LETTER_FILTER.accept(first)) {
// is windows drive letter?
int length = scanner.getLength();
if ((length > 1) && (scanner.charAt(1) == WINDOWS_DRIVE_LETTER_SUFFIX)) {
if ((length == 2) || (scanner.charAt(2) == PATH_SEGMENT_SEPARATOR_CHAR)) {
scanner.setCurrentIndex(2);
return new ResourcePathRootWindows(originalPath.substring(0, 1), dataFunction);
}
}
}
int authorityIndex = originalPath.indexOf(URL_SCHEME_AUTHORITY_SEPARATOR);
if (authorityIndex > 0) {
String scheme = scanner.read(authorityIndex);
scanner.require(URL_SCHEME_AUTHORITY_SEPARATOR, false);
String authority = scanner.readUntil(PATH_SEGMENT_SEPARATOR_CHAR, true);
return new ResourcePathRootUrl(scheme, authority, dataFunction);
}
if (((Function) dataFunction) == VOID_FUNCTION) {
return (ResourcePathNode<D>) ROOT_RELATIVE;
} else {
return new ResourcePathRootRelative<>(dataFunction);
}
}
} | class class_name[name] begin[{]
method[createRootPathSegment, return_type[type[ResourcePathNode]], modifier[private static], parameter[scanner, originalPath, dataFunction]] begin[{]
local_variable[type[char], first]
if[binary_operation[member[.first], ==, member[.PATH_SEGMENT_SEPARATOR_CHAR]]] begin[{]
if[call[originalPath.startsWith, parameter[member[.UNC_PATH_PREFIX]]]] begin[{]
call[scanner.setCurrentIndex, parameter[call[UNC_PATH_PREFIX.length, parameter[]]]]
local_variable[type[String], uncSegment]
return[ClassCreator(arguments=[MemberReference(member=uncSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataFunction, 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=ResourcePathRootUnc, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[Cast(expression=MemberReference(member=dataFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Function, sub_type=None)), ==, member[.VOID_FUNCTION]]] begin[{]
return[Cast(expression=MemberReference(member=ROOT_ABSOLUTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None))], dimensions=[], name=ResourcePathNode, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=dataFunction, 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=ResourcePathRootAbsolute, sub_type=None))]
end[}]
else begin[{]
if[binary_operation[member[.first], ==, member[.HOME_PATH_CHAR]]] begin[{]
call[scanner.setCurrentIndex, parameter[literal[1]]]
local_variable[type[String], user]
if[call[user.isEmpty, parameter[]]] begin[{]
if[binary_operation[Cast(expression=MemberReference(member=dataFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Function, sub_type=None)), ==, member[.VOID_FUNCTION]]] begin[{]
return[Cast(expression=MemberReference(member=ROOT_HOME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None))], dimensions=[], name=ResourcePathNode, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=dataFunction, 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=ResourcePathRootHome, sub_type=None))]
end[}]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataFunction, 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=ResourcePathRootHome, sub_type=None))]
else begin[{]
if[call[CharFilter.ASCII_LETTER_FILTER.accept, parameter[member[.first]]]] begin[{]
local_variable[type[int], length]
if[binary_operation[binary_operation[member[.length], >, literal[1]], &&, binary_operation[call[scanner.charAt, parameter[literal[1]]], ==, member[.WINDOWS_DRIVE_LETTER_SUFFIX]]]] begin[{]
if[binary_operation[binary_operation[member[.length], ==, literal[2]], ||, binary_operation[call[scanner.charAt, parameter[literal[2]]], ==, member[.PATH_SEGMENT_SEPARATOR_CHAR]]]] begin[{]
call[scanner.setCurrentIndex, parameter[literal[2]]]
return[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=originalPath, selectors=[], type_arguments=None), MemberReference(member=dataFunction, 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=ResourcePathRootWindows, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
local_variable[type[int], authorityIndex]
if[binary_operation[member[.authorityIndex], >, literal[0]]] begin[{]
local_variable[type[String], scheme]
call[scanner.require, parameter[member[.URL_SCHEME_AUTHORITY_SEPARATOR], literal[false]]]
local_variable[type[String], authority]
return[ClassCreator(arguments=[MemberReference(member=scheme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataFunction, 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=ResourcePathRootUrl, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[Cast(expression=MemberReference(member=dataFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Function, sub_type=None)), ==, member[.VOID_FUNCTION]]] begin[{]
return[Cast(expression=MemberReference(member=ROOT_RELATIVE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None))], dimensions=[], name=ResourcePathNode, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=dataFunction, 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=ResourcePathRootRelative, sub_type=None))]
end[}]
end[}]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[private] Keyword[static] operator[<] identifier[D] operator[>] identifier[ResourcePathNode] operator[<] identifier[D] operator[>] identifier[createRootPathSegment] operator[SEP] identifier[CharSequenceScanner] identifier[scanner] , identifier[String] identifier[originalPath] , identifier[Function] operator[<] identifier[ResourcePathNode] operator[<] identifier[D] operator[>] , identifier[D] operator[>] identifier[dataFunction] operator[SEP] {
Keyword[char] identifier[first] operator[=] identifier[scanner] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[first] operator[==] identifier[PATH_SEGMENT_SEPARATOR_CHAR] operator[SEP] {
Keyword[if] operator[SEP] identifier[originalPath] operator[SEP] identifier[startsWith] operator[SEP] identifier[UNC_PATH_PREFIX] operator[SEP] operator[SEP] {
identifier[scanner] operator[SEP] identifier[setCurrentIndex] operator[SEP] identifier[UNC_PATH_PREFIX] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[uncSegment] operator[=] identifier[scanner] operator[SEP] identifier[readUntil] operator[SEP] identifier[CharFilter] operator[SEP] identifier[FILE_SEPARATOR_FILTER] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ResourcePathRootUnc] operator[<] operator[>] operator[SEP] identifier[uncSegment] , identifier[dataFunction] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[Function] operator[SEP] identifier[dataFunction] operator[SEP] operator[==] identifier[VOID_FUNCTION] operator[SEP] {
Keyword[return] operator[SEP] identifier[ResourcePathNode] operator[<] identifier[D] operator[>] operator[SEP] identifier[ROOT_ABSOLUTE] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[ResourcePathRootAbsolute] operator[<] operator[>] operator[SEP] identifier[dataFunction] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[first] operator[==] identifier[HOME_PATH_CHAR] operator[SEP] {
identifier[scanner] operator[SEP] identifier[setCurrentIndex] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[user] operator[=] identifier[scanner] operator[SEP] identifier[readUntil] operator[SEP] identifier[PATH_SEGMENT_SEPARATOR_CHAR] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[Function] operator[SEP] identifier[dataFunction] operator[SEP] operator[==] identifier[VOID_FUNCTION] operator[SEP] {
Keyword[return] operator[SEP] identifier[ResourcePathNode] operator[<] identifier[D] operator[>] operator[SEP] identifier[ROOT_HOME] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[ResourcePathRootHome] operator[<] operator[>] operator[SEP] identifier[dataFunction] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[ResourcePathRootHome] operator[<] operator[>] operator[SEP] identifier[user] , identifier[dataFunction] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[CharFilter] operator[SEP] identifier[ASCII_LETTER_FILTER] operator[SEP] identifier[accept] operator[SEP] identifier[first] operator[SEP] operator[SEP] {
Keyword[int] identifier[length] operator[=] identifier[scanner] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] operator[&&] operator[SEP] identifier[scanner] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] identifier[WINDOWS_DRIVE_LETTER_SUFFIX] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] operator[||] operator[SEP] identifier[scanner] operator[SEP] identifier[charAt] operator[SEP] Other[2] operator[SEP] operator[==] identifier[PATH_SEGMENT_SEPARATOR_CHAR] operator[SEP] operator[SEP] {
identifier[scanner] operator[SEP] identifier[setCurrentIndex] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ResourcePathRootWindows] operator[SEP] identifier[originalPath] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] , identifier[dataFunction] operator[SEP] operator[SEP]
}
}
}
Keyword[int] identifier[authorityIndex] operator[=] identifier[originalPath] operator[SEP] identifier[indexOf] operator[SEP] identifier[URL_SCHEME_AUTHORITY_SEPARATOR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[authorityIndex] operator[>] Other[0] operator[SEP] {
identifier[String] identifier[scheme] operator[=] identifier[scanner] operator[SEP] identifier[read] operator[SEP] identifier[authorityIndex] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[require] operator[SEP] identifier[URL_SCHEME_AUTHORITY_SEPARATOR] , literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[authority] operator[=] identifier[scanner] operator[SEP] identifier[readUntil] operator[SEP] identifier[PATH_SEGMENT_SEPARATOR_CHAR] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ResourcePathRootUrl] operator[SEP] identifier[scheme] , identifier[authority] , identifier[dataFunction] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[Function] operator[SEP] identifier[dataFunction] operator[SEP] operator[==] identifier[VOID_FUNCTION] operator[SEP] {
Keyword[return] operator[SEP] identifier[ResourcePathNode] operator[<] identifier[D] operator[>] operator[SEP] identifier[ROOT_RELATIVE] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[ResourcePathRootRelative] operator[<] operator[>] operator[SEP] identifier[dataFunction] operator[SEP] operator[SEP]
}
}
}
|
private byte[] serialize() {
if (messageBytes == null && message != null) {
checkConverter();
messageBytes = converter.toBytes(message);
if (messageBytes == null) {
// should we throw an IOException instead?
LOG.warn("Could not serialize " + message.getClass());
} else {
message = null; // so that message and messageBytes don't go out of
// sync.
}
}
return messageBytes;
} | class class_name[name] begin[{]
method[serialize, return_type[type[byte]], modifier[private], parameter[]] begin[{]
if[binary_operation[binary_operation[member[.messageBytes], ==, literal[null]], &&, binary_operation[member[.message], !=, literal[null]]]] begin[{]
call[.checkConverter, parameter[]]
assign[member[.messageBytes], call[converter.toBytes, parameter[member[.message]]]]
if[binary_operation[member[.messageBytes], ==, literal[null]]] begin[{]
call[LOG.warn, parameter[binary_operation[literal["Could not serialize "], +, call[message.getClass, parameter[]]]]]
else begin[{]
assign[member[.message], literal[null]]
end[}]
else begin[{]
None
end[}]
return[member[.messageBytes]]
end[}]
END[}] | Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[serialize] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[messageBytes] operator[==] Other[null] operator[&&] identifier[message] operator[!=] Other[null] operator[SEP] {
identifier[checkConverter] operator[SEP] operator[SEP] operator[SEP] identifier[messageBytes] operator[=] identifier[converter] operator[SEP] identifier[toBytes] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[messageBytes] operator[==] Other[null] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[message] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[message] operator[=] Other[null] operator[SEP]
}
}
Keyword[return] identifier[messageBytes] operator[SEP]
}
|
private void twoWayMergeInternalStandard(final ReservoirItemsSketch<T> source) {
assert (source.getN() <= source.getK());
final int numInputSamples = source.getNumSamples();
for (int i = 0; i < numInputSamples; ++i) {
gadget_.update(source.getValueAtPosition(i));
}
} | class class_name[name] begin[{]
method[twoWayMergeInternalStandard, return_type[void], modifier[private], parameter[source]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getN, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getK, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), operator=<=), label=None, value=None)
local_variable[type[int], numInputSamples]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueAtPosition, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None)], member=update, postfix_operators=[], prefix_operators=[], qualifier=gadget_, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numInputSamples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[twoWayMergeInternalStandard] operator[SEP] Keyword[final] identifier[ReservoirItemsSketch] operator[<] identifier[T] operator[>] identifier[source] operator[SEP] {
Keyword[assert] operator[SEP] identifier[source] operator[SEP] identifier[getN] operator[SEP] operator[SEP] operator[<=] identifier[source] operator[SEP] identifier[getK] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[numInputSamples] operator[=] identifier[source] operator[SEP] identifier[getNumSamples] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numInputSamples] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[gadget_] operator[SEP] identifier[update] operator[SEP] identifier[source] operator[SEP] identifier[getValueAtPosition] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public synchronized long nextId() {
long currTimestamp = timestampGen();
if (currTimestamp < lastTimestamp) {
throw new IllegalStateException(
String.format("Clock moved backwards. Refusing to generate id for %d milliseconds",
lastTimestamp - currTimestamp));
}
if (currTimestamp == lastTimestamp) {
sequence = (sequence + 1) & maxSequence;
if (sequence == 0) { // overflow: greater than max sequence
currTimestamp = waitNextMillis(currTimestamp);
}
} else { // reset to 0 for next period/millisecond
sequence = 0L;
}
// track and memo the time stamp last snowflake ID generated
lastTimestamp = currTimestamp;
return ((currTimestamp - epoch) << timestampShift) | //
(datacenterId << datacenterIdShift) | //
(workerId << workerIdShift) | // new line for nice looking
sequence;
} | class class_name[name] begin[{]
method[nextId, return_type[type[long]], modifier[synchronized public], parameter[]] begin[{]
local_variable[type[long], currTimestamp]
if[binary_operation[member[.currTimestamp], <, member[.lastTimestamp]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Clock moved backwards. Refusing to generate id for %d milliseconds"), BinaryOperation(operandl=MemberReference(member=lastTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=currTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], 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=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.currTimestamp], ==, member[.lastTimestamp]]] begin[{]
assign[member[.sequence], binary_operation[binary_operation[member[.sequence], +, literal[1]], &, member[.maxSequence]]]
if[binary_operation[member[.sequence], ==, literal[0]]] begin[{]
assign[member[.currTimestamp], call[.waitNextMillis, parameter[member[.currTimestamp]]]]
else begin[{]
None
end[}]
else begin[{]
assign[member[.sequence], literal[0L]]
end[}]
assign[member[.lastTimestamp], member[.currTimestamp]]
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.currTimestamp], -, member[.epoch]], <<, member[.timestampShift]], |, binary_operation[member[.datacenterId], <<, member[.datacenterIdShift]]], |, binary_operation[member[.workerId], <<, member[.workerIdShift]]], |, member[.sequence]]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[long] identifier[nextId] operator[SEP] operator[SEP] {
Keyword[long] identifier[currTimestamp] operator[=] identifier[timestampGen] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currTimestamp] operator[<] identifier[lastTimestamp] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[lastTimestamp] operator[-] identifier[currTimestamp] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[currTimestamp] operator[==] identifier[lastTimestamp] operator[SEP] {
identifier[sequence] operator[=] operator[SEP] identifier[sequence] operator[+] Other[1] operator[SEP] operator[&] identifier[maxSequence] operator[SEP] Keyword[if] operator[SEP] identifier[sequence] operator[==] Other[0] operator[SEP] {
identifier[currTimestamp] operator[=] identifier[waitNextMillis] operator[SEP] identifier[currTimestamp] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[sequence] operator[=] Other[0L] operator[SEP]
}
identifier[lastTimestamp] operator[=] identifier[currTimestamp] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[currTimestamp] operator[-] identifier[epoch] operator[SEP] operator[<<] identifier[timestampShift] operator[SEP] operator[|] operator[SEP] identifier[datacenterId] operator[<<] identifier[datacenterIdShift] operator[SEP] operator[|] operator[SEP] identifier[workerId] operator[<<] identifier[workerIdShift] operator[SEP] operator[|] identifier[sequence] operator[SEP]
}
|
public static double distHalf( double angA , double angB ) {
double a = Math.abs(angA-angB);
if( a <= Math.PI/2 )
return a;
else
return Math.PI-a;
} | class class_name[name] begin[{]
method[distHalf, return_type[type[double]], modifier[public static], parameter[angA, angB]] begin[{]
local_variable[type[double], a]
if[binary_operation[member[.a], <=, binary_operation[member[Math.PI], /, literal[2]]]] begin[{]
return[member[.a]]
else begin[{]
return[binary_operation[member[Math.PI], -, member[.a]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[distHalf] operator[SEP] Keyword[double] identifier[angA] , Keyword[double] identifier[angB] operator[SEP] {
Keyword[double] identifier[a] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[angA] operator[-] identifier[angB] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[<=] identifier[Math] operator[SEP] identifier[PI] operator[/] Other[2] operator[SEP] Keyword[return] identifier[a] operator[SEP] Keyword[else] Keyword[return] identifier[Math] operator[SEP] identifier[PI] operator[-] identifier[a] operator[SEP]
}
|
private static void validateCredentials() {
try {
Account.get().getAccountInfo();
} catch (Exception e) {
if (e instanceof AppPlatformException) {
AppPlatformException appEx = (AppPlatformException) e;
if (appEx.getStatus() == 401){
throw new InvalidCredentialsException();
}
} else {
throw new RuntimeException(e);
}
}
} | class class_name[name] begin[{]
method[validateCredentials, return_type[void], modifier[private static], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Account, selectors=[MethodInvocation(arguments=[], member=getAccountInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=AppPlatformException, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AppPlatformException, sub_type=None)), name=appEx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AppPlatformException, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=appEx, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=401), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidCredentialsException, 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[private] Keyword[static] Keyword[void] identifier[validateCredentials] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[Account] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getAccountInfo] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[AppPlatformException] operator[SEP] {
identifier[AppPlatformException] identifier[appEx] operator[=] operator[SEP] identifier[AppPlatformException] operator[SEP] identifier[e] operator[SEP] Keyword[if] operator[SEP] identifier[appEx] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] Other[401] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidCredentialsException] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public boolean readRequest(MuxInputStream in, MuxOutputStream out)
throws IOException
{
int channel = isClient ? 3 : 2;
in.init(this, channel);
out.init(this, channel);
if (readChannel(channel) != null) {
in.setInputStream(is);
in.readToData(false);
return true;
}
else
return false;
} | class class_name[name] begin[{]
method[readRequest, return_type[type[boolean]], modifier[public], parameter[in, out]] begin[{]
local_variable[type[int], channel]
call[in.init, parameter[THIS[], member[.channel]]]
call[out.init, parameter[THIS[], member[.channel]]]
if[binary_operation[call[.readChannel, parameter[member[.channel]]], !=, literal[null]]] begin[{]
call[in.setInputStream, parameter[member[.is]]]
call[in.readToData, parameter[literal[false]]]
return[literal[true]]
else begin[{]
return[literal[false]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[readRequest] operator[SEP] identifier[MuxInputStream] identifier[in] , identifier[MuxOutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[channel] operator[=] identifier[isClient] operator[?] Other[3] operator[:] Other[2] operator[SEP] identifier[in] operator[SEP] identifier[init] operator[SEP] Keyword[this] , identifier[channel] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[init] operator[SEP] Keyword[this] , identifier[channel] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readChannel] operator[SEP] identifier[channel] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[in] operator[SEP] identifier[setInputStream] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[readToData] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[return] literal[boolean] operator[SEP]
}
|
public void writeClose(Writer writer) throws IOException {
writer.append(CLOSEBRACE).append(CLOSEPARENTHESIS).append(PARENTHESIS).append(SEMICOLON).append(CR); // })();
} | class class_name[name] begin[{]
method[writeClose, return_type[void], modifier[public], parameter[writer]] begin[{]
call[writer.append, parameter[member[.CLOSEBRACE]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[writeClose] operator[SEP] identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[writer] operator[SEP] identifier[append] operator[SEP] identifier[CLOSEBRACE] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CLOSEPARENTHESIS] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[PARENTHESIS] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[SEMICOLON] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CR] operator[SEP] operator[SEP]
}
|
protected Response createOk(Object entity) {
return Response
.status(Response.Status.OK)
.entity(entity)
.build();
} | class class_name[name] begin[{]
method[createOk, return_type[type[Response]], modifier[protected], parameter[entity]] begin[{]
return[call[Response.status, parameter[member[Response.Status.OK]]]]
end[}]
END[}] | Keyword[protected] identifier[Response] identifier[createOk] operator[SEP] identifier[Object] identifier[entity] operator[SEP] {
Keyword[return] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[OK] operator[SEP] operator[SEP] identifier[entity] operator[SEP] identifier[entity] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean expireAllLeasesByVMId(String vmId) throws IllegalStateException {
final String hostname = assignableVMs.getHostnameFromVMId(vmId);
if (hostname == null) {
return false;
}
expireAllLeases(hostname);
return true;
} | class class_name[name] begin[{]
method[expireAllLeasesByVMId, return_type[type[boolean]], modifier[public], parameter[vmId]] begin[{]
local_variable[type[String], hostname]
if[binary_operation[member[.hostname], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
call[.expireAllLeases, parameter[member[.hostname]]]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[expireAllLeasesByVMId] operator[SEP] identifier[String] identifier[vmId] operator[SEP] Keyword[throws] identifier[IllegalStateException] {
Keyword[final] identifier[String] identifier[hostname] operator[=] identifier[assignableVMs] operator[SEP] identifier[getHostnameFromVMId] operator[SEP] identifier[vmId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hostname] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[expireAllLeases] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XtypePackage.XIMPORT_DECLARATION__WILDCARD:
return isWildcard();
case XtypePackage.XIMPORT_DECLARATION__EXTENSION:
return isExtension();
case XtypePackage.XIMPORT_DECLARATION__STATIC:
return isStatic();
case XtypePackage.XIMPORT_DECLARATION__IMPORTED_TYPE:
if (resolve) return getImportedType();
return basicGetImportedType();
case XtypePackage.XIMPORT_DECLARATION__MEMBER_NAME:
return getMemberName();
case XtypePackage.XIMPORT_DECLARATION__IMPORTED_NAMESPACE:
return getImportedNamespace();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=XIMPORT_DECLARATION__WILDCARD, postfix_operators=[], prefix_operators=[], qualifier=XtypePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isWildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XIMPORT_DECLARATION__EXTENSION, postfix_operators=[], prefix_operators=[], qualifier=XtypePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isExtension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XIMPORT_DECLARATION__STATIC, postfix_operators=[], prefix_operators=[], qualifier=XtypePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isStatic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XIMPORT_DECLARATION__IMPORTED_TYPE, postfix_operators=[], prefix_operators=[], qualifier=XtypePackage, selectors=[])], statements=[IfStatement(condition=MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=getImportedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=basicGetImportedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XIMPORT_DECLARATION__MEMBER_NAME, postfix_operators=[], prefix_operators=[], qualifier=XtypePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMemberName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XIMPORT_DECLARATION__IMPORTED_NAMESPACE, postfix_operators=[], prefix_operators=[], qualifier=XtypePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getImportedNamespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[XtypePackage] operator[SEP] identifier[XIMPORT_DECLARATION__WILDCARD] operator[:] Keyword[return] identifier[isWildcard] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XtypePackage] operator[SEP] identifier[XIMPORT_DECLARATION__EXTENSION] operator[:] Keyword[return] identifier[isExtension] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XtypePackage] operator[SEP] identifier[XIMPORT_DECLARATION__STATIC] operator[:] Keyword[return] identifier[isStatic] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XtypePackage] operator[SEP] identifier[XIMPORT_DECLARATION__IMPORTED_TYPE] operator[:] Keyword[if] operator[SEP] identifier[resolve] operator[SEP] Keyword[return] identifier[getImportedType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[basicGetImportedType] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XtypePackage] operator[SEP] identifier[XIMPORT_DECLARATION__MEMBER_NAME] operator[:] Keyword[return] identifier[getMemberName] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XtypePackage] operator[SEP] identifier[XIMPORT_DECLARATION__IMPORTED_NAMESPACE] operator[:] Keyword[return] identifier[getImportedNamespace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
public DescribeTableRestoreStatusResult withTableRestoreStatusDetails(TableRestoreStatus... tableRestoreStatusDetails) {
if (this.tableRestoreStatusDetails == null) {
setTableRestoreStatusDetails(new com.amazonaws.internal.SdkInternalList<TableRestoreStatus>(tableRestoreStatusDetails.length));
}
for (TableRestoreStatus ele : tableRestoreStatusDetails) {
this.tableRestoreStatusDetails.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withTableRestoreStatusDetails, return_type[type[DescribeTableRestoreStatusResult]], modifier[public], parameter[tableRestoreStatusDetails]] begin[{]
if[binary_operation[THIS[member[None.tableRestoreStatusDetails]], ==, literal[null]]] begin[{]
call[.setTableRestoreStatusDetails, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tableRestoreStatusDetails, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TableRestoreStatus, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tableRestoreStatusDetails, 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=tableRestoreStatusDetails, 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=TableRestoreStatus, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DescribeTableRestoreStatusResult] identifier[withTableRestoreStatusDetails] operator[SEP] identifier[TableRestoreStatus] operator[...] identifier[tableRestoreStatusDetails] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[tableRestoreStatusDetails] operator[==] Other[null] operator[SEP] {
identifier[setTableRestoreStatusDetails] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[TableRestoreStatus] operator[>] operator[SEP] identifier[tableRestoreStatusDetails] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[TableRestoreStatus] identifier[ele] operator[:] identifier[tableRestoreStatusDetails] operator[SEP] {
Keyword[this] operator[SEP] identifier[tableRestoreStatusDetails] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@Nonnull
public static <T1, T2> LObjIntObjPredicate<T1, T2> objIntObjPredicateFrom(Consumer<LObjIntObjPredicateBuilder<T1, T2>> buildingFunction) {
LObjIntObjPredicateBuilder builder = new LObjIntObjPredicateBuilder();
buildingFunction.accept(builder);
return builder.build();
} | class class_name[name] begin[{]
method[objIntObjPredicateFrom, return_type[type[LObjIntObjPredicate]], modifier[public static], parameter[buildingFunction]] begin[{]
local_variable[type[LObjIntObjPredicateBuilder], builder]
call[buildingFunction.accept, parameter[member[.builder]]]
return[call[builder.build, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] operator[>] identifier[LObjIntObjPredicate] operator[<] identifier[T1] , identifier[T2] operator[>] identifier[objIntObjPredicateFrom] operator[SEP] identifier[Consumer] operator[<] identifier[LObjIntObjPredicateBuilder] operator[<] identifier[T1] , identifier[T2] operator[>] operator[>] identifier[buildingFunction] operator[SEP] {
identifier[LObjIntObjPredicateBuilder] identifier[builder] operator[=] Keyword[new] identifier[LObjIntObjPredicateBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildingFunction] operator[SEP] identifier[accept] operator[SEP] identifier[builder] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.