code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public final Ix<T> switchIfEmpty(Iterable<? extends T> other) {
return new IxSwitchIfEmpty<T>(this, nullCheck(other, "other is null"));
} | class class_name[name] begin[{]
method[switchIfEmpty, return_type[type[Ix]], modifier[final public], parameter[other]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="other is null")], member=nullCheck, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=IxSwitchIfEmpty, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[Ix] operator[<] identifier[T] operator[>] identifier[switchIfEmpty] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[other] operator[SEP] {
Keyword[return] Keyword[new] identifier[IxSwitchIfEmpty] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[nullCheck] operator[SEP] identifier[other] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
|
public void filter(MediaPacket packet, String args) {
VideoJNI.BitStreamFilter_filter__SWIG_1(swigCPtr, this, MediaPacket.getCPtr(packet), packet, args);
} | class class_name[name] begin[{]
method[filter, return_type[void], modifier[public], parameter[packet, args]] begin[{]
call[VideoJNI.BitStreamFilter_filter__SWIG_1, parameter[member[.swigCPtr], THIS[], call[MediaPacket.getCPtr, parameter[member[.packet]]], member[.packet], member[.args]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[filter] operator[SEP] identifier[MediaPacket] identifier[packet] , identifier[String] identifier[args] operator[SEP] {
identifier[VideoJNI] operator[SEP] identifier[BitStreamFilter_filter__SWIG_1] operator[SEP] identifier[swigCPtr] , Keyword[this] , identifier[MediaPacket] operator[SEP] identifier[getCPtr] operator[SEP] identifier[packet] operator[SEP] , identifier[packet] , identifier[args] operator[SEP] operator[SEP]
}
|
@Override
public <T> T createMockComponent(final Class<T> type) {
if (Modifier.isFinal(type.getModifiers()) || type.isPrimitive()) {
LOG.warn("Skipping creation of a mock : {} as it is final or primitive type.", type.getSimpleName());
return null;
}
T mock = createNiceMock(type);
return mock;
} | class class_name[name] begin[{]
method[createMockComponent, return_type[type[T]], modifier[public], parameter[type]] begin[{]
if[binary_operation[call[Modifier.isFinal, parameter[call[type.getModifiers, parameter[]]]], ||, call[type.isPrimitive, parameter[]]]] begin[{]
call[LOG.warn, parameter[literal["Skipping creation of a mock : {} as it is final or primitive type."], call[type.getSimpleName, parameter[]]]]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[T], mock]
return[member[.mock]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[createMockComponent] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isFinal] operator[SEP] identifier[type] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[type] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[type] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[T] identifier[mock] operator[=] identifier[createNiceMock] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[mock] operator[SEP]
}
|
@Override
public long read(OutputStream stream, long length, long position) throws IOException
{
if (url != null)
{
if (tempFile != null)
{
return readFromFile(stream, tempFile, length, position);
}
else if (spoolContent)
{
spoolContent();
return readFromFile(stream, tempFile, length, position);
}
InputStream is = url.openStream();
try
{
is.skip(position);
byte[] bytes = new byte[(int)length];
int lg = is.read(bytes);
if (lg > 0)
stream.write(bytes, 0, lg);
return lg;
}
finally
{
is.close();
stream.close();
}
}
return super.read(stream, length, position);
} | class class_name[name] begin[{]
method[read, return_type[type[long]], modifier[public], parameter[stream, length, position]] begin[{]
if[binary_operation[member[.url], !=, literal[null]]] begin[{]
if[binary_operation[member[.tempFile], !=, literal[null]]] begin[{]
return[call[.readFromFile, parameter[member[.stream], member[.tempFile], member[.length], member[.position]]]]
else begin[{]
if[member[.spoolContent]] begin[{]
call[.spoolContent, parameter[]]
return[call[.readFromFile, parameter[member[.stream], member[.tempFile], member[.length], member[.position]]]]
else begin[{]
None
end[}]
end[}]
local_variable[type[InputStream], is]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=skip, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Cast(expression=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=bytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), name=lg)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=lg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=lg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
return[SuperMethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[read] operator[SEP] identifier[OutputStream] identifier[stream] , Keyword[long] identifier[length] , Keyword[long] identifier[position] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[url] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[tempFile] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[readFromFile] operator[SEP] identifier[stream] , identifier[tempFile] , identifier[length] , identifier[position] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[spoolContent] operator[SEP] {
identifier[spoolContent] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[readFromFile] operator[SEP] identifier[stream] , identifier[tempFile] , identifier[length] , identifier[position] operator[SEP] operator[SEP]
}
identifier[InputStream] identifier[is] operator[=] identifier[url] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[is] operator[SEP] identifier[skip] operator[SEP] identifier[position] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[lg] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lg] operator[>] Other[0] operator[SEP] identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[bytes] , Other[0] , identifier[lg] operator[SEP] operator[SEP] Keyword[return] identifier[lg] operator[SEP]
}
Keyword[finally] {
identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[super] operator[SEP] identifier[read] operator[SEP] identifier[stream] , identifier[length] , identifier[position] operator[SEP] operator[SEP]
}
|
boolean setParentNodeReference(N newParent, boolean fireEvent) {
final N oldParent = getParentNode();
if (newParent == oldParent) {
return false;
}
this.parent = (newParent == null) ? null : new WeakReference<>(newParent);
if (!fireEvent) {
return true;
}
firePropertyParentChanged(oldParent, newParent);
if (oldParent != null) {
oldParent.firePropertyParentChanged(toN(), oldParent, newParent);
}
return false;
} | class class_name[name] begin[{]
method[setParentNodeReference, return_type[type[boolean]], modifier[default], parameter[newParent, fireEvent]] begin[{]
local_variable[type[N], oldParent]
if[binary_operation[member[.newParent], ==, member[.oldParent]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[THIS[member[None.parent]], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=newParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MemberReference(member=newParent, 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=WeakReference, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
if[member[.fireEvent]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
call[.firePropertyParentChanged, parameter[member[.oldParent], member[.newParent]]]
if[binary_operation[member[.oldParent], !=, literal[null]]] begin[{]
call[oldParent.firePropertyParentChanged, parameter[call[.toN, parameter[]], member[.oldParent], member[.newParent]]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[boolean] identifier[setParentNodeReference] operator[SEP] identifier[N] identifier[newParent] , Keyword[boolean] identifier[fireEvent] operator[SEP] {
Keyword[final] identifier[N] identifier[oldParent] operator[=] identifier[getParentNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newParent] operator[==] identifier[oldParent] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[this] operator[SEP] identifier[parent] operator[=] operator[SEP] identifier[newParent] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[WeakReference] operator[<] operator[>] operator[SEP] identifier[newParent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[fireEvent] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[firePropertyParentChanged] operator[SEP] identifier[oldParent] , identifier[newParent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldParent] operator[!=] Other[null] operator[SEP] {
identifier[oldParent] operator[SEP] identifier[firePropertyParentChanged] operator[SEP] identifier[toN] operator[SEP] operator[SEP] , identifier[oldParent] , identifier[newParent] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public ServiceFuture<List<JobExecutionInner>> listByJobExecutionAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId, final ListOperationCallback<JobExecutionInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByJobExecutionSinglePageAsync(resourceGroupName, serverName, jobAgentName, jobName, jobExecutionId),
new Func1<String, Observable<ServiceResponse<Page<JobExecutionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<JobExecutionInner>>> call(String nextPageLink) {
return listByJobExecutionNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
} | class class_name[name] begin[{]
method[listByJobExecutionAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, jobAgentName, jobName, jobExecutionId, serviceCallback]] begin[{]
return[call[AzureServiceFuture.fromPageResponse, parameter[call[.listByJobExecutionSinglePageAsync, parameter[member[.resourceGroupName], member[.serverName], member[.jobAgentName], member[.jobName], member[.jobExecutionId]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listByJobExecutionNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JobExecutionInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JobExecutionInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None))], dimensions=None, name=Func1, sub_type=None)), member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[JobExecutionInner] operator[>] operator[>] identifier[listByJobExecutionAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[serverName] , Keyword[final] identifier[String] identifier[jobAgentName] , Keyword[final] identifier[String] identifier[jobName] , Keyword[final] identifier[UUID] identifier[jobExecutionId] , Keyword[final] identifier[ListOperationCallback] operator[<] identifier[JobExecutionInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[listByJobExecutionSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[jobAgentName] , identifier[jobName] , identifier[jobExecutionId] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobExecutionInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobExecutionInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] {
Keyword[return] identifier[listByJobExecutionNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP]
}
} , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public static long calc(String arg0, String arg1, String format, DateUnit dateUnit) {
try {
return calc(getTime(format, arg0), getTime(format, arg1), dateUnit);
} catch (Exception e) {
logger.error("日期计算出错", e);
return -1;
}
} | class class_name[name] begin[{]
method[calc, return_type[type[long]], modifier[public static], parameter[arg0, arg1, format, dateUnit]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arg0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arg1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=dateUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=calc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="日期计算出错"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[long] identifier[calc] operator[SEP] identifier[String] identifier[arg0] , identifier[String] identifier[arg1] , identifier[String] identifier[format] , identifier[DateUnit] identifier[dateUnit] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[calc] operator[SEP] identifier[getTime] operator[SEP] identifier[format] , identifier[arg0] operator[SEP] , identifier[getTime] operator[SEP] identifier[format] , identifier[arg1] operator[SEP] , identifier[dateUnit] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP]
}
}
|
public final void removeNavigationListener(@NonNull final NavigationListener listener) {
Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null");
navigationListeners.remove(listener);
} | class class_name[name] begin[{]
method[removeNavigationListener, return_type[void], modifier[final public], parameter[listener]] begin[{]
call[Condition.INSTANCE.ensureNotNull, parameter[member[.listener], literal["The listener may not be null"]]]
call[navigationListeners.remove, parameter[member[.listener]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[removeNavigationListener] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[NavigationListener] identifier[listener] operator[SEP] {
identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[listener] , literal[String] operator[SEP] operator[SEP] identifier[navigationListeners] operator[SEP] identifier[remove] operator[SEP] identifier[listener] operator[SEP] operator[SEP]
}
|
protected <S extends Storable> CustomStorableCodec<S>
createCodec(Class<S> type, boolean isMaster, Layout layout, RawSupport support)
throws SupportException
{
return createCodec(type, isMaster, layout);
} | class class_name[name] begin[{]
method[createCodec, return_type[type[CustomStorableCodec]], modifier[protected], parameter[type, isMaster, layout, support]] begin[{]
return[call[.createCodec, parameter[member[.type], member[.isMaster], member[.layout]]]]
end[}]
END[}] | Keyword[protected] operator[<] identifier[S] Keyword[extends] identifier[Storable] operator[>] identifier[CustomStorableCodec] operator[<] identifier[S] operator[>] identifier[createCodec] operator[SEP] identifier[Class] operator[<] identifier[S] operator[>] identifier[type] , Keyword[boolean] identifier[isMaster] , identifier[Layout] identifier[layout] , identifier[RawSupport] identifier[support] operator[SEP] Keyword[throws] identifier[SupportException] {
Keyword[return] identifier[createCodec] operator[SEP] identifier[type] , identifier[isMaster] , identifier[layout] operator[SEP] operator[SEP]
}
|
public static byte[] toBytes(String str) {
if (str == null) {
return null;
}
//optimization for ascii strings
byte[] ascii = toAsciiBytes(str);
if(ascii != null) return ascii;
ByteBuffer bb = UTF8_CHARSET.encode(str);
return getBytes(bb);
} | class class_name[name] begin[{]
method[toBytes, return_type[type[byte]], modifier[public static], parameter[str]] begin[{]
if[binary_operation[member[.str], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[byte], ascii]
if[binary_operation[member[.ascii], !=, literal[null]]] begin[{]
return[member[.ascii]]
else begin[{]
None
end[}]
local_variable[type[ByteBuffer], bb]
return[call[.getBytes, parameter[member[.bb]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[toBytes] operator[SEP] identifier[String] identifier[str] operator[SEP] {
Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[ascii] operator[=] identifier[toAsciiBytes] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ascii] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[ascii] operator[SEP] identifier[ByteBuffer] identifier[bb] operator[=] identifier[UTF8_CHARSET] operator[SEP] identifier[encode] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[return] identifier[getBytes] operator[SEP] identifier[bb] operator[SEP] operator[SEP]
}
|
protected void entryRemoved (V entry)
{
if (entry != null) {
_size -= _sizer.computeSize(entry);
if (_remobs != null) {
_remobs.removedFromMap(this, entry);
}
}
} | class class_name[name] begin[{]
method[entryRemoved, return_type[void], modifier[protected], parameter[entry]] begin[{]
if[binary_operation[member[.entry], !=, literal[null]]] begin[{]
assign[member[._size], call[_sizer.computeSize, parameter[member[.entry]]]]
if[binary_operation[member[._remobs], !=, literal[null]]] begin[{]
call[_remobs.removedFromMap, parameter[THIS[], member[.entry]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[entryRemoved] operator[SEP] identifier[V] identifier[entry] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[!=] Other[null] operator[SEP] {
identifier[_size] operator[-=] identifier[_sizer] operator[SEP] identifier[computeSize] operator[SEP] identifier[entry] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_remobs] operator[!=] Other[null] operator[SEP] {
identifier[_remobs] operator[SEP] identifier[removedFromMap] operator[SEP] Keyword[this] , identifier[entry] operator[SEP] operator[SEP]
}
}
}
|
@Override
public void close() {
Iterator<Map.Entry<Path, OpenCryptoFile>> iter = openCryptoFiles.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<Path, OpenCryptoFile> entry = iter.next();
iter.remove(); // remove before invoking close() to avoid concurrent modification of this iterator by #close(OpenCryptoFile)
entry.getValue().close();
}
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Iterator], iter]
while[call[iter.hasNext, parameter[]]] begin[{]
local_variable[type[Map], entry]
call[iter.remove, parameter[]]
call[entry.getValue, parameter[]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] {
identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Path] , identifier[OpenCryptoFile] operator[>] operator[>] identifier[iter] operator[=] identifier[openCryptoFiles] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Path] , identifier[OpenCryptoFile] operator[>] identifier[entry] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static String get(String name, String defaultValue)
{
return PropertyManager.getProperty(name, defaultValue);
} | class class_name[name] begin[{]
method[get, return_type[type[String]], modifier[public static], parameter[name, defaultValue]] begin[{]
return[call[PropertyManager.getProperty, parameter[member[.name], member[.defaultValue]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[get] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[defaultValue] operator[SEP] {
Keyword[return] identifier[PropertyManager] operator[SEP] identifier[getProperty] operator[SEP] identifier[name] , identifier[defaultValue] operator[SEP] operator[SEP]
}
|
public static List<String> parseLetterLinks(Document aDocument) {
final List<String> results = new ArrayList<>();
Elements links = aDocument.select(LETTER_URL_SELECTOR);
links.forEach(element -> {
if (element.hasAttr(ATTRIBUTE_HREF)) {
String subpage = element.attr(ATTRIBUTE_HREF);
results.add(OrfConstants.URL_BASE + subpage);
}
});
return results;
} | class class_name[name] begin[{]
method[parseLetterLinks, return_type[type[List]], modifier[public static], parameter[aDocument]] begin[{]
local_variable[type[List], results]
local_variable[type[Elements], links]
call[links.forEach, parameter[LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ATTRIBUTE_HREF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasAttr, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ATTRIBUTE_HREF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=attr, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), name=subpage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=URL_BASE, postfix_operators=[], prefix_operators=[], qualifier=OrfConstants, selectors=[]), operandr=MemberReference(member=subpage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]))], parameters=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
return[member[.results]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[parseLetterLinks] operator[SEP] identifier[Document] identifier[aDocument] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[results] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Elements] identifier[links] operator[=] identifier[aDocument] operator[SEP] identifier[select] operator[SEP] identifier[LETTER_URL_SELECTOR] operator[SEP] operator[SEP] identifier[links] operator[SEP] identifier[forEach] operator[SEP] identifier[element] operator[->] {
Keyword[if] operator[SEP] identifier[element] operator[SEP] identifier[hasAttr] operator[SEP] identifier[ATTRIBUTE_HREF] operator[SEP] operator[SEP] {
identifier[String] identifier[subpage] operator[=] identifier[element] operator[SEP] identifier[attr] operator[SEP] identifier[ATTRIBUTE_HREF] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[OrfConstants] operator[SEP] identifier[URL_BASE] operator[+] identifier[subpage] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[return] identifier[results] operator[SEP]
}
|
@Override
public SqlContext setupSqlBulkInsertContext(final SqlAgent agent, final SqlContext context,
final TableMetadata metadata, final Class<? extends Object> entityType, final int numberOfRecords) {
return context.setSql(buildBulkInsertSQL(metadata, entityType, agent.getSqlConfig(), numberOfRecords));
} | class class_name[name] begin[{]
method[setupSqlBulkInsertContext, return_type[type[SqlContext]], modifier[public], parameter[agent, context, metadata, entityType, numberOfRecords]] begin[{]
return[call[context.setSql, parameter[call[.buildBulkInsertSQL, parameter[member[.metadata], member[.entityType], call[agent.getSqlConfig, parameter[]], member[.numberOfRecords]]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SqlContext] identifier[setupSqlBulkInsertContext] operator[SEP] Keyword[final] identifier[SqlAgent] identifier[agent] , Keyword[final] identifier[SqlContext] identifier[context] , Keyword[final] identifier[TableMetadata] identifier[metadata] , Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Object] operator[>] identifier[entityType] , Keyword[final] Keyword[int] identifier[numberOfRecords] operator[SEP] {
Keyword[return] identifier[context] operator[SEP] identifier[setSql] operator[SEP] identifier[buildBulkInsertSQL] operator[SEP] identifier[metadata] , identifier[entityType] , identifier[agent] operator[SEP] identifier[getSqlConfig] operator[SEP] operator[SEP] , identifier[numberOfRecords] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Preference createMultiTextPreference(
String name, String label, TextDisplay displayType, List<String> defaultValues) {
MultiTextPreferenceInput input = new MultiTextPreferenceInput();
input.getDefaults().addAll(defaultValues);
input.setDisplay(displayType);
Preference pref = new Preference();
pref.setName(name);
pref.setLabel(label);
pref.setPreferenceInput(
new JAXBElement<MultiTextPreferenceInput>(
new QName("multi-text-parameter-input"),
MultiTextPreferenceInput.class,
input));
return pref;
} | class class_name[name] begin[{]
method[createMultiTextPreference, return_type[type[Preference]], modifier[public static], parameter[name, label, displayType, defaultValues]] begin[{]
local_variable[type[MultiTextPreferenceInput], input]
call[input.getDefaults, parameter[]]
call[input.setDisplay, parameter[member[.displayType]]]
local_variable[type[Preference], pref]
call[pref.setName, parameter[member[.name]]]
call[pref.setLabel, parameter[member[.label]]]
call[pref.setPreferenceInput, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="multi-text-parameter-input")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultiTextPreferenceInput, sub_type=None)), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MultiTextPreferenceInput, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]]
return[member[.pref]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Preference] identifier[createMultiTextPreference] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[label] , identifier[TextDisplay] identifier[displayType] , identifier[List] operator[<] identifier[String] operator[>] identifier[defaultValues] operator[SEP] {
identifier[MultiTextPreferenceInput] identifier[input] operator[=] Keyword[new] identifier[MultiTextPreferenceInput] operator[SEP] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[getDefaults] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[defaultValues] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[setDisplay] operator[SEP] identifier[displayType] operator[SEP] operator[SEP] identifier[Preference] identifier[pref] operator[=] Keyword[new] identifier[Preference] operator[SEP] operator[SEP] operator[SEP] identifier[pref] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[pref] operator[SEP] identifier[setLabel] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[pref] operator[SEP] identifier[setPreferenceInput] operator[SEP] Keyword[new] identifier[JAXBElement] operator[<] identifier[MultiTextPreferenceInput] operator[>] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] operator[SEP] , identifier[MultiTextPreferenceInput] operator[SEP] Keyword[class] , identifier[input] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[pref] operator[SEP]
}
|
public boolean initSession(BranchReferralInitListener callback, Activity activity) {
if (customReferrableSettings_ == CUSTOM_REFERRABLE_SETTINGS.USE_DEFAULT) {
initUserSessionInternal(callback, activity, true);
} else {
boolean isReferrable = customReferrableSettings_ == CUSTOM_REFERRABLE_SETTINGS.REFERRABLE;
initUserSessionInternal(callback, activity, isReferrable);
}
return true;
} | class class_name[name] begin[{]
method[initSession, return_type[type[boolean]], modifier[public], parameter[callback, activity]] begin[{]
if[binary_operation[member[.customReferrableSettings_], ==, member[CUSTOM_REFERRABLE_SETTINGS.USE_DEFAULT]]] begin[{]
call[.initUserSessionInternal, parameter[member[.callback], member[.activity], literal[true]]]
else begin[{]
local_variable[type[boolean], isReferrable]
call[.initUserSessionInternal, parameter[member[.callback], member[.activity], member[.isReferrable]]]
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[initSession] operator[SEP] identifier[BranchReferralInitListener] identifier[callback] , identifier[Activity] identifier[activity] operator[SEP] {
Keyword[if] operator[SEP] identifier[customReferrableSettings_] operator[==] identifier[CUSTOM_REFERRABLE_SETTINGS] operator[SEP] identifier[USE_DEFAULT] operator[SEP] {
identifier[initUserSessionInternal] operator[SEP] identifier[callback] , identifier[activity] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[boolean] identifier[isReferrable] operator[=] identifier[customReferrableSettings_] operator[==] identifier[CUSTOM_REFERRABLE_SETTINGS] operator[SEP] identifier[REFERRABLE] operator[SEP] identifier[initUserSessionInternal] operator[SEP] identifier[callback] , identifier[activity] , identifier[isReferrable] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static <T> Func1<Iterable<T>, SolidList<T>> toSolidList(final int initialCapacity) {
return new Func1<Iterable<T>, SolidList<T>>() {
@Override
public SolidList<T> call(Iterable<T> iterable) {
ArrayList<T> list = new ArrayList<>(initialCapacity);
for (T value : iterable)
list.add(value);
return new SolidList<>(list);
}
};
} | class class_name[name] begin[{]
method[toSolidList, return_type[type[Func1]], modifier[public static], parameter[initialCapacity]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=initialCapacity, 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=ArrayList, sub_type=None)), name=list)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=list, 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=SolidList, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=iterable, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Iterable, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=SolidList, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Iterable, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=SolidList, sub_type=None))], dimensions=None, name=Func1, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Func1] operator[<] identifier[Iterable] operator[<] identifier[T] operator[>] , identifier[SolidList] operator[<] identifier[T] operator[>] operator[>] identifier[toSolidList] operator[SEP] Keyword[final] Keyword[int] identifier[initialCapacity] operator[SEP] {
Keyword[return] Keyword[new] identifier[Func1] operator[<] identifier[Iterable] operator[<] identifier[T] operator[>] , identifier[SolidList] operator[<] identifier[T] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[SolidList] operator[<] identifier[T] operator[>] identifier[call] operator[SEP] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[iterable] operator[SEP] {
identifier[ArrayList] operator[<] identifier[T] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[initialCapacity] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[T] identifier[value] operator[:] identifier[iterable] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SolidList] operator[<] operator[>] operator[SEP] identifier[list] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public Object put(Object name, Object value)
{
return super.put(name,LazyList.add(null,value));
} | class class_name[name] begin[{]
method[put, return_type[type[Object]], modifier[public], parameter[name, value]] begin[{]
return[SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=LazyList, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[put] operator[SEP] identifier[Object] identifier[name] , identifier[Object] identifier[value] operator[SEP] {
Keyword[return] Keyword[super] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[LazyList] operator[SEP] identifier[add] operator[SEP] Other[null] , identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
|
public Response deleteOutcast(String roomName, String jid) {
return restClient.delete("chatrooms/" + roomName + "/outcasts/" + jid,
new HashMap<String, String>());
} | class class_name[name] begin[{]
method[deleteOutcast, return_type[type[Response]], modifier[public], parameter[roomName, jid]] begin[{]
return[call[restClient.delete, parameter[binary_operation[binary_operation[binary_operation[literal["chatrooms/"], +, member[.roomName]], +, literal["/outcasts/"]], +, member[.jid]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Response] identifier[deleteOutcast] operator[SEP] identifier[String] identifier[roomName] , identifier[String] identifier[jid] operator[SEP] {
Keyword[return] identifier[restClient] operator[SEP] identifier[delete] operator[SEP] literal[String] operator[+] identifier[roomName] operator[+] literal[String] operator[+] identifier[jid] , Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void registerObjectRead(Object obj, int handle, boolean unshared) throws IOException {
if (unshared) {
obj = UNSHARED_OBJ;
}
int index = handle - ObjectStreamConstants.baseWireHandle;
int size = objectsRead.size();
// ObjectOutputStream sometimes wastes a handle. I've compared hex dumps of the RI
// and it seems like that's a 'feature'. Look for calls to objectsWritten.put that
// are guarded by !unshared tests.
while (index > size) {
objectsRead.add(null);
++size;
}
if (index == size) {
objectsRead.add(obj);
} else {
objectsRead.set(index, obj);
}
} | class class_name[name] begin[{]
method[registerObjectRead, return_type[void], modifier[private], parameter[obj, handle, unshared]] begin[{]
if[member[.unshared]] begin[{]
assign[member[.obj], member[.UNSHARED_OBJ]]
else begin[{]
None
end[}]
local_variable[type[int], index]
local_variable[type[int], size]
while[binary_operation[member[.index], >, member[.size]]] begin[{]
call[objectsRead.add, parameter[literal[null]]]
member[.size]
end[}]
if[binary_operation[member[.index], ==, member[.size]]] begin[{]
call[objectsRead.add, parameter[member[.obj]]]
else begin[{]
call[objectsRead.set, parameter[member[.index], member[.obj]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[registerObjectRead] operator[SEP] identifier[Object] identifier[obj] , Keyword[int] identifier[handle] , Keyword[boolean] identifier[unshared] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[unshared] operator[SEP] {
identifier[obj] operator[=] identifier[UNSHARED_OBJ] operator[SEP]
}
Keyword[int] identifier[index] operator[=] identifier[handle] operator[-] identifier[ObjectStreamConstants] operator[SEP] identifier[baseWireHandle] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[objectsRead] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[index] operator[>] identifier[size] operator[SEP] {
identifier[objectsRead] operator[SEP] identifier[add] operator[SEP] Other[null] operator[SEP] operator[SEP] operator[++] identifier[size] operator[SEP]
}
Keyword[if] operator[SEP] identifier[index] operator[==] identifier[size] operator[SEP] {
identifier[objectsRead] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[objectsRead] operator[SEP] identifier[set] operator[SEP] identifier[index] , identifier[obj] operator[SEP] operator[SEP]
}
}
|
public static <T> T queryScalar(String sql, Class<T> scalarType, Object[] params)
throws SQLStatementNotFoundException, YankSQLException {
return queryScalar(YankPoolManager.DEFAULT_POOL_NAME, sql, scalarType, params);
} | class class_name[name] begin[{]
method[queryScalar, return_type[type[T]], modifier[public static], parameter[sql, scalarType, params]] begin[{]
return[call[.queryScalar, parameter[member[YankPoolManager.DEFAULT_POOL_NAME], member[.sql], member[.scalarType], member[.params]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[queryScalar] operator[SEP] identifier[String] identifier[sql] , identifier[Class] operator[<] identifier[T] operator[>] identifier[scalarType] , identifier[Object] operator[SEP] operator[SEP] identifier[params] operator[SEP] Keyword[throws] identifier[SQLStatementNotFoundException] , identifier[YankSQLException] {
Keyword[return] identifier[queryScalar] operator[SEP] identifier[YankPoolManager] operator[SEP] identifier[DEFAULT_POOL_NAME] , identifier[sql] , identifier[scalarType] , identifier[params] operator[SEP] operator[SEP]
}
|
public long count(double minX, double minY, double maxX, double maxY) {
return query(minX, minY, maxX, maxY).count();
} | class class_name[name] begin[{]
method[count, return_type[type[long]], modifier[public], parameter[minX, minY, maxX, maxY]] begin[{]
return[call[.query, parameter[member[.minX], member[.minY], member[.maxX], member[.maxY]]]]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[count] operator[SEP] Keyword[double] identifier[minX] , Keyword[double] identifier[minY] , Keyword[double] identifier[maxX] , Keyword[double] identifier[maxY] operator[SEP] {
Keyword[return] identifier[query] operator[SEP] identifier[minX] , identifier[minY] , identifier[maxX] , identifier[maxY] operator[SEP] operator[SEP] identifier[count] operator[SEP] operator[SEP] operator[SEP]
}
|
private O setResources(ResourceSpec resources) {
Preconditions.checkNotNull(resources, "The resources must be not null.");
Preconditions.checkArgument(resources.isValid(), "The values in resources must be not less than 0.");
this.minResources = resources;
this.preferredResources = resources;
@SuppressWarnings("unchecked")
O returnType = (O) this;
return returnType;
} | class class_name[name] begin[{]
method[setResources, return_type[type[O]], modifier[private], parameter[resources]] begin[{]
call[Preconditions.checkNotNull, parameter[member[.resources], literal["The resources must be not null."]]]
call[Preconditions.checkArgument, parameter[call[resources.isValid, parameter[]], literal["The values in resources must be not less than 0."]]]
assign[THIS[member[None.minResources]], member[.resources]]
assign[THIS[member[None.preferredResources]], member[.resources]]
local_variable[type[O], returnType]
return[member[.returnType]]
end[}]
END[}] | Keyword[private] identifier[O] identifier[setResources] operator[SEP] identifier[ResourceSpec] identifier[resources] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[resources] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[resources] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[minResources] operator[=] identifier[resources] operator[SEP] Keyword[this] operator[SEP] identifier[preferredResources] operator[=] identifier[resources] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[O] identifier[returnType] operator[=] operator[SEP] identifier[O] operator[SEP] Keyword[this] operator[SEP] Keyword[return] identifier[returnType] operator[SEP]
}
|
public EClass getIfcCurvatureMeasure() {
if (ifcCurvatureMeasureEClass == null) {
ifcCurvatureMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(662);
}
return ifcCurvatureMeasureEClass;
} | class class_name[name] begin[{]
method[getIfcCurvatureMeasure, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcCurvatureMeasureEClass], ==, literal[null]]] begin[{]
assign[member[.ifcCurvatureMeasureEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=662)], 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[.ifcCurvatureMeasureEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIfcCurvatureMeasure] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcCurvatureMeasureEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcCurvatureMeasureEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[662] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcCurvatureMeasureEClass] operator[SEP]
}
|
public void autoLoad() throws IOException
{
// Try load the file from beside jcseg-core-{version}.jar.
File proFile = new File(Util.getJarHome(this)+"/"+LEX_PROPERTY_FILE);
if ( proFile.exists() ) {
pFile = proFile.getAbsolutePath();
load(proFile.getAbsolutePath());
return;
}
// Search root classpath, if didn't copy to classpath manually, then will found & use the one inside jcseg-core-{version}.jar.
InputStream is = this.getClass().getResourceAsStream("/"+LEX_PROPERTY_FILE);
if ( is != null ) {
pFile = "classpath/jcseg.properties";
load(is);
return;
}
// Load from system property "user.home".
proFile = new File(System.getProperty("user.home")+"/"+LEX_PROPERTY_FILE);
if ( proFile.exists() ) {
pFile = proFile.getAbsolutePath();
load(proFile.getAbsolutePath());
}
/*
* jcseg properties file loading status report,
* show the crorrent properties file location information
*
* @date 2013-07-06
*/
String errString = "jcseg properties \"jcseg.properties]\" file auto loaded failed: \n";
errString += "try the follwing ways to solve the problem: \n";
errString += "1. put jcseg.properties into the classpath.\n";
errString += "2. put jcseg.properties together with the jcseg-core-{version}.jar file.\n";
errString += "3. put jcseg.properties in directory "+System.getProperty("user.home")+"\n\n";
throw new IOException(errString);
} | class class_name[name] begin[{]
method[autoLoad, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[File], proFile]
if[call[proFile.exists, parameter[]]] begin[{]
assign[member[.pFile], call[proFile.getAbsolutePath, parameter[]]]
call[.load, parameter[call[proFile.getAbsolutePath, parameter[]]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[InputStream], is]
if[binary_operation[member[.is], !=, literal[null]]] begin[{]
assign[member[.pFile], literal["classpath/jcseg.properties"]]
call[.load, parameter[member[.is]]]
return[None]
else begin[{]
None
end[}]
assign[member[.proFile], ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user.home")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=LEX_PROPERTY_FILE, 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=File, sub_type=None))]
if[call[proFile.exists, parameter[]]] begin[{]
assign[member[.pFile], call[proFile.getAbsolutePath, parameter[]]]
call[.load, parameter[call[proFile.getAbsolutePath, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[String], errString]
assign[member[.errString], literal["try the follwing ways to solve the problem: \n"]]
assign[member[.errString], literal["1. put jcseg.properties into the classpath.\n"]]
assign[member[.errString], literal["2. put jcseg.properties together with the jcseg-core-{version}.jar file.\n"]]
assign[member[.errString], binary_operation[binary_operation[literal["3. put jcseg.properties in directory "], +, call[System.getProperty, parameter[literal["user.home"]]]], +, literal["\n\n"]]]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errString, 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)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[autoLoad] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[File] identifier[proFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[Util] operator[SEP] identifier[getJarHome] operator[SEP] Keyword[this] operator[SEP] operator[+] literal[String] operator[+] identifier[LEX_PROPERTY_FILE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[pFile] operator[=] identifier[proFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[load] operator[SEP] identifier[proFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[InputStream] identifier[is] operator[=] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] literal[String] operator[+] identifier[LEX_PROPERTY_FILE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[is] operator[!=] Other[null] operator[SEP] {
identifier[pFile] operator[=] literal[String] operator[SEP] identifier[load] operator[SEP] identifier[is] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[proFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[LEX_PROPERTY_FILE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[pFile] operator[=] identifier[proFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[load] operator[SEP] identifier[proFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[errString] operator[=] literal[String] operator[SEP] identifier[errString] operator[+=] literal[String] operator[SEP] identifier[errString] operator[+=] literal[String] operator[SEP] identifier[errString] operator[+=] literal[String] operator[SEP] identifier[errString] operator[+=] literal[String] operator[+] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[errString] operator[SEP] operator[SEP]
}
|
@Override
public boolean promptRequiredMissingValues(ShellImpl shell) throws InterruptedException
{
Map<String, InputComponent<?, ?>> inputs = getController().getInputs();
if (hasMissingRequiredInputValues(inputs.values()))
{
UIOutput output = shell.getOutput();
if (!getContext().isInteractive())
{
output.error(output.out(), NON_INTERACTIVE_MODE_MESSAGE);
return false;
}
output.info(output.out(), INTERACTIVE_MODE_MESSAGE);
promptRequiredMissingValues(shell, inputs.values());
}
return true;
} | class class_name[name] begin[{]
method[promptRequiredMissingValues, return_type[type[boolean]], modifier[public], parameter[shell]] begin[{]
local_variable[type[Map], inputs]
if[call[.hasMissingRequiredInputValues, parameter[call[inputs.values, parameter[]]]]] begin[{]
local_variable[type[UIOutput], output]
if[call[.getContext, parameter[]]] begin[{]
call[output.error, parameter[call[output.out, parameter[]], member[.NON_INTERACTIVE_MODE_MESSAGE]]]
return[literal[false]]
else begin[{]
None
end[}]
call[output.info, parameter[call[output.out, parameter[]], member[.INTERACTIVE_MODE_MESSAGE]]]
call[.promptRequiredMissingValues, parameter[member[.shell], call[inputs.values, parameter[]]]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[promptRequiredMissingValues] operator[SEP] identifier[ShellImpl] identifier[shell] operator[SEP] Keyword[throws] identifier[InterruptedException] {
identifier[Map] operator[<] identifier[String] , identifier[InputComponent] operator[<] operator[?] , operator[?] operator[>] operator[>] identifier[inputs] operator[=] identifier[getController] operator[SEP] operator[SEP] operator[SEP] identifier[getInputs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasMissingRequiredInputValues] operator[SEP] identifier[inputs] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[UIOutput] identifier[output] operator[=] identifier[shell] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[isInteractive] operator[SEP] operator[SEP] operator[SEP] {
identifier[output] operator[SEP] identifier[error] operator[SEP] identifier[output] operator[SEP] identifier[out] operator[SEP] operator[SEP] , identifier[NON_INTERACTIVE_MODE_MESSAGE] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[output] operator[SEP] identifier[info] operator[SEP] identifier[output] operator[SEP] identifier[out] operator[SEP] operator[SEP] , identifier[INTERACTIVE_MODE_MESSAGE] operator[SEP] operator[SEP] identifier[promptRequiredMissingValues] operator[SEP] identifier[shell] , identifier[inputs] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public ContainerDefinition withVolumesFrom(VolumeFrom... volumesFrom) {
if (this.volumesFrom == null) {
setVolumesFrom(new com.amazonaws.internal.SdkInternalList<VolumeFrom>(volumesFrom.length));
}
for (VolumeFrom ele : volumesFrom) {
this.volumesFrom.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withVolumesFrom, return_type[type[ContainerDefinition]], modifier[public], parameter[volumesFrom]] begin[{]
if[binary_operation[THIS[member[None.volumesFrom]], ==, literal[null]]] begin[{]
call[.setVolumesFrom, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=volumesFrom, 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=VolumeFrom, 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=volumesFrom, 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=volumesFrom, 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=VolumeFrom, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ContainerDefinition] identifier[withVolumesFrom] operator[SEP] identifier[VolumeFrom] operator[...] identifier[volumesFrom] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[volumesFrom] operator[==] Other[null] operator[SEP] {
identifier[setVolumesFrom] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[VolumeFrom] operator[>] operator[SEP] identifier[volumesFrom] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[VolumeFrom] identifier[ele] operator[:] identifier[volumesFrom] operator[SEP] {
Keyword[this] operator[SEP] identifier[volumesFrom] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public OvhOvhAccount ovhAccount_ovhAccountId_GET(String ovhAccountId) throws IOException {
String qPath = "/me/ovhAccount/{ovhAccountId}";
StringBuilder sb = path(qPath, ovhAccountId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOvhAccount.class);
} | class class_name[name] begin[{]
method[ovhAccount_ovhAccountId_GET, return_type[type[OvhOvhAccount]], modifier[public], parameter[ovhAccountId]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOvhAccount, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhOvhAccount] identifier[ovhAccount_ovhAccountId_GET] operator[SEP] identifier[String] identifier[ovhAccountId] 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[ovhAccountId] 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[OvhOvhAccount] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public Map<CategoryId, Category> getCategories() {
Map<CategoryId, Category> map = new HashMap<>();
for (Rule rule : getAllRules()) {
map.put(rule.getCategory().getId(), rule.getCategory());
}
return map;
} | class class_name[name] begin[{]
method[getCategories, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], map]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCategory, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[MethodInvocation(arguments=[], member=getId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getCategory, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAllRules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Rule, sub_type=None))), label=None)
return[member[.map]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[CategoryId] , identifier[Category] operator[>] identifier[getCategories] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[CategoryId] , identifier[Category] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Rule] identifier[rule] operator[:] identifier[getAllRules] operator[SEP] operator[SEP] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[rule] operator[SEP] identifier[getCategory] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[rule] operator[SEP] identifier[getCategory] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[map] operator[SEP]
}
|
public List<ModuleRef> getModules() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final List<ModuleRef> moduleRefs = new ArrayList<>();
for (final ClasspathElement classpathElement : classpathOrder) {
if (classpathElement instanceof ClasspathElementModule) {
moduleRefs.add(((ClasspathElementModule) classpathElement).getModuleRef());
}
}
return moduleRefs;
} | class class_name[name] begin[{]
method[getModules, return_type[type[List]], modifier[public], parameter[]] begin[{]
if[call[closed.get, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot use a ScanResult after it has been closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[List], moduleRefs]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=classpathElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ClasspathElementModule, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=classpathElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ClasspathElementModule, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=moduleRefs, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=classpathOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classpathElement)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ClasspathElement, sub_type=None))), label=None)
return[member[.moduleRefs]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[ModuleRef] operator[>] identifier[getModules] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[closed] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[List] operator[<] identifier[ModuleRef] operator[>] identifier[moduleRefs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ClasspathElement] identifier[classpathElement] operator[:] identifier[classpathOrder] operator[SEP] {
Keyword[if] operator[SEP] identifier[classpathElement] Keyword[instanceof] identifier[ClasspathElementModule] operator[SEP] {
identifier[moduleRefs] operator[SEP] identifier[add] operator[SEP] operator[SEP] operator[SEP] identifier[ClasspathElementModule] operator[SEP] identifier[classpathElement] operator[SEP] operator[SEP] identifier[getModuleRef] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[moduleRefs] operator[SEP]
}
|
public void addTangoChangeListener(ITangoChangeListener listener, String attrName, boolean stateless)
throws DevFailed {
addTangoChangeListener(listener, attrName, new String[0], stateless);
} | class class_name[name] begin[{]
method[addTangoChangeListener, return_type[void], modifier[public], parameter[listener, attrName, stateless]] begin[{]
call[.addTangoChangeListener, parameter[member[.listener], member[.attrName], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), member[.stateless]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addTangoChangeListener] operator[SEP] identifier[ITangoChangeListener] identifier[listener] , identifier[String] identifier[attrName] , Keyword[boolean] identifier[stateless] operator[SEP] Keyword[throws] identifier[DevFailed] {
identifier[addTangoChangeListener] operator[SEP] identifier[listener] , identifier[attrName] , Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] , identifier[stateless] operator[SEP] operator[SEP]
}
|
public void addUnrestoredMsgId(long msgId)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addUnrestoredMsgId", new Long(msgId));
unrestoredMsgIds.add(new Long(msgId));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addUnrestoredMsgId");
} | class class_name[name] begin[{]
method[addUnrestoredMsgId, return_type[void], modifier[public], parameter[msgId]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["addUnrestoredMsgId"], ClassCreator(arguments=[MemberReference(member=msgId, 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=Long, sub_type=None))]]
else begin[{]
None
end[}]
call[unrestoredMsgIds.add, parameter[ClassCreator(arguments=[MemberReference(member=msgId, 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=Long, sub_type=None))]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["addUnrestoredMsgId"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addUnrestoredMsgId] operator[SEP] Keyword[long] identifier[msgId] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Long] operator[SEP] identifier[msgId] operator[SEP] operator[SEP] operator[SEP] identifier[unrestoredMsgIds] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Long] operator[SEP] identifier[msgId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public void addLocatorReference(String locatorReference, By locator) {
Map<String, By> objectReferenceMap = getObjectReferenceMap(By.class);
objectReferenceMap.put(locatorReference, locator);
} | class class_name[name] begin[{]
method[addLocatorReference, return_type[void], modifier[public], parameter[locatorReference, locator]] begin[{]
local_variable[type[Map], objectReferenceMap]
call[objectReferenceMap.put, parameter[member[.locatorReference], member[.locator]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addLocatorReference] operator[SEP] identifier[String] identifier[locatorReference] , identifier[By] identifier[locator] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[By] operator[>] identifier[objectReferenceMap] operator[=] identifier[getObjectReferenceMap] operator[SEP] identifier[By] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[objectReferenceMap] operator[SEP] identifier[put] operator[SEP] identifier[locatorReference] , identifier[locator] operator[SEP] operator[SEP]
}
|
public void add(Block key, Block value, int keyPosition, int valuePosition)
{
if (!keyExists(key, keyPosition)) {
addKey(key, keyPosition);
if (value.isNull(valuePosition)) {
valueBlockBuilder.appendNull();
}
else {
valueType.appendTo(value, valuePosition, valueBlockBuilder);
}
}
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[public], parameter[key, value, keyPosition, valuePosition]] begin[{]
if[call[.keyExists, parameter[member[.key], member[.keyPosition]]]] begin[{]
call[.addKey, parameter[member[.key], member[.keyPosition]]]
if[call[value.isNull, parameter[member[.valuePosition]]]] begin[{]
call[valueBlockBuilder.appendNull, parameter[]]
else begin[{]
call[valueType.appendTo, parameter[member[.value], member[.valuePosition], member[.valueBlockBuilder]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[Block] identifier[key] , identifier[Block] identifier[value] , Keyword[int] identifier[keyPosition] , Keyword[int] identifier[valuePosition] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[keyExists] operator[SEP] identifier[key] , identifier[keyPosition] operator[SEP] operator[SEP] {
identifier[addKey] operator[SEP] identifier[key] , identifier[keyPosition] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[isNull] operator[SEP] identifier[valuePosition] operator[SEP] operator[SEP] {
identifier[valueBlockBuilder] operator[SEP] identifier[appendNull] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[valueType] operator[SEP] identifier[appendTo] operator[SEP] identifier[value] , identifier[valuePosition] , identifier[valueBlockBuilder] operator[SEP] operator[SEP]
}
}
}
|
@Override
public String interpret(String property)
{
try
{
property = Cryption.interpret(property);
if(property != null && property.indexOf(Styles.DEFAULT_PREFIX) > -1)
{
property = Text.format(property,this.getProperties());
}
}
catch (FormatException e)
{
throw new ConfigException("Format exception for \""+property+"\"",e);
}
return Cryption.interpret(property);
} | class class_name[name] begin[{]
method[interpret, return_type[type[String]], modifier[public], parameter[property]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=interpret, postfix_operators=[], prefix_operators=[], qualifier=Cryption, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=DEFAULT_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=Styles, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getProperties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=format, postfix_operators=[], prefix_operators=[], qualifier=Text, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Format exception for \""), operandr=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FormatException']))], finally_block=None, label=None, resources=None)
return[call[Cryption.interpret, parameter[member[.property]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[interpret] operator[SEP] identifier[String] identifier[property] operator[SEP] {
Keyword[try] {
identifier[property] operator[=] identifier[Cryption] operator[SEP] identifier[interpret] operator[SEP] identifier[property] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[!=] Other[null] operator[&&] identifier[property] operator[SEP] identifier[indexOf] operator[SEP] identifier[Styles] operator[SEP] identifier[DEFAULT_PREFIX] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[property] operator[=] identifier[Text] operator[SEP] identifier[format] operator[SEP] identifier[property] , Keyword[this] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[FormatException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] literal[String] operator[+] identifier[property] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Cryption] operator[SEP] identifier[interpret] operator[SEP] identifier[property] operator[SEP] operator[SEP]
}
|
public Set<IntEntry<V>> intEntrySet ()
{
return new AbstractSet<IntEntry<V>>() {
@Override public int size () {
return _size;
}
@Override public Iterator<IntEntry<V>> iterator () {
return new IntEntryIterator();
}
};
} | class class_name[name] begin[{]
method[intEntrySet, return_type[type[Set]], modifier[public], parameter[]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=size, parameters=[], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntEntryIterator, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=iterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=IntEntry, sub_type=None))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=IntEntry, sub_type=None))], dimensions=None, name=AbstractSet, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Set] operator[<] identifier[IntEntry] operator[<] identifier[V] operator[>] operator[>] identifier[intEntrySet] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[AbstractSet] operator[<] identifier[IntEntry] operator[<] identifier[V] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[size] operator[SEP] operator[SEP] {
Keyword[return] identifier[_size] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[IntEntry] operator[<] identifier[V] operator[>] operator[>] identifier[iterator] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[IntEntryIterator] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public HttpHeaders setBasicAuthentication(String username, String password) {
String userPass =
Preconditions.checkNotNull(username) + ":" + Preconditions.checkNotNull(password);
String encoded = Base64.encodeBase64String(StringUtils.getBytesUtf8(userPass));
return setAuthorization("Basic " + encoded);
} | class class_name[name] begin[{]
method[setBasicAuthentication, return_type[type[HttpHeaders]], modifier[public], parameter[username, password]] begin[{]
local_variable[type[String], userPass]
local_variable[type[String], encoded]
return[call[.setAuthorization, parameter[binary_operation[literal["Basic "], +, member[.encoded]]]]]
end[}]
END[}] | Keyword[public] identifier[HttpHeaders] identifier[setBasicAuthentication] operator[SEP] identifier[String] identifier[username] , identifier[String] identifier[password] operator[SEP] {
identifier[String] identifier[userPass] operator[=] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[username] operator[SEP] operator[+] literal[String] operator[+] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[password] operator[SEP] operator[SEP] identifier[String] identifier[encoded] operator[=] identifier[Base64] operator[SEP] identifier[encodeBase64String] operator[SEP] identifier[StringUtils] operator[SEP] identifier[getBytesUtf8] operator[SEP] identifier[userPass] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[setAuthorization] operator[SEP] literal[String] operator[+] identifier[encoded] operator[SEP] operator[SEP]
}
|
@Override
public void dissect(final Parsable<?> parsable, final String inputname) throws DissectionFailure {
final ParsedField field = parsable.getParsableField(INPUT_TYPE, inputname);
final String fieldValue = field.getValue().getString();
if (fieldValue == null || fieldValue.isEmpty() || "-".equals(fieldValue)){
return; // Nothing to do here
}
String[] protocol = fieldValue.split("/", 2);
if (protocol.length == 2) {
outputDissection(parsable, inputname, "HTTP.PROTOCOL", "", protocol[0]);
outputDissection(parsable, inputname, "HTTP.PROTOCOL.VERSION", "version", protocol[1]);
return;
}
// In the scenario that the actual URI is too long the last part ("HTTP/1.1") may have been cut off by the
// Apache HTTPD webserver. To still be able to parse these we try that pattern too
parsable.addDissection(inputname, "HTTP.PROTOCOL", "", (String) null);
parsable.addDissection(inputname, "HTTP.PROTOCOL.VERSION", "version", (String) null);
} | class class_name[name] begin[{]
method[dissect, return_type[void], modifier[public], parameter[parsable, inputname]] begin[{]
local_variable[type[ParsedField], field]
local_variable[type[String], fieldValue]
if[binary_operation[binary_operation[binary_operation[member[.fieldValue], ==, literal[null]], ||, call[fieldValue.isEmpty, parameter[]]], ||, literal["-"]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[String], protocol]
if[binary_operation[member[protocol.length], ==, literal[2]]] begin[{]
call[.outputDissection, parameter[member[.parsable], member[.inputname], literal["HTTP.PROTOCOL"], literal[""], member[.protocol]]]
call[.outputDissection, parameter[member[.parsable], member[.inputname], literal["HTTP.PROTOCOL.VERSION"], literal["version"], member[.protocol]]]
return[None]
else begin[{]
None
end[}]
call[parsable.addDissection, parameter[member[.inputname], literal["HTTP.PROTOCOL"], literal[""], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]
call[parsable.addDissection, parameter[member[.inputname], literal["HTTP.PROTOCOL.VERSION"], literal["version"], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[dissect] operator[SEP] Keyword[final] identifier[Parsable] operator[<] operator[?] operator[>] identifier[parsable] , Keyword[final] identifier[String] identifier[inputname] operator[SEP] Keyword[throws] identifier[DissectionFailure] {
Keyword[final] identifier[ParsedField] identifier[field] operator[=] identifier[parsable] operator[SEP] identifier[getParsableField] operator[SEP] identifier[INPUT_TYPE] , identifier[inputname] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[fieldValue] operator[=] identifier[field] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldValue] operator[==] Other[null] operator[||] identifier[fieldValue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[fieldValue] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[protocol] operator[=] identifier[fieldValue] operator[SEP] identifier[split] operator[SEP] literal[String] , Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[protocol] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] {
identifier[outputDissection] operator[SEP] identifier[parsable] , identifier[inputname] , literal[String] , literal[String] , identifier[protocol] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[outputDissection] operator[SEP] identifier[parsable] , identifier[inputname] , literal[String] , literal[String] , identifier[protocol] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[parsable] operator[SEP] identifier[addDissection] operator[SEP] identifier[inputname] , literal[String] , literal[String] , operator[SEP] identifier[String] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[parsable] operator[SEP] identifier[addDissection] operator[SEP] identifier[inputname] , literal[String] , literal[String] , operator[SEP] identifier[String] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
|
public MessageListResult v2GetMessageList(int count, String begin_time, String end_time)
throws APIConnectionException, APIRequestException {
if(count <= 0 || count > 1000) {
throw new IllegalArgumentException("count must more than 0 and less than 1001");
}
String requestUrl = mBaseReportPath + mV2MessagePath + "?count=" + count;
String beginEncoded = null;
String endEncoded = null;
if (null != begin_time && StringUtils.isNotEmpty(begin_time) && null != end_time
&& StringUtils.isNotEmpty(end_time)) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date beginDate = format.parse(begin_time);
Date endDate = format.parse(end_time);
if (endDate.getTime() - beginDate.getTime() < 0) {
throw new IllegalArgumentException("end time must lager than begin time");
} else if (endDate.getTime() - beginDate.getTime() > 7 * 24 * 60 * 60 * 1000) {
throw new IllegalArgumentException("end time lager than begin time over 7 days");
}
} catch (ParseException e) {
e.printStackTrace();
}
try {
beginEncoded = URLEncoder.encode(begin_time, "utf-8");
endEncoded = URLEncoder.encode(end_time, "utf-8");
} catch (Exception e) {
e.printStackTrace();
}
requestUrl = requestUrl + "&begin_time=" + beginEncoded + "&end_time=" + endEncoded;
} else {
throw new IllegalArgumentException("begin time or end time is null or empty");
}
ResponseWrapper response = _httpClient.sendGet(requestUrl);
return MessageListResult.fromResponse(response, MessageListResult.class);
} | class class_name[name] begin[{]
method[v2GetMessageList, return_type[type[MessageListResult]], modifier[public], parameter[count, begin_time, end_time]] begin[{]
if[binary_operation[binary_operation[member[.count], <=, literal[0]], ||, binary_operation[member[.count], >, literal[1000]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="count must more than 0 and less than 1001")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], requestUrl]
local_variable[type[String], beginEncoded]
local_variable[type[String], endEncoded]
if[binary_operation[binary_operation[binary_operation[binary_operation[literal[null], !=, member[.begin_time]], &&, call[StringUtils.isNotEmpty, parameter[member[.begin_time]]]], &&, binary_operation[literal[null], !=, member[.end_time]]], &&, call[StringUtils.isNotEmpty, parameter[member[.end_time]]]]] begin[{]
local_variable[type[DateFormat], format]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=begin_time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), name=beginDate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=end_time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), name=endDate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=endDate, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=beginDate, selectors=[], type_arguments=None), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=endDate, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=beginDate, selectors=[], type_arguments=None), operator=-), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=*), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="end time lager than begin time over 7 days")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="end time must lager than begin time")], 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)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=beginEncoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=begin_time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="utf-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=endEncoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=end_time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="utf-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
assign[member[.requestUrl], binary_operation[binary_operation[binary_operation[binary_operation[member[.requestUrl], +, literal["&begin_time="]], +, member[.beginEncoded]], +, literal["&end_time="]], +, member[.endEncoded]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="begin time or end time is null or 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)
end[}]
local_variable[type[ResponseWrapper], response]
return[call[MessageListResult.fromResponse, parameter[member[.response], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MessageListResult, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[MessageListResult] identifier[v2GetMessageList] operator[SEP] Keyword[int] identifier[count] , identifier[String] identifier[begin_time] , identifier[String] identifier[end_time] operator[SEP] Keyword[throws] identifier[APIConnectionException] , identifier[APIRequestException] {
Keyword[if] operator[SEP] identifier[count] operator[<=] Other[0] operator[||] identifier[count] operator[>] Other[1000] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[requestUrl] operator[=] identifier[mBaseReportPath] operator[+] identifier[mV2MessagePath] operator[+] literal[String] operator[+] identifier[count] operator[SEP] identifier[String] identifier[beginEncoded] operator[=] Other[null] operator[SEP] identifier[String] identifier[endEncoded] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[begin_time] operator[&&] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[begin_time] operator[SEP] operator[&&] Other[null] operator[!=] identifier[end_time] operator[&&] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[end_time] operator[SEP] operator[SEP] {
identifier[DateFormat] identifier[format] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] {
identifier[Date] identifier[beginDate] operator[=] identifier[format] operator[SEP] identifier[parse] operator[SEP] identifier[begin_time] operator[SEP] operator[SEP] identifier[Date] identifier[endDate] operator[=] identifier[format] operator[SEP] identifier[parse] operator[SEP] identifier[end_time] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[-] identifier[beginDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[endDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[-] identifier[beginDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[>] Other[7] operator[*] Other[24] operator[*] Other[60] operator[*] Other[60] operator[*] Other[1000] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[beginEncoded] operator[=] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[begin_time] , literal[String] operator[SEP] operator[SEP] identifier[endEncoded] operator[=] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[end_time] , literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
identifier[requestUrl] operator[=] identifier[requestUrl] operator[+] literal[String] operator[+] identifier[beginEncoded] operator[+] literal[String] operator[+] identifier[endEncoded] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[ResponseWrapper] identifier[response] operator[=] identifier[_httpClient] operator[SEP] identifier[sendGet] operator[SEP] identifier[requestUrl] operator[SEP] operator[SEP] Keyword[return] identifier[MessageListResult] operator[SEP] identifier[fromResponse] operator[SEP] identifier[response] , identifier[MessageListResult] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
protected ResultSetMapper createResultSetMapper(final ResultSet resultSet) {
final Map<String, ColumnData> columnAliases = sqlgen != null ? sqlgen.getColumnData() : null;
return new DefaultResultSetMapper(dbOom, resultSet, columnAliases, cacheEntities, this);
} | class class_name[name] begin[{]
method[createResultSetMapper, return_type[type[ResultSetMapper]], modifier[protected], parameter[resultSet]] begin[{]
local_variable[type[Map], columnAliases]
return[ClassCreator(arguments=[MemberReference(member=dbOom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resultSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnAliases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cacheEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultResultSetMapper, sub_type=None))]
end[}]
END[}] | Keyword[protected] identifier[ResultSetMapper] identifier[createResultSetMapper] operator[SEP] Keyword[final] identifier[ResultSet] identifier[resultSet] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[ColumnData] operator[>] identifier[columnAliases] operator[=] identifier[sqlgen] operator[!=] Other[null] operator[?] identifier[sqlgen] operator[SEP] identifier[getColumnData] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[DefaultResultSetMapper] operator[SEP] identifier[dbOom] , identifier[resultSet] , identifier[columnAliases] , identifier[cacheEntities] , Keyword[this] operator[SEP] operator[SEP]
}
|
public static void convolve(Kernel2D_F32 kernel, GrayF32 image, GrayF32 dest , int skip ) {
checkParameters(image, dest, skip);
if( kernel.width >= image.width ) {
ConvolveDownNormalizedNaive.convolve(kernel,image,dest,skip);
} else {
ConvolveImageDownNoBorder.convolve(kernel,image,dest,skip);
ConvolveDownNormalized_JustBorder.convolve(kernel,image,dest,skip);
}
} | class class_name[name] begin[{]
method[convolve, return_type[void], modifier[public static], parameter[kernel, image, dest, skip]] begin[{]
call[.checkParameters, parameter[member[.image], member[.dest], member[.skip]]]
if[binary_operation[member[kernel.width], >=, member[image.width]]] begin[{]
call[ConvolveDownNormalizedNaive.convolve, parameter[member[.kernel], member[.image], member[.dest], member[.skip]]]
else begin[{]
call[ConvolveImageDownNoBorder.convolve, parameter[member[.kernel], member[.image], member[.dest], member[.skip]]]
call[ConvolveDownNormalized_JustBorder.convolve, parameter[member[.kernel], member[.image], member[.dest], member[.skip]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[convolve] operator[SEP] identifier[Kernel2D_F32] identifier[kernel] , identifier[GrayF32] identifier[image] , identifier[GrayF32] identifier[dest] , Keyword[int] identifier[skip] operator[SEP] {
identifier[checkParameters] operator[SEP] identifier[image] , identifier[dest] , identifier[skip] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[kernel] operator[SEP] identifier[width] operator[>=] identifier[image] operator[SEP] identifier[width] operator[SEP] {
identifier[ConvolveDownNormalizedNaive] operator[SEP] identifier[convolve] operator[SEP] identifier[kernel] , identifier[image] , identifier[dest] , identifier[skip] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ConvolveImageDownNoBorder] operator[SEP] identifier[convolve] operator[SEP] identifier[kernel] , identifier[image] , identifier[dest] , identifier[skip] operator[SEP] operator[SEP] identifier[ConvolveDownNormalized_JustBorder] operator[SEP] identifier[convolve] operator[SEP] identifier[kernel] , identifier[image] , identifier[dest] , identifier[skip] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public M with(final String key, final short value) {
validate(key, value);
data.putValue(key, value);
return (M) this;
} | class class_name[name] begin[{]
method[with, return_type[type[M]], modifier[public], parameter[key, value]] begin[{]
call[.validate, parameter[member[.key], member[.value]]]
call[data.putValue, parameter[member[.key], member[.value]]]
return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=M, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[M] identifier[with] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] Keyword[short] identifier[value] operator[SEP] {
identifier[validate] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[putValue] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[M] operator[SEP] Keyword[this] operator[SEP]
}
|
public static KeySet range(KeyRange range) {
return new KeySet(false, ImmutableList.<Key>of(), ImmutableList.of(range));
} | class class_name[name] begin[{]
method[range, return_type[type[KeySet]], modifier[public static], parameter[range]] begin[{]
return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MethodInvocation(arguments=[], member=ImmutableList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Key, sub_type=None))]), MethodInvocation(arguments=[MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableList, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KeySet, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[KeySet] identifier[range] operator[SEP] identifier[KeyRange] identifier[range] operator[SEP] {
Keyword[return] Keyword[new] identifier[KeySet] operator[SEP] literal[boolean] , identifier[ImmutableList] operator[SEP] operator[<] identifier[Key] operator[>] identifier[of] operator[SEP] operator[SEP] , identifier[ImmutableList] operator[SEP] identifier[of] operator[SEP] identifier[range] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void loadDefaultsFromMetadata(Context context) {
defaultsLoaded = true;
if (context == null) {
return;
}
ApplicationInfo ai = null;
try {
ai = context.getPackageManager().getApplicationInfo(
context.getPackageName(), PackageManager.GET_META_DATA);
} catch (PackageManager.NameNotFoundException e) {
return;
}
if (ai == null || ai.metaData == null) {
return;
}
if (applicationId == null) {
applicationId = ai.metaData.getString(APPLICATION_ID_PROPERTY);
}
if (appClientToken == null) {
appClientToken = ai.metaData.getString(CLIENT_TOKEN_PROPERTY);
}
} | class class_name[name] begin[{]
method[loadDefaultsFromMetadata, return_type[void], modifier[public static], parameter[context]] begin[{]
assign[member[.defaultsLoaded], literal[true]]
if[binary_operation[member[.context], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[ApplicationInfo], ai]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ai, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPackageManager, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MemberReference(member=GET_META_DATA, postfix_operators=[], prefix_operators=[], qualifier=PackageManager, selectors=[])], member=getApplicationInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PackageManager.NameNotFoundException']))], finally_block=None, label=None, resources=None)
if[binary_operation[binary_operation[member[.ai], ==, literal[null]], ||, binary_operation[member[ai.metaData], ==, literal[null]]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[binary_operation[member[.applicationId], ==, literal[null]]] begin[{]
assign[member[.applicationId], call[ai.metaData.getString, parameter[member[.APPLICATION_ID_PROPERTY]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.appClientToken], ==, literal[null]]] begin[{]
assign[member[.appClientToken], call[ai.metaData.getString, parameter[member[.CLIENT_TOKEN_PROPERTY]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[loadDefaultsFromMetadata] operator[SEP] identifier[Context] identifier[context] operator[SEP] {
identifier[defaultsLoaded] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[ApplicationInfo] identifier[ai] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[ai] operator[=] identifier[context] operator[SEP] identifier[getPackageManager] operator[SEP] operator[SEP] operator[SEP] identifier[getApplicationInfo] operator[SEP] identifier[context] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] , identifier[PackageManager] operator[SEP] identifier[GET_META_DATA] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[PackageManager] operator[SEP] identifier[NameNotFoundException] identifier[e] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ai] operator[==] Other[null] operator[||] identifier[ai] operator[SEP] identifier[metaData] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[applicationId] operator[==] Other[null] operator[SEP] {
identifier[applicationId] operator[=] identifier[ai] operator[SEP] identifier[metaData] operator[SEP] identifier[getString] operator[SEP] identifier[APPLICATION_ID_PROPERTY] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[appClientToken] operator[==] Other[null] operator[SEP] {
identifier[appClientToken] operator[=] identifier[ai] operator[SEP] identifier[metaData] operator[SEP] identifier[getString] operator[SEP] identifier[CLIENT_TOKEN_PROPERTY] operator[SEP] operator[SEP]
}
}
|
public String[] getPossibleTangoHosts(Database database) {
String[] tangoHosts = null;
try {
DeviceData deviceData = database.command_inout("DbGetCSDbServerList");
tangoHosts = deviceData.extractStringArray();
} catch (DevFailed e) {
String desc = e.errors[0].desc.toLowerCase();
try {
if (desc.startsWith("command ") && desc.endsWith("not found")) {
tangoHosts = new String[]{database.getFullTangoHost()};
} else
System.err.println(e.errors[0].desc);
} catch (DevFailed e2) {
System.err.println(e2.errors[0].desc);
}
}
return tangoHosts;
} | class class_name[name] begin[{]
method[getPossibleTangoHosts, return_type[type[String]], modifier[public], parameter[database]] begin[{]
local_variable[type[String], tangoHosts]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DbGetCSDbServerList")], member=command_inout, postfix_operators=[], prefix_operators=[], qualifier=database, selectors=[], type_arguments=None), name=deviceData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeviceData, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tangoHosts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=extractStringArray, postfix_operators=[], prefix_operators=[], qualifier=deviceData, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=desc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=desc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="command ")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=desc, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not found")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=desc, selectors=[], type_arguments=None), operator=&&), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=desc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tangoHosts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getFullTangoHost, postfix_operators=[], prefix_operators=[], qualifier=database, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=e2, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=desc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e2, types=['DevFailed']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DevFailed']))], finally_block=None, label=None, resources=None)
return[member[.tangoHosts]]
end[}]
END[}] | Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getPossibleTangoHosts] operator[SEP] identifier[Database] identifier[database] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[tangoHosts] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[DeviceData] identifier[deviceData] operator[=] identifier[database] operator[SEP] identifier[command_inout] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[tangoHosts] operator[=] identifier[deviceData] operator[SEP] identifier[extractStringArray] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DevFailed] identifier[e] operator[SEP] {
identifier[String] identifier[desc] operator[=] identifier[e] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[desc] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[desc] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[desc] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[tangoHosts] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[database] operator[SEP] identifier[getFullTangoHost] operator[SEP] operator[SEP]
} operator[SEP]
}
Keyword[else] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[e] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[desc] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DevFailed] identifier[e2] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[e2] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[desc] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[tangoHosts] operator[SEP]
}
|
private static String stripDotSuffix(final String value) {
if (value == null) {
return null;
}
final int index = value.indexOf(".");
if (index != -1) {
return value.substring(0, index);
}
return value;
} | class class_name[name] begin[{]
method[stripDotSuffix, return_type[type[String]], modifier[private static], parameter[value]] begin[{]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[int], index]
if[binary_operation[member[.index], !=, literal[1]]] begin[{]
return[call[value.substring, parameter[literal[0], member[.index]]]]
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[stripDotSuffix] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[final] Keyword[int] identifier[index] operator[=] identifier[value] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] {
Keyword[return] identifier[value] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
|
@Override
public Sequence<?> getBJSequence() {
String seq = getSeqResSequence();
Sequence<AminoAcidCompound> s = null;
try {
s = new ProteinSequence(seq);
} catch (CompoundNotFoundException e) {
logger.error("Could not create sequence object from seqres sequence. Some unknown compound: {}",e.getMessage());
}
//TODO: return a DNA sequence if the content is DNA...
return s;
} | class class_name[name] begin[{]
method[getBJSequence, return_type[type[Sequence]], modifier[public], parameter[]] begin[{]
local_variable[type[String], seq]
local_variable[type[Sequence], s]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=seq, 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=ProteinSequence, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not create sequence object from seqres sequence. Some unknown compound: {}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CompoundNotFoundException']))], finally_block=None, label=None, resources=None)
return[member[.s]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Sequence] operator[<] operator[?] operator[>] identifier[getBJSequence] operator[SEP] operator[SEP] {
identifier[String] identifier[seq] operator[=] identifier[getSeqResSequence] operator[SEP] operator[SEP] operator[SEP] identifier[Sequence] operator[<] identifier[AminoAcidCompound] operator[>] identifier[s] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[s] operator[=] Keyword[new] identifier[ProteinSequence] operator[SEP] identifier[seq] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CompoundNotFoundException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[s] operator[SEP]
}
|
private void addFragment(@NonNull final WizardDialog.Builder builder, final int index) {
Bundle arguments = new Bundle();
arguments.putInt(DialogFragment.INDEX_EXTRA, index);
CharSequence title = shouldHeaderBeShown() ? null :
String.format(getString(R.string.dialog_tab_text), index);
builder.addFragment(title, DialogFragment.class, arguments);
} | class class_name[name] begin[{]
method[addFragment, return_type[void], modifier[private], parameter[builder, index]] begin[{]
local_variable[type[Bundle], arguments]
call[arguments.putInt, parameter[member[DialogFragment.INDEX_EXTRA], member[.index]]]
local_variable[type[CharSequence], title]
call[builder.addFragment, parameter[member[.title], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DialogFragment, sub_type=None)), member[.arguments]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addFragment] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[WizardDialog] operator[SEP] identifier[Builder] identifier[builder] , Keyword[final] Keyword[int] identifier[index] operator[SEP] {
identifier[Bundle] identifier[arguments] operator[=] Keyword[new] identifier[Bundle] operator[SEP] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[putInt] operator[SEP] identifier[DialogFragment] operator[SEP] identifier[INDEX_EXTRA] , identifier[index] operator[SEP] operator[SEP] identifier[CharSequence] identifier[title] operator[=] identifier[shouldHeaderBeShown] operator[SEP] operator[SEP] operator[?] Other[null] operator[:] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[getString] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[dialog_tab_text] operator[SEP] , identifier[index] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addFragment] operator[SEP] identifier[title] , identifier[DialogFragment] operator[SEP] Keyword[class] , identifier[arguments] operator[SEP] operator[SEP]
}
|
public static <T> IncreasingQualityDataSourceSupplier<T> create(
List<Supplier<DataSource<T>>> dataSourceSuppliers, boolean dataSourceLazy) {
return new IncreasingQualityDataSourceSupplier<T>(dataSourceSuppliers, dataSourceLazy);
} | class class_name[name] begin[{]
method[create, return_type[type[IncreasingQualityDataSourceSupplier]], modifier[public static], parameter[dataSourceSuppliers, dataSourceLazy]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=dataSourceSuppliers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataSourceLazy, 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=IncreasingQualityDataSourceSupplier, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[IncreasingQualityDataSourceSupplier] operator[<] identifier[T] operator[>] identifier[create] operator[SEP] identifier[List] operator[<] identifier[Supplier] operator[<] identifier[DataSource] operator[<] identifier[T] operator[>] operator[>] operator[>] identifier[dataSourceSuppliers] , Keyword[boolean] identifier[dataSourceLazy] operator[SEP] {
Keyword[return] Keyword[new] identifier[IncreasingQualityDataSourceSupplier] operator[<] identifier[T] operator[>] operator[SEP] identifier[dataSourceSuppliers] , identifier[dataSourceLazy] operator[SEP] operator[SEP]
}
|
private void updateFields() {
if (featureInfo != null) {
// Create a header field for each attribute definition:
List<ListGridField> fields = new ArrayList<ListGridField>();
if (idInTable) {
ListGridField gridField = new ListGridField(ID_NAME, "ID");
gridField.setAlign(Alignment.LEFT);
gridField.setCanEdit(false);
fields.add(gridField);
}
for (AttributeInfo attributeInfo : featureInfo.getAttributes()) {
if (!attributeInfo.isHidden() && (attributeInfo.isIdentifying() || allAttributesDisplayed)) {
fields.add(createAttributeGridField(attributeInfo));
}
}
setFields(fields.toArray(new ListGridField[fields.size()]));
setCanResizeFields(true);
}
} | class class_name[name] begin[{]
method[updateFields, return_type[void], modifier[private], parameter[]] begin[{]
if[binary_operation[member[.featureInfo], !=, literal[null]]] begin[{]
local_variable[type[List], fields]
if[member[.idInTable]] begin[{]
local_variable[type[ListGridField], gridField]
call[gridField.setAlign, parameter[member[Alignment.LEFT]]]
call[gridField.setCanEdit, parameter[literal[false]]]
call[fields.add, parameter[member[.gridField]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isHidden, postfix_operators=[], prefix_operators=['!'], qualifier=attributeInfo, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isIdentifying, postfix_operators=[], prefix_operators=[], qualifier=attributeInfo, selectors=[], type_arguments=None), operandr=MemberReference(member=allAttributesDisplayed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attributeInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createAttributeGridField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=featureInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attributeInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttributeInfo, sub_type=None))), label=None)
call[.setFields, parameter[call[fields.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ListGridField, sub_type=None))]]]]
call[.setCanResizeFields, parameter[literal[true]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateFields] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[featureInfo] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] identifier[ListGridField] operator[>] identifier[fields] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ListGridField] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idInTable] operator[SEP] {
identifier[ListGridField] identifier[gridField] operator[=] Keyword[new] identifier[ListGridField] operator[SEP] identifier[ID_NAME] , literal[String] operator[SEP] operator[SEP] identifier[gridField] operator[SEP] identifier[setAlign] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEFT] operator[SEP] operator[SEP] identifier[gridField] operator[SEP] identifier[setCanEdit] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] identifier[gridField] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[AttributeInfo] identifier[attributeInfo] operator[:] identifier[featureInfo] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[attributeInfo] operator[SEP] identifier[isHidden] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[attributeInfo] operator[SEP] identifier[isIdentifying] operator[SEP] operator[SEP] operator[||] identifier[allAttributesDisplayed] operator[SEP] operator[SEP] {
identifier[fields] operator[SEP] identifier[add] operator[SEP] identifier[createAttributeGridField] operator[SEP] identifier[attributeInfo] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[setFields] operator[SEP] identifier[fields] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[ListGridField] operator[SEP] identifier[fields] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setCanResizeFields] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
|
public static synchronized Roster getInstanceFor(XMPPConnection connection) {
Roster roster = INSTANCES.get(connection);
if (roster == null) {
roster = new Roster(connection);
INSTANCES.put(connection, roster);
}
return roster;
} | class class_name[name] begin[{]
method[getInstanceFor, return_type[type[Roster]], modifier[synchronized public static], parameter[connection]] begin[{]
local_variable[type[Roster], roster]
if[binary_operation[member[.roster], ==, literal[null]]] begin[{]
assign[member[.roster], ClassCreator(arguments=[MemberReference(member=connection, 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=Roster, sub_type=None))]
call[INSTANCES.put, parameter[member[.connection], member[.roster]]]
else begin[{]
None
end[}]
return[member[.roster]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[synchronized] identifier[Roster] identifier[getInstanceFor] operator[SEP] identifier[XMPPConnection] identifier[connection] operator[SEP] {
identifier[Roster] identifier[roster] operator[=] identifier[INSTANCES] operator[SEP] identifier[get] operator[SEP] identifier[connection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[roster] operator[==] Other[null] operator[SEP] {
identifier[roster] operator[=] Keyword[new] identifier[Roster] operator[SEP] identifier[connection] operator[SEP] operator[SEP] identifier[INSTANCES] operator[SEP] identifier[put] operator[SEP] identifier[connection] , identifier[roster] operator[SEP] operator[SEP]
}
Keyword[return] identifier[roster] operator[SEP]
}
|
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
if (isResolvable(base)) {
Map<?, ?> map = (Map<?, ?>) base;
final Iterator<?> keys = map.keySet().iterator();
return new Iterator<FeatureDescriptor>() {
public boolean hasNext() {
return keys.hasNext();
}
public FeatureDescriptor next() {
Object key = keys.next();
FeatureDescriptor feature = new FeatureDescriptor();
feature.setDisplayName(key == null ? "null" : key.toString());
feature.setName(feature.getDisplayName());
feature.setShortDescription("");
feature.setExpert(true);
feature.setHidden(false);
feature.setPreferred(true);
feature.setValue(TYPE, key == null ? null : key.getClass());
feature.setValue(RESOLVABLE_AT_DESIGN_TIME, true);
return feature;
}
public void remove() {
throw new UnsupportedOperationException("cannot remove");
}
};
}
return null;
} | class class_name[name] begin[{]
method[getFeatureDescriptors, return_type[type[Iterator]], modifier[public], parameter[context, base]] begin[{]
if[call[.isResolvable, parameter[member[.base]]]] begin[{]
local_variable[type[Map], map]
local_variable[type[Iterator], keys]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FeatureDescriptor, sub_type=None)), name=feature)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FeatureDescriptor, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null"))], member=setDisplayName, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDisplayName, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=setShortDescription, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setExpert, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setHidden, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setPreferred, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RESOLVABLE_AT_DESIGN_TIME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=FeatureDescriptor, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot remove")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=remove, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FeatureDescriptor, sub_type=None))], dimensions=None, name=Iterator, sub_type=None))]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[FeatureDescriptor] operator[>] identifier[getFeatureDescriptors] operator[SEP] identifier[ELContext] identifier[context] , identifier[Object] identifier[base] operator[SEP] {
Keyword[if] operator[SEP] identifier[isResolvable] operator[SEP] identifier[base] operator[SEP] operator[SEP] {
identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[map] operator[=] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[base] operator[SEP] Keyword[final] identifier[Iterator] operator[<] operator[?] operator[>] identifier[keys] operator[=] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[FeatureDescriptor] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] {
Keyword[return] identifier[keys] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] identifier[FeatureDescriptor] identifier[next] operator[SEP] operator[SEP] {
identifier[Object] identifier[key] operator[=] identifier[keys] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[FeatureDescriptor] identifier[feature] operator[=] Keyword[new] identifier[FeatureDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setDisplayName] operator[SEP] identifier[key] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[key] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setName] operator[SEP] identifier[feature] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setShortDescription] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setExpert] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setPreferred] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setValue] operator[SEP] identifier[TYPE] , identifier[key] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[key] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[feature] operator[SEP] identifier[setValue] operator[SEP] identifier[RESOLVABLE_AT_DESIGN_TIME] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[feature] operator[SEP]
}
Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public static <C extends SOABase> AbstractACModel loadACModel(String acFile, Map<String, C> availableContexts, boolean validateModel) throws Exception {
ACModelProperties testProperties = new ACModelProperties();
try {
testProperties.load(acFile);
} catch (IOException e) {
throw new IOException("Cannot load properties file: " + acFile + ".");
}
String contextName = null;
try {
contextName = testProperties.getContextName();
} catch (Exception e) {
throw new Exception("Exception while extracting context name from AC model properties", e);
}
if (contextName == null) {
throw new PropertyException(ACModelProperty.CONTEXT_NAME, null, "Cannot extract context name from AC model properties");
}
if (!availableContexts.containsKey(contextName)) {
throw new PropertyException(ACModelProperty.CONTEXT_NAME, contextName, "No context with adequate name available.");
}
// Check if suitable context is available
if (!availableContexts.containsKey(contextName)) {
throw new Exception("Required SOABase \"" + contextName + "\" is not available");
}
SOABase context = availableContexts.get(contextName);
if (context == null) {
throw new Exception("Required SOABase \"" + contextName + "\" is NULL");
}
// Check ACModel type
AbstractACModel newModel = null;
if (testProperties.getType() == ACModelType.ACL) {
ACLModelProperties aclProperties = new ACLModelProperties();
aclProperties.load(acFile);
newModel = new ACLModel(aclProperties, context);
} else {
RBACModelProperties rbacProperties = new RBACModelProperties();
rbacProperties.load(acFile);
newModel = new RBACModel(rbacProperties, context);
}
if (validateModel) {
try {
newModel.checkValidity();
} catch (ACMValidationException e) {
throw new ParameterException("Parsed AC-model is not valid", e);
}
}
return newModel;
} | class class_name[name] begin[{]
method[loadACModel, return_type[type[AbstractACModel]], modifier[public static], parameter[acFile, availableContexts, validateModel]] begin[{]
local_variable[type[ACModelProperties], testProperties]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=acFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=testProperties, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot load properties file: "), operandr=MemberReference(member=acFile, 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
local_variable[type[String], contextName]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=contextName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getContextName, postfix_operators=[], prefix_operators=[], qualifier=testProperties, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception while extracting context name from AC model properties"), 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=Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.contextName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=CONTEXT_NAME, postfix_operators=[], prefix_operators=[], qualifier=ACModelProperty, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot extract context name from AC model properties")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PropertyException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[availableContexts.containsKey, parameter[member[.contextName]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=CONTEXT_NAME, postfix_operators=[], prefix_operators=[], qualifier=ACModelProperty, selectors=[]), MemberReference(member=contextName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No context with adequate name available.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PropertyException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[availableContexts.containsKey, parameter[member[.contextName]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Required SOABase \""), operandr=MemberReference(member=contextName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" is not available"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[SOABase], context]
if[binary_operation[member[.context], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Required SOABase \""), operandr=MemberReference(member=contextName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" is NULL"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[AbstractACModel], newModel]
if[binary_operation[call[testProperties.getType, parameter[]], ==, member[ACModelType.ACL]]] begin[{]
local_variable[type[ACLModelProperties], aclProperties]
call[aclProperties.load, parameter[member[.acFile]]]
assign[member[.newModel], ClassCreator(arguments=[MemberReference(member=aclProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, 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=ACLModel, sub_type=None))]
else begin[{]
local_variable[type[RBACModelProperties], rbacProperties]
call[rbacProperties.load, parameter[member[.acFile]]]
assign[member[.newModel], ClassCreator(arguments=[MemberReference(member=rbacProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, 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=RBACModel, sub_type=None))]
end[}]
if[member[.validateModel]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkValidity, postfix_operators=[], prefix_operators=[], qualifier=newModel, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parsed AC-model is not valid"), 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=ParameterException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ACMValidationException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.newModel]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[C] Keyword[extends] identifier[SOABase] operator[>] identifier[AbstractACModel] identifier[loadACModel] operator[SEP] identifier[String] identifier[acFile] , identifier[Map] operator[<] identifier[String] , identifier[C] operator[>] identifier[availableContexts] , Keyword[boolean] identifier[validateModel] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[ACModelProperties] identifier[testProperties] operator[=] Keyword[new] identifier[ACModelProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[testProperties] operator[SEP] identifier[load] operator[SEP] identifier[acFile] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[acFile] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[contextName] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[contextName] operator[=] identifier[testProperties] operator[SEP] identifier[getContextName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[contextName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[PropertyException] operator[SEP] identifier[ACModelProperty] operator[SEP] identifier[CONTEXT_NAME] , Other[null] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[availableContexts] operator[SEP] identifier[containsKey] operator[SEP] identifier[contextName] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[PropertyException] operator[SEP] identifier[ACModelProperty] operator[SEP] identifier[CONTEXT_NAME] , identifier[contextName] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[availableContexts] operator[SEP] identifier[containsKey] operator[SEP] identifier[contextName] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[contextName] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[SOABase] identifier[context] operator[=] identifier[availableContexts] operator[SEP] identifier[get] operator[SEP] identifier[contextName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[contextName] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[AbstractACModel] identifier[newModel] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[testProperties] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[ACModelType] operator[SEP] identifier[ACL] operator[SEP] {
identifier[ACLModelProperties] identifier[aclProperties] operator[=] Keyword[new] identifier[ACLModelProperties] operator[SEP] operator[SEP] operator[SEP] identifier[aclProperties] operator[SEP] identifier[load] operator[SEP] identifier[acFile] operator[SEP] operator[SEP] identifier[newModel] operator[=] Keyword[new] identifier[ACLModel] operator[SEP] identifier[aclProperties] , identifier[context] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[RBACModelProperties] identifier[rbacProperties] operator[=] Keyword[new] identifier[RBACModelProperties] operator[SEP] operator[SEP] operator[SEP] identifier[rbacProperties] operator[SEP] identifier[load] operator[SEP] identifier[acFile] operator[SEP] operator[SEP] identifier[newModel] operator[=] Keyword[new] identifier[RBACModel] operator[SEP] identifier[rbacProperties] , identifier[context] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[validateModel] operator[SEP] {
Keyword[try] {
identifier[newModel] operator[SEP] identifier[checkValidity] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ACMValidationException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ParameterException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[newModel] operator[SEP]
}
|
@Override
public V remove(final Object key) {
return doWithWriteLock(c -> c.remove(key));
} | class class_name[name] begin[{]
method[remove, return_type[type[V]], modifier[public], parameter[key]] begin[{]
return[call[.doWithWriteLock, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), parameters=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[V] identifier[remove] operator[SEP] Keyword[final] identifier[Object] identifier[key] operator[SEP] {
Keyword[return] identifier[doWithWriteLock] operator[SEP] identifier[c] operator[->] identifier[c] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public TServerTransport getTransport() throws TTransportException {
if (serverSocket == null) {
TSSLTransportParameters params = getServerConfiguration().getSslTransportParameters();
serverSocket = params == null ? new TServerSocket(getServerPort())
: TSSLTransportFactory.getServerSocket(getServerPort(), 0, null, params);
}
return serverSocket;
} | class class_name[name] begin[{]
method[getTransport, return_type[type[TServerTransport]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.serverSocket], ==, literal[null]]] begin[{]
local_variable[type[TSSLTransportParameters], params]
assign[member[.serverSocket], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServerPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getServerSocket, postfix_operators=[], prefix_operators=[], qualifier=TSSLTransportFactory, selectors=[], type_arguments=None), if_true=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getServerPort, 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=TServerSocket, sub_type=None)))]
else begin[{]
None
end[}]
return[member[.serverSocket]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[TServerTransport] identifier[getTransport] operator[SEP] operator[SEP] Keyword[throws] identifier[TTransportException] {
Keyword[if] operator[SEP] identifier[serverSocket] operator[==] Other[null] operator[SEP] {
identifier[TSSLTransportParameters] identifier[params] operator[=] identifier[getServerConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getSslTransportParameters] operator[SEP] operator[SEP] operator[SEP] identifier[serverSocket] operator[=] identifier[params] operator[==] Other[null] operator[?] Keyword[new] identifier[TServerSocket] operator[SEP] identifier[getServerPort] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[TSSLTransportFactory] operator[SEP] identifier[getServerSocket] operator[SEP] identifier[getServerPort] operator[SEP] operator[SEP] , Other[0] , Other[null] , identifier[params] operator[SEP] operator[SEP]
}
Keyword[return] identifier[serverSocket] operator[SEP]
}
|
public JmxMessage attribute(String name, Object value, Class<?> valueType) {
if (mbeanInvocation == null) {
throw new CitrusRuntimeException("Invalid access to attribute for JMX message");
}
ManagedBeanInvocation.Attribute attribute = new ManagedBeanInvocation.Attribute();
attribute.setName(name);
if (value != null) {
attribute.setValueObject(value);
attribute.setType(valueType.getName());
}
mbeanInvocation.setAttribute(attribute);
return this;
} | class class_name[name] begin[{]
method[attribute, return_type[type[JmxMessage]], modifier[public], parameter[name, value, valueType]] begin[{]
if[binary_operation[member[.mbeanInvocation], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid access to attribute for JMX message")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CitrusRuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[ManagedBeanInvocation], attribute]
call[attribute.setName, parameter[member[.name]]]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
call[attribute.setValueObject, parameter[member[.value]]]
call[attribute.setType, parameter[call[valueType.getName, parameter[]]]]
else begin[{]
None
end[}]
call[mbeanInvocation.setAttribute, parameter[member[.attribute]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[JmxMessage] identifier[attribute] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] , identifier[Class] operator[<] operator[?] operator[>] identifier[valueType] operator[SEP] {
Keyword[if] operator[SEP] identifier[mbeanInvocation] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CitrusRuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[ManagedBeanInvocation] operator[SEP] identifier[Attribute] identifier[attribute] operator[=] Keyword[new] identifier[ManagedBeanInvocation] operator[SEP] identifier[Attribute] operator[SEP] operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[attribute] operator[SEP] identifier[setValueObject] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[setType] operator[SEP] identifier[valueType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[mbeanInvocation] operator[SEP] identifier[setAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private Map<Key<?>, String> getAllInvalidKeys(DependencyExplorerOutput output) {
Map<Key<?>, String> invalidKeys = new LinkedHashMap<Key<?>, String>();
// Look for errors in the nodes, and either report the error (if its required) or remove the
// node (if its optional).
for (Entry<Key<?>, String> error : output.getBindingErrors()) {
invalidKeys.put(error.getKey(), "Unable to create or inherit binding: " + error.getValue());
}
GinjectorBindings origin = output.getGraph().getOrigin();
for (Key<?> key : output.getImplicitlyBoundKeys()) {
if (origin.isBoundLocallyInChild(key)) {
GinjectorBindings child = origin.getChildWhichBindsLocally(key);
Binding childBinding = child.getBinding(key);
PrettyPrinter.log(logger, TreeLogger.DEBUG,
"Marking the key %s as bound in the ginjector %s (implicitly), and in the child"
+ " %s (%s)", key, origin, child, childBinding.getContext());
// TODO(schmitt): Determine path to binding in child ginjector (requires
// different DependencyExplorerOutput).
invalidKeys.put(key,
PrettyPrinter.format("Already bound in child Ginjector %s. Consider exposing it?",
child));
}
}
return invalidKeys;
} | class class_name[name] begin[{]
method[getAllInvalidKeys, return_type[type[Map]], modifier[private], parameter[output]] begin[{]
local_variable[type[Map], invalidKeys]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=error, selectors=[], type_arguments=None), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to create or inherit binding: "), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=error, selectors=[], type_arguments=None), operator=+)], member=put, postfix_operators=[], prefix_operators=[], qualifier=invalidKeys, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getBindingErrors, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=error)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Key, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
local_variable[type[GinjectorBindings], origin]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBoundLocallyInChild, postfix_operators=[], prefix_operators=[], qualifier=origin, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChildWhichBindsLocally, postfix_operators=[], prefix_operators=[], qualifier=origin, selectors=[], type_arguments=None), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GinjectorBindings, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBinding, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), name=childBinding)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Binding, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEBUG, postfix_operators=[], prefix_operators=[], qualifier=TreeLogger, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Marking the key %s as bound in the ginjector %s (implicitly), and in the child"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" %s (%s)"), operator=+), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=origin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=childBinding, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=PrettyPrinter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Already bound in child Ginjector %s. Consider exposing it?"), MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=PrettyPrinter, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=invalidKeys, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getImplicitlyBoundKeys, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Key, sub_type=None))), label=None)
return[member[.invalidKeys]]
end[}]
END[}] | Keyword[private] identifier[Map] operator[<] identifier[Key] operator[<] operator[?] operator[>] , identifier[String] operator[>] identifier[getAllInvalidKeys] operator[SEP] identifier[DependencyExplorerOutput] identifier[output] operator[SEP] {
identifier[Map] operator[<] identifier[Key] operator[<] operator[?] operator[>] , identifier[String] operator[>] identifier[invalidKeys] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[Key] operator[<] operator[?] operator[>] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[Key] operator[<] operator[?] operator[>] , identifier[String] operator[>] identifier[error] operator[:] identifier[output] operator[SEP] identifier[getBindingErrors] operator[SEP] operator[SEP] operator[SEP] {
identifier[invalidKeys] operator[SEP] identifier[put] operator[SEP] identifier[error] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[error] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[GinjectorBindings] identifier[origin] operator[=] identifier[output] operator[SEP] identifier[getGraph] operator[SEP] operator[SEP] operator[SEP] identifier[getOrigin] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Key] operator[<] operator[?] operator[>] identifier[key] operator[:] identifier[output] operator[SEP] identifier[getImplicitlyBoundKeys] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[origin] operator[SEP] identifier[isBoundLocallyInChild] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
identifier[GinjectorBindings] identifier[child] operator[=] identifier[origin] operator[SEP] identifier[getChildWhichBindsLocally] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[Binding] identifier[childBinding] operator[=] identifier[child] operator[SEP] identifier[getBinding] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[PrettyPrinter] operator[SEP] identifier[log] operator[SEP] identifier[logger] , identifier[TreeLogger] operator[SEP] identifier[DEBUG] , literal[String] operator[+] literal[String] , identifier[key] , identifier[origin] , identifier[child] , identifier[childBinding] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[invalidKeys] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[PrettyPrinter] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[child] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[invalidKeys] operator[SEP]
}
|
public final EObject entryRuleDisjunction() throws RecognitionException {
EObject current = null;
EObject iv_ruleDisjunction = null;
try {
// InternalXtext.g:1758:52: (iv_ruleDisjunction= ruleDisjunction EOF )
// InternalXtext.g:1759:2: iv_ruleDisjunction= ruleDisjunction EOF
{
newCompositeNode(grammarAccess.getDisjunctionRule());
pushFollow(FollowSets000.FOLLOW_1);
iv_ruleDisjunction=ruleDisjunction();
state._fsp--;
current =iv_ruleDisjunction;
match(input,EOF,FollowSets000.FOLLOW_2);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} | class class_name[name] begin[{]
method[entryRuleDisjunction, return_type[type[EObject]], modifier[final public], parameter[]] begin[{]
local_variable[type[EObject], current]
local_variable[type[EObject], iv_ruleDisjunction]
TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDisjunctionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_1, postfix_operators=[], prefix_operators=[], qualifier=FollowSets000, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=iv_ruleDisjunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleDisjunction, 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), StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=iv_ruleDisjunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=FollowSets000, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.current]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[EObject] identifier[entryRuleDisjunction] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[EObject] identifier[current] operator[=] Other[null] operator[SEP] identifier[EObject] identifier[iv_ruleDisjunction] operator[=] Other[null] operator[SEP] Keyword[try] {
{
identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getDisjunctionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FollowSets000] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[iv_ruleDisjunction] operator[=] identifier[ruleDisjunction] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[current] operator[=] identifier[iv_ruleDisjunction] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FollowSets000] operator[SEP] identifier[FOLLOW_2] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[current] operator[SEP]
}
|
private List<From> findFrom(SQLTableSource from) {
//zhongshu-comment class1.isAssignableFrom(class2) class2是不是class1的子类或者子接口
//改成用instanceof 应该也行吧:from instanceof SQLExprTableSource
boolean isSqlExprTable = from.getClass().isAssignableFrom(SQLExprTableSource.class);
if (isSqlExprTable) {
SQLExprTableSource fromExpr = (SQLExprTableSource) from;
String[] split = fromExpr.getExpr().toString().split(",");
ArrayList<From> fromList = new ArrayList<>();
for (String source : split) {
fromList.add(new From(source.trim(), fromExpr.getAlias()));
}
return fromList;
}
SQLJoinTableSource joinTableSource = ((SQLJoinTableSource) from);
List<From> fromList = new ArrayList<>();
fromList.addAll(findFrom(joinTableSource.getLeft()));
fromList.addAll(findFrom(joinTableSource.getRight()));
return fromList;
} | class class_name[name] begin[{]
method[findFrom, return_type[type[List]], modifier[private], parameter[from]] begin[{]
local_variable[type[boolean], isSqlExprTable]
if[member[.isSqlExprTable]] begin[{]
local_variable[type[SQLExprTableSource], fromExpr]
local_variable[type[String], split]
local_variable[type[ArrayList], fromList]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAlias, postfix_operators=[], prefix_operators=[], qualifier=fromExpr, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=From, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=fromList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=source)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.fromList]]
else begin[{]
None
end[}]
local_variable[type[SQLJoinTableSource], joinTableSource]
local_variable[type[List], fromList]
call[fromList.addAll, parameter[call[.findFrom, parameter[call[joinTableSource.getLeft, parameter[]]]]]]
call[fromList.addAll, parameter[call[.findFrom, parameter[call[joinTableSource.getRight, parameter[]]]]]]
return[member[.fromList]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[From] operator[>] identifier[findFrom] operator[SEP] identifier[SQLTableSource] identifier[from] operator[SEP] {
Keyword[boolean] identifier[isSqlExprTable] operator[=] identifier[from] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[SQLExprTableSource] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isSqlExprTable] operator[SEP] {
identifier[SQLExprTableSource] identifier[fromExpr] operator[=] operator[SEP] identifier[SQLExprTableSource] operator[SEP] identifier[from] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[split] operator[=] identifier[fromExpr] operator[SEP] identifier[getExpr] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[From] operator[>] identifier[fromList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[source] operator[:] identifier[split] operator[SEP] {
identifier[fromList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[From] operator[SEP] identifier[source] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[fromExpr] operator[SEP] identifier[getAlias] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fromList] operator[SEP]
}
identifier[SQLJoinTableSource] identifier[joinTableSource] operator[=] operator[SEP] operator[SEP] identifier[SQLJoinTableSource] operator[SEP] identifier[from] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[From] operator[>] identifier[fromList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[fromList] operator[SEP] identifier[addAll] operator[SEP] identifier[findFrom] operator[SEP] identifier[joinTableSource] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fromList] operator[SEP] identifier[addAll] operator[SEP] identifier[findFrom] operator[SEP] identifier[joinTableSource] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fromList] operator[SEP]
}
|
public void setSpendTarget(com.google.api.ads.adwords.axis.v201809.cm.Money spendTarget) {
this.spendTarget = spendTarget;
} | class class_name[name] begin[{]
method[setSpendTarget, return_type[void], modifier[public], parameter[spendTarget]] begin[{]
assign[THIS[member[None.spendTarget]], member[.spendTarget]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSpendTarget] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[cm] operator[SEP] identifier[Money] identifier[spendTarget] operator[SEP] {
Keyword[this] operator[SEP] identifier[spendTarget] operator[=] identifier[spendTarget] operator[SEP]
}
|
public static lbwlm_lbvserver_binding[] get_filtered(nitro_service service, String wlmname, filtervalue[] filter) throws Exception{
lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding();
obj.set_wlmname(wlmname);
options option = new options();
option.set_filter(filter);
lbwlm_lbvserver_binding[] response = (lbwlm_lbvserver_binding[]) obj.getfiltered(service, option);
return response;
} | class class_name[name] begin[{]
method[get_filtered, return_type[type[lbwlm_lbvserver_binding]], modifier[public static], parameter[service, wlmname, filter]] begin[{]
local_variable[type[lbwlm_lbvserver_binding], obj]
call[obj.set_wlmname, parameter[member[.wlmname]]]
local_variable[type[options], option]
call[option.set_filter, parameter[member[.filter]]]
local_variable[type[lbwlm_lbvserver_binding], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[lbwlm_lbvserver_binding] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[wlmname] , identifier[filtervalue] operator[SEP] operator[SEP] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[lbwlm_lbvserver_binding] identifier[obj] operator[=] Keyword[new] identifier[lbwlm_lbvserver_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_wlmname] operator[SEP] identifier[wlmname] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[lbwlm_lbvserver_binding] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[lbwlm_lbvserver_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
public static LuceneQueryFactory forSingleColumnIndex( ValueFactories factories,
Map<String, Object> variables,
Map<String, PropertyType> propertyTypesByName ) {
return new SingleColumnQueryFactory(factories, variables, propertyTypesByName);
} | class class_name[name] begin[{]
method[forSingleColumnIndex, return_type[type[LuceneQueryFactory]], modifier[public static], parameter[factories, variables, propertyTypesByName]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=factories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=variables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyTypesByName, 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=SingleColumnQueryFactory, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[LuceneQueryFactory] identifier[forSingleColumnIndex] operator[SEP] identifier[ValueFactories] identifier[factories] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[variables] , identifier[Map] operator[<] identifier[String] , identifier[PropertyType] operator[>] identifier[propertyTypesByName] operator[SEP] {
Keyword[return] Keyword[new] identifier[SingleColumnQueryFactory] operator[SEP] identifier[factories] , identifier[variables] , identifier[propertyTypesByName] operator[SEP] operator[SEP]
}
|
public void checkin(SocketDestination destination, ClientRequestExecutor clientRequestExecutor) {
try {
queuedPool.checkin(destination, clientRequestExecutor);
} catch(Exception e) {
throw new VoldemortException("Failure while checking in socket for " + destination
+ ": ", e);
}
} | class class_name[name] begin[{]
method[checkin, return_type[void], modifier[public], parameter[destination, clientRequestExecutor]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clientRequestExecutor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkin, postfix_operators=[], prefix_operators=[], qualifier=queuedPool, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure while checking in socket for "), operandr=MemberReference(member=destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VoldemortException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[checkin] operator[SEP] identifier[SocketDestination] identifier[destination] , identifier[ClientRequestExecutor] identifier[clientRequestExecutor] operator[SEP] {
Keyword[try] {
identifier[queuedPool] operator[SEP] identifier[checkin] operator[SEP] identifier[destination] , identifier[clientRequestExecutor] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[VoldemortException] operator[SEP] literal[String] operator[+] identifier[destination] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void load(String antecedent, Engine engine) {
FuzzyLite.logger().log(Level.FINE, "Antecedent: {0}", antecedent);
unload();
setText(antecedent);
if (antecedent.trim().isEmpty()) {
throw new RuntimeException("[syntax error] antecedent is empty");
}
/*
Builds an proposition tree from the antecedent of a fuzzy rule.
The rules are:
1) After a variable comes 'is',
2) After 'is' comes a hedge or a term
3) After a hedge comes a hedge or a term
4) After a term comes a variable or an operator
*/
Function function = new Function();
String postfix = function.toPostfix(antecedent);
FuzzyLite.logger().log(Level.FINE, "Postfix {0}", postfix);
final byte S_VARIABLE = 1, S_IS = 2, S_HEDGE = 4, S_TERM = 8, S_AND_OR = 16;
byte state = S_VARIABLE;
Deque<Expression> expressionStack = new ArrayDeque<Expression>();
Proposition proposition = null;
StringTokenizer tokenizer = new StringTokenizer(postfix);
String token = "";
while (tokenizer.hasMoreTokens()) {
token = tokenizer.nextToken();
if ((state & S_VARIABLE) != 0) {
Variable variable = null;
if (engine.hasInputVariable(token)) {
variable = engine.getInputVariable(token);
} else if (engine.hasOutputVariable(token)) {
variable = engine.getOutputVariable(token);
}
if (variable != null) {
proposition = new Proposition();
proposition.setVariable(variable);
expressionStack.push(proposition);
state = S_IS;
FuzzyLite.logger().log(Level.FINE, "Token <{0}> is variable", token);
continue;
}
}
if ((state & S_IS) != 0) {
if (Rule.FL_IS.equals(token)) {
state = S_HEDGE | S_TERM;
FuzzyLite.logger().log(Level.FINE, "Token <{0}> is keyword", token);
continue;
}
}
if ((state & S_HEDGE) != 0) {
HedgeFactory hedgeFactory = FactoryManager.instance().hedge();
if (hedgeFactory.hasConstructor(token)) {
Hedge hedge = hedgeFactory.constructObject(token);
proposition.getHedges().add(hedge);
if (hedge instanceof Any) {
state = S_VARIABLE | S_AND_OR;
} else {
state = S_HEDGE | S_TERM;
}
FuzzyLite.logger().log(Level.FINE, "Token <{0}> is hedge", token);
continue;
}
}
if ((state & S_TERM) != 0) {
if (proposition.getVariable().hasTerm(token)) {
proposition.setTerm(proposition.getVariable().getTerm(token));
state = S_VARIABLE | S_AND_OR;
FuzzyLite.logger().log(Level.FINE, "Token <{0}> is term", token);
continue;
}
}
if ((state & S_AND_OR) != 0) {
if (Rule.FL_AND.equals(token) || Rule.FL_OR.equals(token)) {
if (expressionStack.size() < 2) {
throw new RuntimeException(String.format(
"[syntax error] logical operator <%s> expects at least two operands, but found <%d>",
token, expressionStack.size()));
}
Operator operator = new Operator();
operator.setName(token);
operator.setRight(expressionStack.pop());
operator.setLeft(expressionStack.pop());
expressionStack.push(operator);
state = S_VARIABLE | S_AND_OR;
FuzzyLite.logger().log(Level.FINE, "Subtree: ({0}) ({1})",
new Object[]{operator.getLeft(), operator.getRight()});
continue;
}
}
//If reached this point, there was an error
if ((state & S_VARIABLE) != 0 || (state & S_AND_OR) != 0) {
throw new RuntimeException(String.format(
"[syntax error] expected variable or logical operator, but found <%s>",
token));
}
if ((state & S_IS) != 0) {
throw new RuntimeException(String.format(
"[syntax error] expected keyword <%s>, but found <%s>",
Rule.FL_IS, token));
}
if ((state & S_HEDGE) != 0 || (state & S_TERM) != 0) {
throw new RuntimeException(String.format(
"[syntax error] expected hedge or term, but found <%s>",
token));
}
throw new RuntimeException(String.format(
"[syntax error] unexpected token <%s>",
token));
}
if (!((state & S_VARIABLE) != 0 || (state & S_AND_OR) != 0)) { //only acceptable final state
if ((state & S_IS) != 0) {
throw new RuntimeException(String.format(
"[syntax error] expected keyword <%s> after <%s>",
Rule.FL_IS, token));
}
if ((state & S_HEDGE) != 0 || (state & S_TERM) != 0) {
throw new RuntimeException(String.format(
"[syntax error] expected hedge or term, but found <%s>",
token));
}
}
if (expressionStack.size() != 1) {
List<String> errors = new LinkedList<String>();
while (expressionStack.size() > 1) {
Expression element = expressionStack.pop();
errors.add(element.toString());
}
throw new RuntimeException(String.format(
"[syntax error] unable to parse the following expressions: <%s>",
Op.join(errors, " ")));
}
setExpression(expressionStack.pop());
} | class class_name[name] begin[{]
method[load, return_type[void], modifier[public], parameter[antecedent, engine]] begin[{]
call[FuzzyLite.logger, parameter[]]
call[.unload, parameter[]]
call[.setText, parameter[member[.antecedent]]]
if[call[antecedent.trim, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] antecedent is empty")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Function], function]
local_variable[type[String], postfix]
call[FuzzyLite.logger, parameter[]]
local_variable[type[byte], S_VARIABLE]
local_variable[type[byte], state]
local_variable[type[Deque], expressionStack]
local_variable[type[Proposition], proposition]
local_variable[type[StringTokenizer], tokenizer]
local_variable[type[String], token]
while[call[tokenizer.hasMoreTokens, parameter[]]] begin[{]
assign[member[.token], call[tokenizer.nextToken, parameter[]]]
if[binary_operation[binary_operation[member[.state], &, member[.S_VARIABLE]], !=, literal[0]]] begin[{]
local_variable[type[Variable], variable]
if[call[engine.hasInputVariable, parameter[member[.token]]]] begin[{]
assign[member[.variable], call[engine.getInputVariable, parameter[member[.token]]]]
else begin[{]
if[call[engine.hasOutputVariable, parameter[member[.token]]]] begin[{]
assign[member[.variable], call[engine.getOutputVariable, parameter[member[.token]]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.variable], !=, literal[null]]] begin[{]
assign[member[.proposition], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Proposition, sub_type=None))]
call[proposition.setVariable, parameter[member[.variable]]]
call[expressionStack.push, parameter[member[.proposition]]]
assign[member[.state], member[.S_IS]]
call[FuzzyLite.logger, parameter[]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.state], &, member[.S_IS]], !=, literal[0]]] begin[{]
if[call[Rule.FL_IS.equals, parameter[member[.token]]]] begin[{]
assign[member[.state], binary_operation[member[.S_HEDGE], |, member[.S_TERM]]]
call[FuzzyLite.logger, parameter[]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.state], &, member[.S_HEDGE]], !=, literal[0]]] begin[{]
local_variable[type[HedgeFactory], hedgeFactory]
if[call[hedgeFactory.hasConstructor, parameter[member[.token]]]] begin[{]
local_variable[type[Hedge], hedge]
call[proposition.getHedges, parameter[]]
if[binary_operation[member[.hedge], instanceof, type[Any]]] begin[{]
assign[member[.state], binary_operation[member[.S_VARIABLE], |, member[.S_AND_OR]]]
else begin[{]
assign[member[.state], binary_operation[member[.S_HEDGE], |, member[.S_TERM]]]
end[}]
call[FuzzyLite.logger, parameter[]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.state], &, member[.S_TERM]], !=, literal[0]]] begin[{]
if[call[proposition.getVariable, parameter[]]] begin[{]
call[proposition.setTerm, parameter[call[proposition.getVariable, parameter[]]]]
assign[member[.state], binary_operation[member[.S_VARIABLE], |, member[.S_AND_OR]]]
call[FuzzyLite.logger, parameter[]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.state], &, member[.S_AND_OR]], !=, literal[0]]] begin[{]
if[binary_operation[call[Rule.FL_AND.equals, parameter[member[.token]]], ||, call[Rule.FL_OR.equals, parameter[member[.token]]]]] begin[{]
if[binary_operation[call[expressionStack.size, parameter[]], <, literal[2]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] logical operator <%s> expects at least two operands, but found <%d>"), MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=expressionStack, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Operator], operator]
call[operator.setName, parameter[member[.token]]]
call[operator.setRight, parameter[call[expressionStack.pop, parameter[]]]]
call[operator.setLeft, parameter[call[expressionStack.pop, parameter[]]]]
call[expressionStack.push, parameter[member[.operator]]]
assign[member[.state], binary_operation[member[.S_VARIABLE], |, member[.S_AND_OR]]]
call[FuzzyLite.logger, parameter[]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.state], &, member[.S_VARIABLE]], !=, literal[0]], ||, binary_operation[binary_operation[member[.state], &, member[.S_AND_OR]], !=, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] expected variable or logical operator, but found <%s>"), MemberReference(member=token, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.state], &, member[.S_IS]], !=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] expected keyword <%s>, but found <%s>"), MemberReference(member=FL_IS, postfix_operators=[], prefix_operators=[], qualifier=Rule, selectors=[]), MemberReference(member=token, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.state], &, member[.S_HEDGE]], !=, literal[0]], ||, binary_operation[binary_operation[member[.state], &, member[.S_TERM]], !=, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] expected hedge or term, but found <%s>"), MemberReference(member=token, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] unexpected token <%s>"), MemberReference(member=token, 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=RuntimeException, sub_type=None)), label=None)
end[}]
if[binary_operation[binary_operation[binary_operation[member[.state], &, member[.S_VARIABLE]], !=, literal[0]], ||, binary_operation[binary_operation[member[.state], &, member[.S_AND_OR]], !=, literal[0]]]] begin[{]
if[binary_operation[binary_operation[member[.state], &, member[.S_IS]], !=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] expected keyword <%s> after <%s>"), MemberReference(member=FL_IS, postfix_operators=[], prefix_operators=[], qualifier=Rule, selectors=[]), MemberReference(member=token, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.state], &, member[.S_HEDGE]], !=, literal[0]], ||, binary_operation[binary_operation[member[.state], &, member[.S_TERM]], !=, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] expected hedge or term, but found <%s>"), MemberReference(member=token, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[call[expressionStack.size, parameter[]], !=, literal[1]]] begin[{]
local_variable[type[List], errors]
while[binary_operation[call[expressionStack.size, parameter[]], >, literal[1]]] begin[{]
local_variable[type[Expression], element]
call[errors.add, parameter[call[element.toString, parameter[]]]]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[syntax error] unable to parse the following expressions: <%s>"), MethodInvocation(arguments=[MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=join, postfix_operators=[], prefix_operators=[], qualifier=Op, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.setExpression, parameter[call[expressionStack.pop, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[load] operator[SEP] identifier[String] identifier[antecedent] , identifier[Engine] identifier[engine] operator[SEP] {
identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[antecedent] operator[SEP] operator[SEP] identifier[unload] operator[SEP] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[antecedent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[antecedent] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Function] identifier[function] operator[=] Keyword[new] identifier[Function] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[postfix] operator[=] identifier[function] operator[SEP] identifier[toPostfix] operator[SEP] identifier[antecedent] operator[SEP] operator[SEP] identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[postfix] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] identifier[S_VARIABLE] operator[=] Other[1] , identifier[S_IS] operator[=] Other[2] , identifier[S_HEDGE] operator[=] Other[4] , identifier[S_TERM] operator[=] Other[8] , identifier[S_AND_OR] operator[=] Other[16] operator[SEP] Keyword[byte] identifier[state] operator[=] identifier[S_VARIABLE] operator[SEP] identifier[Deque] operator[<] identifier[Expression] operator[>] identifier[expressionStack] operator[=] Keyword[new] identifier[ArrayDeque] operator[<] identifier[Expression] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Proposition] identifier[proposition] operator[=] Other[null] operator[SEP] identifier[StringTokenizer] identifier[tokenizer] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[postfix] operator[SEP] operator[SEP] identifier[String] identifier[token] operator[=] literal[String] operator[SEP] Keyword[while] operator[SEP] identifier[tokenizer] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] {
identifier[token] operator[=] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_VARIABLE] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[Variable] identifier[variable] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[engine] operator[SEP] identifier[hasInputVariable] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
identifier[variable] operator[=] identifier[engine] operator[SEP] identifier[getInputVariable] operator[SEP] identifier[token] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[engine] operator[SEP] identifier[hasOutputVariable] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
identifier[variable] operator[=] identifier[engine] operator[SEP] identifier[getOutputVariable] operator[SEP] identifier[token] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[variable] operator[!=] Other[null] operator[SEP] {
identifier[proposition] operator[=] Keyword[new] identifier[Proposition] operator[SEP] operator[SEP] operator[SEP] identifier[proposition] operator[SEP] identifier[setVariable] operator[SEP] identifier[variable] operator[SEP] operator[SEP] identifier[expressionStack] operator[SEP] identifier[push] operator[SEP] identifier[proposition] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[S_IS] operator[SEP] identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[token] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_IS] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[Rule] operator[SEP] identifier[FL_IS] operator[SEP] identifier[equals] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
identifier[state] operator[=] identifier[S_HEDGE] operator[|] identifier[S_TERM] operator[SEP] identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[token] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_HEDGE] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[HedgeFactory] identifier[hedgeFactory] operator[=] identifier[FactoryManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[hedge] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hedgeFactory] operator[SEP] identifier[hasConstructor] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
identifier[Hedge] identifier[hedge] operator[=] identifier[hedgeFactory] operator[SEP] identifier[constructObject] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[proposition] operator[SEP] identifier[getHedges] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[hedge] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hedge] Keyword[instanceof] identifier[Any] operator[SEP] {
identifier[state] operator[=] identifier[S_VARIABLE] operator[|] identifier[S_AND_OR] operator[SEP]
}
Keyword[else] {
identifier[state] operator[=] identifier[S_HEDGE] operator[|] identifier[S_TERM] operator[SEP]
}
identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[token] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_TERM] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[proposition] operator[SEP] identifier[getVariable] operator[SEP] operator[SEP] operator[SEP] identifier[hasTerm] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
identifier[proposition] operator[SEP] identifier[setTerm] operator[SEP] identifier[proposition] operator[SEP] identifier[getVariable] operator[SEP] operator[SEP] operator[SEP] identifier[getTerm] operator[SEP] identifier[token] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[S_VARIABLE] operator[|] identifier[S_AND_OR] operator[SEP] identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[token] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_AND_OR] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[Rule] operator[SEP] identifier[FL_AND] operator[SEP] identifier[equals] operator[SEP] identifier[token] operator[SEP] operator[||] identifier[Rule] operator[SEP] identifier[FL_OR] operator[SEP] identifier[equals] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[expressionStack] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[token] , identifier[expressionStack] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Operator] identifier[operator] operator[=] Keyword[new] identifier[Operator] operator[SEP] operator[SEP] operator[SEP] identifier[operator] operator[SEP] identifier[setName] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[operator] operator[SEP] identifier[setRight] operator[SEP] identifier[expressionStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[operator] operator[SEP] identifier[setLeft] operator[SEP] identifier[expressionStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[expressionStack] operator[SEP] identifier[push] operator[SEP] identifier[operator] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[S_VARIABLE] operator[|] identifier[S_AND_OR] operator[SEP] identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[operator] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] , identifier[operator] operator[SEP] identifier[getRight] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_VARIABLE] operator[SEP] operator[!=] Other[0] operator[||] operator[SEP] identifier[state] operator[&] identifier[S_AND_OR] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[token] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_IS] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[Rule] operator[SEP] identifier[FL_IS] , identifier[token] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_HEDGE] operator[SEP] operator[!=] Other[0] operator[||] operator[SEP] identifier[state] operator[&] identifier[S_TERM] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[token] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[token] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_VARIABLE] operator[SEP] operator[!=] Other[0] operator[||] operator[SEP] identifier[state] operator[&] identifier[S_AND_OR] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_IS] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[Rule] operator[SEP] identifier[FL_IS] , identifier[token] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[state] operator[&] identifier[S_HEDGE] operator[SEP] operator[!=] Other[0] operator[||] operator[SEP] identifier[state] operator[&] identifier[S_TERM] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[token] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[expressionStack] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[errors] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[expressionStack] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[Expression] identifier[element] operator[=] identifier[expressionStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[errors] operator[SEP] identifier[add] operator[SEP] identifier[element] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[Op] operator[SEP] identifier[join] operator[SEP] identifier[errors] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[setExpression] operator[SEP] identifier[expressionStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public FessMessages addConstraintsEanMessage(String property, String type) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_EAN_MESSAGE, type));
return this;
} | class class_name[name] begin[{]
method[addConstraintsEanMessage, return_type[type[FessMessages]], modifier[public], parameter[property, type]] begin[{]
call[.assertPropertyNotNull, parameter[member[.property]]]
call[.add, parameter[member[.property], ClassCreator(arguments=[MemberReference(member=CONSTRAINTS_EAN_MESSAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, 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=UserMessage, sub_type=None))]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[FessMessages] identifier[addConstraintsEanMessage] operator[SEP] identifier[String] identifier[property] , identifier[String] identifier[type] operator[SEP] {
identifier[assertPropertyNotNull] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[property] , Keyword[new] identifier[UserMessage] operator[SEP] identifier[CONSTRAINTS_EAN_MESSAGE] , identifier[type] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private static Short[] short2DToShort( short[][] dd )
{
Short[] d = new Short[ dd.length*dd[0].length ];
for ( int n = 0; n < dd[0].length; n++ )
{
for ( int m = 0; m < dd.length; m++ )
{
d[ m+n*dd.length ] = dd[m][n];
}
}
return d;
} | class class_name[name] begin[{]
method[short2DToShort, return_type[type[Short]], modifier[private static], parameter[dd]] begin[{]
local_variable[type[Short], d]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dd, selectors=[]), operator=*), operator=+))]), type==, value=MemberReference(member=dd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dd, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=m)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=m, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=n)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=n, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.d]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Short] operator[SEP] operator[SEP] identifier[short2DToShort] operator[SEP] Keyword[short] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dd] operator[SEP] {
identifier[Short] operator[SEP] operator[SEP] identifier[d] operator[=] Keyword[new] identifier[Short] operator[SEP] identifier[dd] operator[SEP] identifier[length] operator[*] identifier[dd] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[n] operator[=] Other[0] operator[SEP] identifier[n] operator[<] identifier[dd] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[n] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[m] operator[=] Other[0] operator[SEP] identifier[m] operator[<] identifier[dd] operator[SEP] identifier[length] operator[SEP] identifier[m] operator[++] operator[SEP] {
identifier[d] operator[SEP] identifier[m] operator[+] identifier[n] operator[*] identifier[dd] operator[SEP] identifier[length] operator[SEP] operator[=] identifier[dd] operator[SEP] identifier[m] operator[SEP] operator[SEP] identifier[n] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[d] operator[SEP]
}
|
protected AsImpl getAsForRoute(int dpc, int opc, int si, int sls) {
// TODO : Loadsharing needs to be implemented
String key = (new StringBuffer().append(dpc).append(KEY_SEPARATOR).append(opc).append(KEY_SEPARATOR).append(si))
.toString();
RouteAsImpl routeAs = route.get(key);
if (routeAs == null) {
key = (new StringBuffer().append(dpc).append(KEY_SEPARATOR).append(opc).append(KEY_SEPARATOR).append(WILDCARD))
.toString();
routeAs = route.get(key);
if (routeAs == null) {
key = (new StringBuffer().append(dpc).append(KEY_SEPARATOR).append(WILDCARD).append(KEY_SEPARATOR)
.append(WILDCARD)).toString();
routeAs = route.get(key);
}
}
if (routeAs == null) {
return null;
}
int count = (sls & this.asSelectionMask);
count = (count >> this.asSlsShiftPlaces);
return routeAs.getAsForRoute(count);
} | class class_name[name] begin[{]
method[getAsForRoute, return_type[type[AsImpl]], modifier[protected], parameter[dpc, opc, si, sls]] begin[{]
local_variable[type[String], key]
local_variable[type[RouteAsImpl], routeAs]
if[binary_operation[member[.routeAs], ==, literal[null]]] begin[{]
assign[member[.key], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None))]
assign[member[.routeAs], call[route.get, parameter[member[.key]]]]
if[binary_operation[member[.routeAs], ==, literal[null]]] begin[{]
assign[member[.key], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None))]
assign[member[.routeAs], call[route.get, parameter[member[.key]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.routeAs], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[int], count]
assign[member[.count], binary_operation[member[.count], >>, THIS[member[None.asSlsShiftPlaces]]]]
return[call[routeAs.getAsForRoute, parameter[member[.count]]]]
end[}]
END[}] | Keyword[protected] identifier[AsImpl] identifier[getAsForRoute] operator[SEP] Keyword[int] identifier[dpc] , Keyword[int] identifier[opc] , Keyword[int] identifier[si] , Keyword[int] identifier[sls] operator[SEP] {
identifier[String] identifier[key] operator[=] operator[SEP] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[dpc] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[KEY_SEPARATOR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[opc] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[KEY_SEPARATOR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[si] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[RouteAsImpl] identifier[routeAs] operator[=] identifier[route] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[routeAs] operator[==] Other[null] operator[SEP] {
identifier[key] operator[=] operator[SEP] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[dpc] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[KEY_SEPARATOR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[opc] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[KEY_SEPARATOR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[WILDCARD] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[routeAs] operator[=] identifier[route] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[routeAs] operator[==] Other[null] operator[SEP] {
identifier[key] operator[=] operator[SEP] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[dpc] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[KEY_SEPARATOR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[WILDCARD] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[KEY_SEPARATOR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[WILDCARD] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[routeAs] operator[=] identifier[route] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[routeAs] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[int] identifier[count] operator[=] operator[SEP] identifier[sls] operator[&] Keyword[this] operator[SEP] identifier[asSelectionMask] operator[SEP] operator[SEP] identifier[count] operator[=] operator[SEP] identifier[count] operator[>] operator[>] Keyword[this] operator[SEP] identifier[asSlsShiftPlaces] operator[SEP] operator[SEP] Keyword[return] identifier[routeAs] operator[SEP] identifier[getAsForRoute] operator[SEP] identifier[count] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "solidProperty")
public JAXBElement<SolidPropertyType> createSolidProperty(SolidPropertyType value) {
return new JAXBElement<SolidPropertyType>(_SolidProperty_QNAME, SolidPropertyType.class, null, value);
} | class class_name[name] begin[{]
method[createSolidProperty, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_SolidProperty_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SolidPropertyType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SolidPropertyType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[SolidPropertyType] operator[>] identifier[createSolidProperty] operator[SEP] identifier[SolidPropertyType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[SolidPropertyType] operator[>] operator[SEP] identifier[_SolidProperty_QNAME] , identifier[SolidPropertyType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
public void marshall(LinkAttributeUpdate linkAttributeUpdate, ProtocolMarshaller protocolMarshaller) {
if (linkAttributeUpdate == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(linkAttributeUpdate.getAttributeKey(), ATTRIBUTEKEY_BINDING);
protocolMarshaller.marshall(linkAttributeUpdate.getAttributeAction(), ATTRIBUTEACTION_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[linkAttributeUpdate, protocolMarshaller]] begin[{]
if[binary_operation[member[.linkAttributeUpdate], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttributeKey, postfix_operators=[], prefix_operators=[], qualifier=linkAttributeUpdate, selectors=[], type_arguments=None), MemberReference(member=ATTRIBUTEKEY_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttributeAction, postfix_operators=[], prefix_operators=[], qualifier=linkAttributeUpdate, selectors=[], type_arguments=None), MemberReference(member=ATTRIBUTEACTION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[LinkAttributeUpdate] identifier[linkAttributeUpdate] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[linkAttributeUpdate] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[linkAttributeUpdate] operator[SEP] identifier[getAttributeKey] operator[SEP] operator[SEP] , identifier[ATTRIBUTEKEY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[linkAttributeUpdate] operator[SEP] identifier[getAttributeAction] operator[SEP] operator[SEP] , identifier[ATTRIBUTEACTION_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public T havingBodyEqualTo(final String requestBody) {
Validate.notNull(requestBody, "requestBody cannot be null, use an empty string instead");
return havingBody(equalTo(requestBody));
} | class class_name[name] begin[{]
method[havingBodyEqualTo, return_type[type[T]], modifier[public], parameter[requestBody]] begin[{]
call[Validate.notNull, parameter[member[.requestBody], literal["requestBody cannot be null, use an empty string instead"]]]
return[call[.havingBody, parameter[call[.equalTo, parameter[member[.requestBody]]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[havingBodyEqualTo] operator[SEP] Keyword[final] identifier[String] identifier[requestBody] operator[SEP] {
identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[requestBody] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[havingBody] operator[SEP] identifier[equalTo] operator[SEP] identifier[requestBody] operator[SEP] operator[SEP] operator[SEP]
}
|
public static CProduct findByGroupId_First(long groupId,
OrderByComparator<CProduct> orderByComparator)
throws com.liferay.commerce.product.exception.NoSuchCProductException {
return getPersistence().findByGroupId_First(groupId, orderByComparator);
} | class class_name[name] begin[{]
method[findByGroupId_First, return_type[type[CProduct]], modifier[public static], parameter[groupId, orderByComparator]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CProduct] identifier[findByGroupId_First] operator[SEP] Keyword[long] identifier[groupId] , identifier[OrderByComparator] operator[<] identifier[CProduct] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchCProductException] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByGroupId_First] operator[SEP] identifier[groupId] , identifier[orderByComparator] operator[SEP] operator[SEP]
}
|
public static DMatrix2x2 transpose( DMatrix2x2 input , DMatrix2x2 output ) {
if( input == null )
input = new DMatrix2x2();
output.a11 = input.a11;
output.a12 = input.a21;
output.a21 = input.a12;
output.a22 = input.a22;
return output;
} | class class_name[name] begin[{]
method[transpose, return_type[type[DMatrix2x2]], modifier[public static], parameter[input, output]] begin[{]
if[binary_operation[member[.input], ==, literal[null]]] begin[{]
assign[member[.input], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DMatrix2x2, sub_type=None))]
else begin[{]
None
end[}]
assign[member[output.a11], member[input.a11]]
assign[member[output.a12], member[input.a21]]
assign[member[output.a21], member[input.a12]]
assign[member[output.a22], member[input.a22]]
return[member[.output]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[DMatrix2x2] identifier[transpose] operator[SEP] identifier[DMatrix2x2] identifier[input] , identifier[DMatrix2x2] identifier[output] operator[SEP] {
Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] identifier[input] operator[=] Keyword[new] identifier[DMatrix2x2] operator[SEP] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[a11] operator[=] identifier[input] operator[SEP] identifier[a11] operator[SEP] identifier[output] operator[SEP] identifier[a12] operator[=] identifier[input] operator[SEP] identifier[a21] operator[SEP] identifier[output] operator[SEP] identifier[a21] operator[=] identifier[input] operator[SEP] identifier[a12] operator[SEP] identifier[output] operator[SEP] identifier[a22] operator[=] identifier[input] operator[SEP] identifier[a22] operator[SEP] Keyword[return] identifier[output] operator[SEP]
}
|
public void read_lock( Key<Job> job_key ) {
if( _key != null ) {
Log.debug("shared-read-lock "+_key+" by job "+job_key);
new ReadLock(job_key).invoke(_key);
}
} | class class_name[name] begin[{]
method[read_lock, return_type[void], modifier[public], parameter[job_key]] begin[{]
if[binary_operation[member[._key], !=, literal[null]]] begin[{]
call[Log.debug, parameter[binary_operation[binary_operation[binary_operation[literal["shared-read-lock "], +, member[._key]], +, literal[" by job "]], +, member[.job_key]]]]
ClassCreator(arguments=[MemberReference(member=job_key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=_key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ReadLock, sub_type=None))
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[read_lock] operator[SEP] identifier[Key] operator[<] identifier[Job] operator[>] identifier[job_key] operator[SEP] {
Keyword[if] operator[SEP] identifier[_key] operator[!=] Other[null] operator[SEP] {
identifier[Log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[_key] operator[+] literal[String] operator[+] identifier[job_key] operator[SEP] operator[SEP] Keyword[new] identifier[ReadLock] operator[SEP] identifier[job_key] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[_key] operator[SEP] operator[SEP]
}
}
|
@Override
public String listPop(String listName, boolean block) {
return listPop(listName, block, DEFAULT_READ_TIMEOUT_SEC);
} | class class_name[name] begin[{]
method[listPop, return_type[type[String]], modifier[public], parameter[listName, block]] begin[{]
return[call[.listPop, parameter[member[.listName], member[.block], member[.DEFAULT_READ_TIMEOUT_SEC]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[listPop] operator[SEP] identifier[String] identifier[listName] , Keyword[boolean] identifier[block] operator[SEP] {
Keyword[return] identifier[listPop] operator[SEP] identifier[listName] , identifier[block] , identifier[DEFAULT_READ_TIMEOUT_SEC] operator[SEP] operator[SEP]
}
|
public ApiResponse<ApiSuccessResponse> getInteractionDetailsFromWorkbinWithHttpInfo(String interactionId, GetDetailsData getDetailsData) throws ApiException {
com.squareup.okhttp.Call call = getInteractionDetailsFromWorkbinValidateBeforeCall(interactionId, getDetailsData, null, null);
Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
return apiClient.execute(call, localVarReturnType);
} | class class_name[name] begin[{]
method[getInteractionDetailsFromWorkbinWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[interactionId, getDetailsData]] begin[{]
local_variable[type[com], call]
local_variable[type[Type], localVarReturnType]
return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]]
end[}]
END[}] | Keyword[public] identifier[ApiResponse] operator[<] identifier[ApiSuccessResponse] operator[>] identifier[getInteractionDetailsFromWorkbinWithHttpInfo] operator[SEP] identifier[String] identifier[interactionId] , identifier[GetDetailsData] identifier[getDetailsData] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[getInteractionDetailsFromWorkbinValidateBeforeCall] operator[SEP] identifier[interactionId] , identifier[getDetailsData] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[ApiSuccessResponse] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP]
}
|
public static boolean equalsTopElement(final LinkedList<String> stack, final String str) {
if(stack.isEmpty()) {
return false;
}
return stack.peekFirst().equals(str);
} | class class_name[name] begin[{]
method[equalsTopElement, return_type[type[boolean]], modifier[public static], parameter[stack, str]] begin[{]
if[call[stack.isEmpty, parameter[]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[call[stack.peekFirst, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[equalsTopElement] operator[SEP] Keyword[final] identifier[LinkedList] operator[<] identifier[String] operator[>] identifier[stack] , Keyword[final] identifier[String] identifier[str] operator[SEP] {
Keyword[if] operator[SEP] identifier[stack] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] identifier[stack] operator[SEP] identifier[peekFirst] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[str] operator[SEP] operator[SEP]
}
|
public void updateDatabase(String pool) {
Map<String, String> dbPoolData = new HashMap<String, String>(m_dbPools.get(pool));
// display info
System.out.println("JDBC Driver: " + getDbDriver(pool));
System.out.println("JDBC Connection Url: " + getDbUrl(pool));
System.out.println("JDBC Connection Url Params: " + getDbParams(pool));
System.out.println("Database User: " + getDbUser(pool));
// get the db implementation name
String dbName = getDbName();
String name = null;
if (dbName.indexOf("mysql") > -1) {
getMySqlEngine(dbPoolData);
name = "mysql";
} else if (dbName.indexOf("oracle") > -1) {
getOracleTablespaces(dbPoolData);
name = "oracle";
} else if (dbName.indexOf("postgresql") > -1) {
getPostgreSqlTablespaces(dbPoolData);
name = "postgresql";
} else {
System.out.println("db " + dbName + " not supported");
return;
}
// execute update
Iterator<I_CmsUpdateDBPart> it = m_plugins.iterator();
while (it.hasNext()) {
I_CmsUpdateDBPart updatePart = it.next();
I_CmsUpdateDBPart dbUpdater = getInstanceForDb(updatePart, name);
if (dbUpdater != null) {
dbUpdater.execute(dbPoolData);
}
}
} | class class_name[name] begin[{]
method[updateDatabase, return_type[void], modifier[public], parameter[pool]] begin[{]
local_variable[type[Map], dbPoolData]
call[System.out.println, parameter[binary_operation[literal["JDBC Driver: "], +, call[.getDbDriver, parameter[member[.pool]]]]]]
call[System.out.println, parameter[binary_operation[literal["JDBC Connection Url: "], +, call[.getDbUrl, parameter[member[.pool]]]]]]
call[System.out.println, parameter[binary_operation[literal["JDBC Connection Url Params: "], +, call[.getDbParams, parameter[member[.pool]]]]]]
call[System.out.println, parameter[binary_operation[literal["Database User: "], +, call[.getDbUser, parameter[member[.pool]]]]]]
local_variable[type[String], dbName]
local_variable[type[String], name]
if[binary_operation[call[dbName.indexOf, parameter[literal["mysql"]]], >, literal[1]]] begin[{]
call[.getMySqlEngine, parameter[member[.dbPoolData]]]
assign[member[.name], literal["mysql"]]
else begin[{]
if[binary_operation[call[dbName.indexOf, parameter[literal["oracle"]]], >, literal[1]]] begin[{]
call[.getOracleTablespaces, parameter[member[.dbPoolData]]]
assign[member[.name], literal["oracle"]]
else begin[{]
if[binary_operation[call[dbName.indexOf, parameter[literal["postgresql"]]], >, literal[1]]] begin[{]
call[.getPostgreSqlTablespaces, parameter[member[.dbPoolData]]]
assign[member[.name], literal["postgresql"]]
else begin[{]
call[System.out.println, parameter[binary_operation[binary_operation[literal["db "], +, member[.dbName]], +, literal[" not supported"]]]]
return[None]
end[}]
end[}]
end[}]
local_variable[type[Iterator], it]
while[call[it.hasNext, parameter[]]] begin[{]
local_variable[type[I_CmsUpdateDBPart], updatePart]
local_variable[type[I_CmsUpdateDBPart], dbUpdater]
if[binary_operation[member[.dbUpdater], !=, literal[null]]] begin[{]
call[dbUpdater.execute, parameter[member[.dbPoolData]]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[updateDatabase] operator[SEP] identifier[String] identifier[pool] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[dbPoolData] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] identifier[m_dbPools] operator[SEP] identifier[get] operator[SEP] identifier[pool] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[getDbDriver] operator[SEP] identifier[pool] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[getDbUrl] operator[SEP] identifier[pool] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[getDbParams] operator[SEP] identifier[pool] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[getDbUser] operator[SEP] identifier[pool] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[dbName] operator[=] identifier[getDbName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[dbName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[getMySqlEngine] operator[SEP] identifier[dbPoolData] operator[SEP] operator[SEP] identifier[name] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dbName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[getOracleTablespaces] operator[SEP] identifier[dbPoolData] operator[SEP] operator[SEP] identifier[name] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dbName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[getPostgreSqlTablespaces] operator[SEP] identifier[dbPoolData] operator[SEP] operator[SEP] identifier[name] operator[=] literal[String] operator[SEP]
}
Keyword[else] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[dbName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[Iterator] operator[<] identifier[I_CmsUpdateDBPart] operator[>] identifier[it] operator[=] identifier[m_plugins] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[I_CmsUpdateDBPart] identifier[updatePart] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[I_CmsUpdateDBPart] identifier[dbUpdater] operator[=] identifier[getInstanceForDb] operator[SEP] identifier[updatePart] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dbUpdater] operator[!=] Other[null] operator[SEP] {
identifier[dbUpdater] operator[SEP] identifier[execute] operator[SEP] identifier[dbPoolData] operator[SEP] operator[SEP]
}
}
}
|
private void addPostParams(final Request request) {
if (qualityScore != null) {
request.addPostParam("QualityScore", qualityScore.toString());
}
if (issue != null) {
for (Feedback.Issues prop : issue) {
request.addPostParam("Issue", prop.toString());
}
}
} | class class_name[name] begin[{]
method[addPostParams, return_type[void], modifier[private], parameter[request]] begin[{]
if[binary_operation[member[.qualityScore], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["QualityScore"], call[qualityScore.toString, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.issue], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Issue"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None)], member=addPostParam, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=issue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Feedback, sub_type=ReferenceType(arguments=None, dimensions=None, name=Issues, sub_type=None)))), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addPostParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] {
Keyword[if] operator[SEP] identifier[qualityScore] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[qualityScore] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[issue] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Feedback] operator[SEP] identifier[Issues] identifier[prop] operator[:] identifier[issue] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[prop] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static void getShare (Activity context, ShareGetListener listener, long id) {
proxy.getShare(context, listener, id);
} | class class_name[name] begin[{]
method[getShare, return_type[void], modifier[public static], parameter[context, listener, id]] begin[{]
call[proxy.getShare, parameter[member[.context], member[.listener], member[.id]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[getShare] operator[SEP] identifier[Activity] identifier[context] , identifier[ShareGetListener] identifier[listener] , Keyword[long] identifier[id] operator[SEP] {
identifier[proxy] operator[SEP] identifier[getShare] operator[SEP] identifier[context] , identifier[listener] , identifier[id] operator[SEP] operator[SEP]
}
|
public static NumericEqualsCondition.Builder eq(String variable, long expectedValue) {
return NumericEqualsCondition.builder().variable(variable).expectedValue(expectedValue);
} | class class_name[name] begin[{]
method[eq, return_type[type[NumericEqualsCondition]], modifier[public static], parameter[variable, expectedValue]] begin[{]
return[call[NumericEqualsCondition.builder, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[NumericEqualsCondition] operator[SEP] identifier[Builder] identifier[eq] operator[SEP] identifier[String] identifier[variable] , Keyword[long] identifier[expectedValue] operator[SEP] {
Keyword[return] identifier[NumericEqualsCondition] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[variable] operator[SEP] identifier[variable] operator[SEP] operator[SEP] identifier[expectedValue] operator[SEP] identifier[expectedValue] operator[SEP] operator[SEP]
}
|
public SearchResponse searchAllWithTargetCount(String index, String type) {
return searchAllWithTargetCount(index, type, null, null);
} | class class_name[name] begin[{]
method[searchAllWithTargetCount, return_type[type[SearchResponse]], modifier[public], parameter[index, type]] begin[{]
return[call[.searchAllWithTargetCount, parameter[member[.index], member[.type], literal[null], literal[null]]]]
end[}]
END[}] | Keyword[public] identifier[SearchResponse] identifier[searchAllWithTargetCount] operator[SEP] identifier[String] identifier[index] , identifier[String] identifier[type] operator[SEP] {
Keyword[return] identifier[searchAllWithTargetCount] operator[SEP] identifier[index] , identifier[type] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
public boolean containsMember(Address mbr) {
if(mbr == null || members == null)
return false;
for(Address member: members)
if(Objects.equals(member, mbr))
return true;
return false;
} | class class_name[name] begin[{]
method[containsMember, return_type[type[boolean]], modifier[public], parameter[mbr]] begin[{]
if[binary_operation[binary_operation[member[.mbr], ==, literal[null]], ||, binary_operation[member[.members], ==, literal[null]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mbr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=Objects, 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=MemberReference(member=members, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=member)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Address, sub_type=None))), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[containsMember] operator[SEP] identifier[Address] identifier[mbr] operator[SEP] {
Keyword[if] operator[SEP] identifier[mbr] operator[==] Other[null] operator[||] identifier[members] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Address] identifier[member] operator[:] identifier[members] operator[SEP] Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[member] , identifier[mbr] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public static double toDouble(String s) {
if ("+inf".equals(s) || "inf".equals(s)) {
return Double.POSITIVE_INFINITY;
}
if ("-inf".equals(s)) {
return Double.NEGATIVE_INFINITY;
}
return Double.parseDouble(s);
} | class class_name[name] begin[{]
method[toDouble, return_type[type[double]], modifier[public static], parameter[s]] begin[{]
if[binary_operation[literal["+inf"], ||, literal["inf"]]] begin[{]
return[member[Double.POSITIVE_INFINITY]]
else begin[{]
None
end[}]
if[literal["-inf"]] begin[{]
return[member[Double.NEGATIVE_INFINITY]]
else begin[{]
None
end[}]
return[call[Double.parseDouble, parameter[member[.s]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[toDouble] operator[SEP] identifier[String] identifier[s] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP]
}
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[NEGATIVE_INFINITY] operator[SEP]
}
Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
|
public void setTxtColor(Integer newTxtColor) {
Integer oldTxtColor = txtColor;
txtColor = newTxtColor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.LND__TXT_COLOR, oldTxtColor, txtColor));
} | class class_name[name] begin[{]
method[setTxtColor, return_type[void], modifier[public], parameter[newTxtColor]] begin[{]
local_variable[type[Integer], oldTxtColor]
assign[member[.txtColor], member[.newTxtColor]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=LND__TXT_COLOR, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldTxtColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=txtColor, 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=ENotificationImpl, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setTxtColor] operator[SEP] identifier[Integer] identifier[newTxtColor] operator[SEP] {
identifier[Integer] identifier[oldTxtColor] operator[=] identifier[txtColor] operator[SEP] identifier[txtColor] operator[=] identifier[newTxtColor] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[LND__TXT_COLOR] , identifier[oldTxtColor] , identifier[txtColor] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public String path() {
try {
return new URI(request.uri()).getRawPath();
} catch (URISyntaxException e) { //NOSONAR
// Should never be the case.
return uri();
}
} | class class_name[name] begin[{]
method[path, return_type[type[String]], modifier[public], parameter[]] begin[{]
TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=uri, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRawPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[path] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] Keyword[new] identifier[URI] operator[SEP] identifier[request] operator[SEP] identifier[uri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getRawPath] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] {
Keyword[return] identifier[uri] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void emitRecord(String contextName, String recordName, OutputRecord outRec)
throws IOException
{
Calendar currentDate = Calendar.getInstance();
if (fileName != null) {
if (currentDate.get(Calendar.DAY_OF_MONTH) != lastRecordDate.get(Calendar.DAY_OF_MONTH)) {
// rotate to a new context file
file = new File(getFullFileName(currentDate));
if (writer != null)
writer.close();
writer = new PrintWriter(new FileWriter(file, true));
}
}
writer.print(recordDateFormat.format(currentDate.getTime()));
writer.print(" ");
writer.print(contextName);
writer.print(".");
writer.print(recordName);
String separator = ": ";
for (String tagName : outRec.getTagNames()) {
writer.print(separator);
separator = ", ";
writer.print(tagName);
writer.print("=");
writer.print(outRec.getTag(tagName));
}
for (String metricName : outRec.getMetricNames()) {
writer.print(separator);
separator = ", ";
writer.print(metricName);
writer.print("=");
writer.print(outRec.getMetric(metricName));
}
writer.println();
lastRecordDate = currentDate;
} | class class_name[name] begin[{]
method[emitRecord, return_type[void], modifier[public], parameter[contextName, recordName, outRec]] begin[{]
local_variable[type[Calendar], currentDate]
if[binary_operation[member[.fileName], !=, literal[null]]] begin[{]
if[binary_operation[call[currentDate.get, parameter[member[Calendar.DAY_OF_MONTH]]], !=, call[lastRecordDate.get, parameter[member[Calendar.DAY_OF_MONTH]]]]] begin[{]
assign[member[.file], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=currentDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFullFileName, 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=File, sub_type=None))]
if[binary_operation[member[.writer], !=, literal[null]]] begin[{]
call[writer.close, parameter[]]
else begin[{]
None
end[}]
assign[member[.writer], ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrintWriter, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[writer.print, parameter[call[recordDateFormat.format, parameter[call[currentDate.getTime, parameter[]]]]]]
call[writer.print, parameter[literal[" "]]]
call[writer.print, parameter[member[.contextName]]]
call[writer.print, parameter[literal["."]]]
call[writer.print, parameter[member[.recordName]]]
local_variable[type[String], separator]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=outRec, selectors=[], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTagNames, postfix_operators=[], prefix_operators=[], qualifier=outRec, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tagName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=metricName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=metricName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMetric, postfix_operators=[], prefix_operators=[], qualifier=outRec, selectors=[], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMetricNames, postfix_operators=[], prefix_operators=[], qualifier=outRec, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=metricName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[writer.println, parameter[]]
assign[member[.lastRecordDate], member[.currentDate]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[emitRecord] operator[SEP] identifier[String] identifier[contextName] , identifier[String] identifier[recordName] , identifier[OutputRecord] identifier[outRec] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Calendar] identifier[currentDate] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileName] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentDate] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_MONTH] operator[SEP] operator[!=] identifier[lastRecordDate] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_MONTH] operator[SEP] operator[SEP] {
identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[getFullFileName] operator[SEP] identifier[currentDate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[writer] operator[!=] Other[null] operator[SEP] identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] Keyword[new] identifier[FileWriter] operator[SEP] identifier[file] , literal[boolean] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[recordDateFormat] operator[SEP] identifier[format] operator[SEP] identifier[currentDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[contextName] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[recordName] operator[SEP] operator[SEP] identifier[String] identifier[separator] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[tagName] operator[:] identifier[outRec] operator[SEP] identifier[getTagNames] operator[SEP] operator[SEP] operator[SEP] {
identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[separator] operator[SEP] operator[SEP] identifier[separator] operator[=] literal[String] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[outRec] operator[SEP] identifier[getTag] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[metricName] operator[:] identifier[outRec] operator[SEP] identifier[getMetricNames] operator[SEP] operator[SEP] operator[SEP] {
identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[separator] operator[SEP] operator[SEP] identifier[separator] operator[=] literal[String] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[metricName] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[outRec] operator[SEP] identifier[getMetric] operator[SEP] identifier[metricName] operator[SEP] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] identifier[lastRecordDate] operator[=] identifier[currentDate] operator[SEP]
}
|
protected void submit() {
CmsLoginMessage loginMessage = new CmsLoginMessage();
CmsLoginMessage beforeLoginMessage = new CmsLoginMessage();
try {
m_formBinderAfter.writeBean(loginMessage);
m_formBinderBefore.writeBean(beforeLoginMessage);
OpenCms.getLoginManager().setLoginMessage(A_CmsUI.getCmsObject(), loginMessage);
OpenCms.getLoginManager().setBeforeLoginMessage(A_CmsUI.getCmsObject(), beforeLoginMessage);
// update the system configuration
OpenCms.writeConfiguration(CmsVariablesConfiguration.class);
} catch (Exception e) {
LOG.error("Unable to save Login Message", e);
}
} | class class_name[name] begin[{]
method[submit, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[CmsLoginMessage], loginMessage]
local_variable[type[CmsLoginMessage], beforeLoginMessage]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=loginMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeBean, postfix_operators=[], prefix_operators=[], qualifier=m_formBinderAfter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=beforeLoginMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeBean, postfix_operators=[], prefix_operators=[], qualifier=m_formBinderBefore, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getLoginManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCmsObject, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUI, selectors=[], type_arguments=None), MemberReference(member=loginMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLoginMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getLoginManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCmsObject, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUI, selectors=[], type_arguments=None), MemberReference(member=beforeLoginMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setBeforeLoginMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsVariablesConfiguration, sub_type=None))], member=writeConfiguration, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to save Login Message"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[submit] operator[SEP] operator[SEP] {
identifier[CmsLoginMessage] identifier[loginMessage] operator[=] Keyword[new] identifier[CmsLoginMessage] operator[SEP] operator[SEP] operator[SEP] identifier[CmsLoginMessage] identifier[beforeLoginMessage] operator[=] Keyword[new] identifier[CmsLoginMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[m_formBinderAfter] operator[SEP] identifier[writeBean] operator[SEP] identifier[loginMessage] operator[SEP] operator[SEP] identifier[m_formBinderBefore] operator[SEP] identifier[writeBean] operator[SEP] identifier[beforeLoginMessage] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getLoginManager] operator[SEP] operator[SEP] operator[SEP] identifier[setLoginMessage] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] , identifier[loginMessage] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getLoginManager] operator[SEP] operator[SEP] operator[SEP] identifier[setBeforeLoginMessage] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] , identifier[beforeLoginMessage] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[writeConfiguration] operator[SEP] identifier[CmsVariablesConfiguration] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static Integer getIntegerValue(QuerySolution resultRow, String variableName) {
if (resultRow != null) {
Resource res = resultRow.getResource(variableName);
if (res != null && res.isLiteral()) {
Literal val = res.asLiteral();
if (val != null) {
return Integer.valueOf(val.getInt());
}
}
}
return null;
} | class class_name[name] begin[{]
method[getIntegerValue, return_type[type[Integer]], modifier[public static], parameter[resultRow, variableName]] begin[{]
if[binary_operation[member[.resultRow], !=, literal[null]]] begin[{]
local_variable[type[Resource], res]
if[binary_operation[binary_operation[member[.res], !=, literal[null]], &&, call[res.isLiteral, parameter[]]]] begin[{]
local_variable[type[Literal], val]
if[binary_operation[member[.val], !=, literal[null]]] begin[{]
return[call[Integer.valueOf, parameter[call[val.getInt, parameter[]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Integer] identifier[getIntegerValue] operator[SEP] identifier[QuerySolution] identifier[resultRow] , identifier[String] identifier[variableName] operator[SEP] {
Keyword[if] operator[SEP] identifier[resultRow] operator[!=] Other[null] operator[SEP] {
identifier[Resource] identifier[res] operator[=] identifier[resultRow] operator[SEP] identifier[getResource] operator[SEP] identifier[variableName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[!=] Other[null] operator[&&] identifier[res] operator[SEP] identifier[isLiteral] operator[SEP] operator[SEP] operator[SEP] {
identifier[Literal] identifier[val] operator[=] identifier[res] operator[SEP] identifier[asLiteral] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[val] operator[SEP] identifier[getInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static void newRecord(HashMap m, String path) {
if( path != null ) {
String[] paths = path.split(",");
int l = paths.length;
for(int i=0; i < l; i++) {
if( paths[i].contains("@") ) {
String temp[] = paths[i].split("[@!]");
buildPath(m, paths[i]);
HashMap pointer = traverseToPoint(m, temp[0]);
ArrayList a = (ArrayList) pointer.get(temp[1]);
a.add(new HashMap());
}
}
}
} | class class_name[name] begin[{]
method[newRecord, return_type[void], modifier[public static], parameter[m, path]] begin[{]
if[binary_operation[member[.path], !=, literal[null]]] begin[{]
local_variable[type[String], paths]
local_variable[type[int], l]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@")], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[@!]")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=temp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=buildPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=traverseToPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=pointer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HashMap, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=pointer, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ArrayList, sub_type=None)), name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ArrayList, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=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=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[newRecord] operator[SEP] identifier[HashMap] identifier[m] , identifier[String] identifier[path] operator[SEP] {
Keyword[if] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[paths] operator[=] identifier[path] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[l] operator[=] identifier[paths] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[l] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[paths] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[String] identifier[temp] operator[SEP] operator[SEP] operator[=] identifier[paths] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buildPath] operator[SEP] identifier[m] , identifier[paths] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[HashMap] identifier[pointer] operator[=] identifier[traverseToPoint] operator[SEP] identifier[m] , identifier[temp] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] identifier[a] operator[=] operator[SEP] identifier[ArrayList] operator[SEP] identifier[pointer] operator[SEP] identifier[get] operator[SEP] identifier[temp] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
|
public Resource addReference(Reference reference) {
Resource resource = this.rdfWriter.getUri(Vocabulary.getReferenceUri(reference));
this.referenceQueue.add(reference);
this.referenceSubjectQueue.add(resource);
return resource;
} | class class_name[name] begin[{]
method[addReference, return_type[type[Resource]], modifier[public], parameter[reference]] begin[{]
local_variable[type[Resource], resource]
THIS[member[None.referenceQueue]call[None.add, parameter[member[.reference]]]]
THIS[member[None.referenceSubjectQueue]call[None.add, parameter[member[.resource]]]]
return[member[.resource]]
end[}]
END[}] | Keyword[public] identifier[Resource] identifier[addReference] operator[SEP] identifier[Reference] identifier[reference] operator[SEP] {
identifier[Resource] identifier[resource] operator[=] Keyword[this] operator[SEP] identifier[rdfWriter] operator[SEP] identifier[getUri] operator[SEP] identifier[Vocabulary] operator[SEP] identifier[getReferenceUri] operator[SEP] identifier[reference] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[referenceQueue] operator[SEP] identifier[add] operator[SEP] identifier[reference] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[referenceSubjectQueue] operator[SEP] identifier[add] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[return] identifier[resource] operator[SEP]
}
|
public static IOException createCompositeException(Collection<IOException> innerExceptions) {
checkArgument(
innerExceptions != null && !innerExceptions.isEmpty(),
"innerExceptions (%s) must be not null and contain at least one element", innerExceptions);
Iterator<IOException> innerExceptionIterator = innerExceptions.iterator();
if (innerExceptions.size() == 1) {
return innerExceptionIterator.next();
}
IOException combined = new IOException("Multiple IOExceptions.");
while (innerExceptionIterator.hasNext()) {
combined.addSuppressed(innerExceptionIterator.next());
}
return combined;
} | class class_name[name] begin[{]
method[createCompositeException, return_type[type[IOException]], modifier[public static], parameter[innerExceptions]] begin[{]
call[.checkArgument, parameter[binary_operation[binary_operation[member[.innerExceptions], !=, literal[null]], &&, call[innerExceptions.isEmpty, parameter[]]], literal["innerExceptions (%s) must be not null and contain at least one element"], member[.innerExceptions]]]
local_variable[type[Iterator], innerExceptionIterator]
if[binary_operation[call[innerExceptions.size, parameter[]], ==, literal[1]]] begin[{]
return[call[innerExceptionIterator.next, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[IOException], combined]
while[call[innerExceptionIterator.hasNext, parameter[]]] begin[{]
call[combined.addSuppressed, parameter[call[innerExceptionIterator.next, parameter[]]]]
end[}]
return[member[.combined]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IOException] identifier[createCompositeException] operator[SEP] identifier[Collection] operator[<] identifier[IOException] operator[>] identifier[innerExceptions] operator[SEP] {
identifier[checkArgument] operator[SEP] identifier[innerExceptions] operator[!=] Other[null] operator[&&] operator[!] identifier[innerExceptions] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] , literal[String] , identifier[innerExceptions] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[IOException] operator[>] identifier[innerExceptionIterator] operator[=] identifier[innerExceptions] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[innerExceptions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[return] identifier[innerExceptionIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP]
}
identifier[IOException] identifier[combined] operator[=] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[innerExceptionIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[combined] operator[SEP] identifier[addSuppressed] operator[SEP] identifier[innerExceptionIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[combined] operator[SEP]
}
|
@Nonnull
public Serializable serializeState ()
{
final ICommonsMap <String, Object> aState = new CommonsHashMap <> ();
for (final Map.Entry <String, Object> entry : m_aAttributes.entrySet ())
{
final String sName = entry.getKey ();
final Object aValue = entry.getValue ();
if (aValue instanceof Serializable)
{
aState.put (sName, aValue);
}
else
{
// Not serializable... Servlet containers usually automatically
// unbind the attribute in this case.
if (aValue instanceof HttpSessionBindingListener)
{
((HttpSessionBindingListener) aValue).valueUnbound (new HttpSessionBindingEvent (this, sName, aValue));
}
}
}
m_aAttributes.clear ();
return aState;
} | class class_name[name] begin[{]
method[serializeState, return_type[type[Serializable]], modifier[public], parameter[]] begin[{]
local_variable[type[ICommonsMap], aState]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=sName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=aValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Serializable, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=HttpSessionBindingListener, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=aValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HttpSessionBindingListener, sub_type=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=aState, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=m_aAttributes, 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=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
call[m_aAttributes.clear, parameter[]]
return[member[.aState]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] identifier[Serializable] identifier[serializeState] operator[SEP] operator[SEP] {
Keyword[final] identifier[ICommonsMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[aState] operator[=] Keyword[new] identifier[CommonsHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[m_aAttributes] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[sName] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[aValue] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aValue] Keyword[instanceof] identifier[Serializable] operator[SEP] {
identifier[aState] operator[SEP] identifier[put] operator[SEP] identifier[sName] , identifier[aValue] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[aValue] Keyword[instanceof] identifier[HttpSessionBindingListener] operator[SEP] {
operator[SEP] operator[SEP] identifier[HttpSessionBindingListener] operator[SEP] identifier[aValue] operator[SEP] operator[SEP] identifier[valueUnbound] operator[SEP] Keyword[new] identifier[HttpSessionBindingEvent] operator[SEP] Keyword[this] , identifier[sName] , identifier[aValue] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[m_aAttributes] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[aState] operator[SEP]
}
|
private File findPathResource(@NonNull String httpPath) {
if ("/".equals(httpPath)) {
File root = new File(mRootPath);
return root.exists() ? root : null;
} else {
File sourceFile = new File(mRootPath, httpPath);
if (sourceFile.exists()) {
return sourceFile;
}
}
return null;
} | class class_name[name] begin[{]
method[findPathResource, return_type[type[File]], modifier[private], parameter[httpPath]] begin[{]
if[literal["/"]] begin[{]
local_variable[type[File], root]
return[TernaryExpression(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
local_variable[type[File], sourceFile]
if[call[sourceFile.exists, parameter[]]] begin[{]
return[member[.sourceFile]]
else begin[{]
None
end[}]
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[File] identifier[findPathResource] operator[SEP] annotation[@] identifier[NonNull] identifier[String] identifier[httpPath] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[httpPath] operator[SEP] operator[SEP] {
identifier[File] identifier[root] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[mRootPath] operator[SEP] operator[SEP] Keyword[return] identifier[root] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[?] identifier[root] operator[:] Other[null] operator[SEP]
}
Keyword[else] {
identifier[File] identifier[sourceFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[mRootPath] , identifier[httpPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sourceFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[sourceFile] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public Matrix4f lookAt(float eyeX, float eyeY, float eyeZ,
float centerX, float centerY, float centerZ,
float upX, float upY, float upZ, Matrix4f dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
else if ((properties & PROPERTY_PERSPECTIVE) != 0)
return lookAtPerspective(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ, dest);
return lookAtGeneric(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ, dest);
} | class class_name[name] begin[{]
method[lookAt, return_type[type[Matrix4f]], modifier[public], parameter[eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ, dest]] begin[{]
if[binary_operation[binary_operation[member[.properties], &, member[.PROPERTY_IDENTITY]], !=, literal[0]]] begin[{]
return[call[dest.setLookAt, parameter[member[.eyeX], member[.eyeY], member[.eyeZ], member[.centerX], member[.centerY], member[.centerZ], member[.upX], member[.upY], member[.upZ]]]]
else begin[{]
if[binary_operation[binary_operation[member[.properties], &, member[.PROPERTY_PERSPECTIVE]], !=, literal[0]]] begin[{]
return[call[.lookAtPerspective, parameter[member[.eyeX], member[.eyeY], member[.eyeZ], member[.centerX], member[.centerY], member[.centerZ], member[.upX], member[.upY], member[.upZ], member[.dest]]]]
else begin[{]
None
end[}]
end[}]
return[call[.lookAtGeneric, parameter[member[.eyeX], member[.eyeY], member[.eyeZ], member[.centerX], member[.centerY], member[.centerZ], member[.upX], member[.upY], member[.upZ], member[.dest]]]]
end[}]
END[}] | Keyword[public] identifier[Matrix4f] identifier[lookAt] operator[SEP] Keyword[float] identifier[eyeX] , Keyword[float] identifier[eyeY] , Keyword[float] identifier[eyeZ] , Keyword[float] identifier[centerX] , Keyword[float] identifier[centerY] , Keyword[float] identifier[centerZ] , Keyword[float] identifier[upX] , Keyword[float] identifier[upY] , Keyword[float] identifier[upZ] , identifier[Matrix4f] identifier[dest] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[properties] operator[&] identifier[PROPERTY_IDENTITY] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[return] identifier[dest] operator[SEP] identifier[setLookAt] operator[SEP] identifier[eyeX] , identifier[eyeY] , identifier[eyeZ] , identifier[centerX] , identifier[centerY] , identifier[centerZ] , identifier[upX] , identifier[upY] , identifier[upZ] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[properties] operator[&] identifier[PROPERTY_PERSPECTIVE] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[return] identifier[lookAtPerspective] operator[SEP] identifier[eyeX] , identifier[eyeY] , identifier[eyeZ] , identifier[centerX] , identifier[centerY] , identifier[centerZ] , identifier[upX] , identifier[upY] , identifier[upZ] , identifier[dest] operator[SEP] operator[SEP] Keyword[return] identifier[lookAtGeneric] operator[SEP] identifier[eyeX] , identifier[eyeY] , identifier[eyeZ] , identifier[centerX] , identifier[centerY] , identifier[centerZ] , identifier[upX] , identifier[upY] , identifier[upZ] , identifier[dest] operator[SEP] operator[SEP]
}
|
protected void releasing(ByteBuffer buffer) {
if (buffer != null && buffer.isDirect()) {
DirectByteBufferHelper directByteBufferHelper = this.directByteBufferHelper.get();
if (directByteBufferHelper != null) {
directByteBufferHelper.releaseDirectByteBuffer(buffer);
}
}
} | class class_name[name] begin[{]
method[releasing, return_type[void], modifier[protected], parameter[buffer]] begin[{]
if[binary_operation[binary_operation[member[.buffer], !=, literal[null]], &&, call[buffer.isDirect, parameter[]]]] begin[{]
local_variable[type[DirectByteBufferHelper], directByteBufferHelper]
if[binary_operation[member[.directByteBufferHelper], !=, literal[null]]] begin[{]
call[directByteBufferHelper.releaseDirectByteBuffer, parameter[member[.buffer]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[releasing] operator[SEP] identifier[ByteBuffer] identifier[buffer] operator[SEP] {
Keyword[if] operator[SEP] identifier[buffer] operator[!=] Other[null] operator[&&] identifier[buffer] operator[SEP] identifier[isDirect] operator[SEP] operator[SEP] operator[SEP] {
identifier[DirectByteBufferHelper] identifier[directByteBufferHelper] operator[=] Keyword[this] operator[SEP] identifier[directByteBufferHelper] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[directByteBufferHelper] operator[!=] Other[null] operator[SEP] {
identifier[directByteBufferHelper] operator[SEP] identifier[releaseDirectByteBuffer] operator[SEP] identifier[buffer] operator[SEP] operator[SEP]
}
}
}
|
private static void copyStreamWithoutClosing( InputStream in, OutputStream out ) throws IOException
{
final int bufferSize = 4096;
byte[] b = new byte[ bufferSize ];
int n;
while ( ( n = in.read( b ) ) != - 1 )
{
out.write( b, 0, n );
}
} | class class_name[name] begin[{]
method[copyStreamWithoutClosing, return_type[void], modifier[private static], parameter[in, out]] begin[{]
local_variable[type[int], bufferSize]
local_variable[type[byte], b]
local_variable[type[int], n]
while[binary_operation[assign[member[.n], call[in.read, parameter[member[.b]]]], !=, literal[1]]] begin[{]
call[out.write, parameter[member[.b], literal[0], member[.n]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[copyStreamWithoutClosing] operator[SEP] identifier[InputStream] identifier[in] , identifier[OutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] Keyword[int] identifier[bufferSize] operator[=] Other[4096] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[bufferSize] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[n] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[b] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[b] , Other[0] , identifier[n] operator[SEP] operator[SEP]
}
}
|
private boolean isAceExcluded(final List<AceFlag> aceFlags, final AceFlag excludedFlag) {
boolean res = false;
if (excludedFlag != null) {
// aceFlags could be null if the ACE applies to 'this object only' and has no other flags set
if (aceFlags != null && !aceFlags.isEmpty() && aceFlags.contains(excludedFlag)) {
res = true;
}
}
LOG.debug("isAceExcluded, result: {}", res);
return res;
} | class class_name[name] begin[{]
method[isAceExcluded, return_type[type[boolean]], modifier[private], parameter[aceFlags, excludedFlag]] begin[{]
local_variable[type[boolean], res]
if[binary_operation[member[.excludedFlag], !=, literal[null]]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.aceFlags], !=, literal[null]], &&, call[aceFlags.isEmpty, parameter[]]], &&, call[aceFlags.contains, parameter[member[.excludedFlag]]]]] begin[{]
assign[member[.res], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[LOG.debug, parameter[literal["isAceExcluded, result: {}"], member[.res]]]
return[member[.res]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isAceExcluded] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[AceFlag] operator[>] identifier[aceFlags] , Keyword[final] identifier[AceFlag] identifier[excludedFlag] operator[SEP] {
Keyword[boolean] identifier[res] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[excludedFlag] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[aceFlags] operator[!=] Other[null] operator[&&] operator[!] identifier[aceFlags] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[aceFlags] operator[SEP] identifier[contains] operator[SEP] identifier[excludedFlag] operator[SEP] operator[SEP] {
identifier[res] operator[=] literal[boolean] operator[SEP]
}
}
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[res] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP]
}
|
protected void setSubject(Subject subject) {
Subject currentSubject = this.subject;
if (!(currentSubject == null && subject == null)) {
this.subject = subject;
if (currentThread() == ioThread) {
notifySubjectChanged(subject);
}
else {
final Subject changedSubject = subject;
ioExecutor.execute(new Runnable() {
@Override
public void run() {
notifySubjectChanged(changedSubject);
}
});
}
}
} | class class_name[name] begin[{]
method[setSubject, return_type[void], modifier[protected], parameter[subject]] begin[{]
local_variable[type[Subject], currentSubject]
if[binary_operation[binary_operation[member[.currentSubject], ==, literal[null]], &&, binary_operation[member[.subject], ==, literal[null]]]] begin[{]
assign[THIS[member[None.subject]], member[.subject]]
if[binary_operation[call[.currentThread, parameter[]], ==, member[.ioThread]]] begin[{]
call[.notifySubjectChanged, parameter[member[.subject]]]
else begin[{]
local_variable[type[Subject], changedSubject]
call[ioExecutor.execute, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=changedSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=notifySubjectChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[setSubject] operator[SEP] identifier[Subject] identifier[subject] operator[SEP] {
identifier[Subject] identifier[currentSubject] operator[=] Keyword[this] operator[SEP] identifier[subject] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[currentSubject] operator[==] Other[null] operator[&&] identifier[subject] operator[==] Other[null] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[subject] operator[=] identifier[subject] operator[SEP] Keyword[if] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[==] identifier[ioThread] operator[SEP] {
identifier[notifySubjectChanged] operator[SEP] identifier[subject] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[Subject] identifier[changedSubject] operator[=] identifier[subject] operator[SEP] identifier[ioExecutor] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[notifySubjectChanged] operator[SEP] identifier[changedSubject] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
}
}
|
protected final FactoryAccountingEntries
createPutFactoryAccountingEntries() throws Exception {
FactoryAccountingEntries factory = new FactoryAccountingEntries();
factory.setDatabaseId(this.srvDatabase.getIdDatabase());
//assigning fully initialized object:
this.factoriesMap
.put(AccountingEntries.class, factory);
return factory;
} | class class_name[name] begin[{]
method[createPutFactoryAccountingEntries, return_type[type[FactoryAccountingEntries]], modifier[final protected], parameter[]] begin[{]
local_variable[type[FactoryAccountingEntries], factory]
call[factory.setDatabaseId, parameter[THIS[member[None.srvDatabase]call[None.getIdDatabase, parameter[]]]]]
THIS[member[None.factoriesMap]call[None.put, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AccountingEntries, sub_type=None)), member[.factory]]]]
return[member[.factory]]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[FactoryAccountingEntries] identifier[createPutFactoryAccountingEntries] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[FactoryAccountingEntries] identifier[factory] operator[=] Keyword[new] identifier[FactoryAccountingEntries] operator[SEP] operator[SEP] operator[SEP] identifier[factory] operator[SEP] identifier[setDatabaseId] operator[SEP] Keyword[this] operator[SEP] identifier[srvDatabase] operator[SEP] identifier[getIdDatabase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[factoriesMap] operator[SEP] identifier[put] operator[SEP] identifier[AccountingEntries] operator[SEP] Keyword[class] , identifier[factory] operator[SEP] operator[SEP] Keyword[return] identifier[factory] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.