code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
@Override
public ThreadContext captureThreadContext(Map<String, String> execProps, Map<String, ?> threadContextConfig) {
String value = execProps == null ? null : execProps.get(ManagedTask.TRANSACTION);
if (value == null || ManagedTask.SUSPEND.equals(value))
return new TransactionContextImpl(true);
else if (ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD.equals(value))
return new TransactionContextImpl(false);
else if ("PROPAGATE".equals(value)) {
UOWCurrent uowCurrent = (UOWCurrent) transactionManager;
if (uowCurrent.getUOWType() == UOWCurrent.UOW_GLOBAL) {
// TODO raise IllegalStateException here to reject all propagation of transactions
// TODO remove the following temporary code once the transaction manager provides a proper mechanism to prevent a transaction on multiple threads at once
SuspendCount suspendCount = suspendCountRef.get();
if (suspendCount == null) {
uowCurrent.setUOWEventListener(suspendCount = new SuspendCount());
if (!suspendCountRef.compareAndSet(null, suspendCount)) {
uowCurrent.unsetUOWEventListener(suspendCount);
suspendCount = suspendCountRef.get();
}
}
return new SerialTransactionContextImpl(suspendCount);
} else
return new TransactionContextImpl(true);
} else
throw new IllegalArgumentException(ManagedTask.TRANSACTION + '=' + value);
} | class class_name[name] begin[{]
method[captureThreadContext, return_type[type[ThreadContext]], modifier[public], parameter[execProps, threadContextConfig]] begin[{]
local_variable[type[String], value]
if[binary_operation[binary_operation[member[.value], ==, literal[null]], ||, call[ManagedTask.SUSPEND.equals, parameter[member[.value]]]]] begin[{]
return[ClassCreator(arguments=[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=TransactionContextImpl, sub_type=None))]
else begin[{]
if[call[ManagedTask.USE_TRANSACTION_OF_EXECUTION_THREAD.equals, parameter[member[.value]]]] begin[{]
return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TransactionContextImpl, sub_type=None))]
else begin[{]
if[literal["PROPAGATE"]] begin[{]
local_variable[type[UOWCurrent], uowCurrent]
if[binary_operation[call[uowCurrent.getUOWType, parameter[]], ==, member[UOWCurrent.UOW_GLOBAL]]] begin[{]
local_variable[type[SuspendCount], suspendCount]
if[binary_operation[member[.suspendCount], ==, literal[null]]] begin[{]
call[uowCurrent.setUOWEventListener, parameter[assign[member[.suspendCount], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SuspendCount, sub_type=None))]]]
if[call[suspendCountRef.compareAndSet, parameter[literal[null], member[.suspendCount]]]] begin[{]
call[uowCurrent.unsetUOWEventListener, parameter[member[.suspendCount]]]
assign[member[.suspendCount], call[suspendCountRef.get, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=suspendCount, 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=SerialTransactionContextImpl, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[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=TransactionContextImpl, sub_type=None))]
end[}]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=TRANSACTION, postfix_operators=[], prefix_operators=[], qualifier=ManagedTask, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='='), operator=+), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ThreadContext] identifier[captureThreadContext] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[execProps] , identifier[Map] operator[<] identifier[String] , operator[?] operator[>] identifier[threadContextConfig] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[execProps] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[execProps] operator[SEP] identifier[get] operator[SEP] identifier[ManagedTask] operator[SEP] identifier[TRANSACTION] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[||] identifier[ManagedTask] operator[SEP] identifier[SUSPEND] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TransactionContextImpl] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[ManagedTask] operator[SEP] identifier[USE_TRANSACTION_OF_EXECUTION_THREAD] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TransactionContextImpl] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[UOWCurrent] identifier[uowCurrent] operator[=] operator[SEP] identifier[UOWCurrent] operator[SEP] identifier[transactionManager] operator[SEP] Keyword[if] operator[SEP] identifier[uowCurrent] operator[SEP] identifier[getUOWType] operator[SEP] operator[SEP] operator[==] identifier[UOWCurrent] operator[SEP] identifier[UOW_GLOBAL] operator[SEP] {
identifier[SuspendCount] identifier[suspendCount] operator[=] identifier[suspendCountRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[suspendCount] operator[==] Other[null] operator[SEP] {
identifier[uowCurrent] operator[SEP] identifier[setUOWEventListener] operator[SEP] identifier[suspendCount] operator[=] Keyword[new] identifier[SuspendCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[suspendCountRef] operator[SEP] identifier[compareAndSet] operator[SEP] Other[null] , identifier[suspendCount] operator[SEP] operator[SEP] {
identifier[uowCurrent] operator[SEP] identifier[unsetUOWEventListener] operator[SEP] identifier[suspendCount] operator[SEP] operator[SEP] identifier[suspendCount] operator[=] identifier[suspendCountRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[SerialTransactionContextImpl] operator[SEP] identifier[suspendCount] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[return] Keyword[new] identifier[TransactionContextImpl] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[ManagedTask] operator[SEP] identifier[TRANSACTION] operator[+] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP]
}
|
public static SecretKeyFactory getSecretKeyFactory(String algorithm) {
final Provider provider = GlobalBouncyCastleProvider.INSTANCE.getProvider();
SecretKeyFactory keyFactory;
try {
keyFactory = (null == provider) //
? SecretKeyFactory.getInstance(getMainAlgorithm(algorithm)) //
: SecretKeyFactory.getInstance(getMainAlgorithm(algorithm), provider);
} catch (NoSuchAlgorithmException e) {
throw new CryptoException(e);
}
return keyFactory;
} | class class_name[name] begin[{]
method[getSecretKeyFactory, return_type[type[SecretKeyFactory]], modifier[public static], parameter[algorithm]] begin[{]
local_variable[type[Provider], provider]
local_variable[type[SecretKeyFactory], keyFactory]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMainAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SecretKeyFactory, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMainAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SecretKeyFactory, selectors=[], type_arguments=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CryptoException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)
return[member[.keyFactory]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SecretKeyFactory] identifier[getSecretKeyFactory] operator[SEP] identifier[String] identifier[algorithm] operator[SEP] {
Keyword[final] identifier[Provider] identifier[provider] operator[=] identifier[GlobalBouncyCastleProvider] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] operator[SEP] identifier[SecretKeyFactory] identifier[keyFactory] operator[SEP] Keyword[try] {
identifier[keyFactory] operator[=] operator[SEP] Other[null] operator[==] identifier[provider] operator[SEP] operator[?] identifier[SecretKeyFactory] operator[SEP] identifier[getInstance] operator[SEP] identifier[getMainAlgorithm] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] operator[:] identifier[SecretKeyFactory] operator[SEP] identifier[getInstance] operator[SEP] identifier[getMainAlgorithm] operator[SEP] identifier[algorithm] operator[SEP] , identifier[provider] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CryptoException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[keyFactory] operator[SEP]
}
|
@Override
public boolean rmUser(final Node node) {
LdapUser user = (LdapUser) node;
if(node == null) {
return false;
}
try {
deletionCount++;
ctx.unbind(getOuForNode(user));
} catch (NamingException ex) {
handleNamingException(user, ex);
}
Node ldapUser = getUser(user.getUid());
return ldapUser.isEmpty();
} | class class_name[name] begin[{]
method[rmUser, return_type[type[boolean]], modifier[public], parameter[node]] begin[{]
local_variable[type[LdapUser], user]
if[binary_operation[member[.node], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MemberReference(member=deletionCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOuForNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=unbind, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleNamingException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NamingException']))], finally_block=None, label=None, resources=None)
local_variable[type[Node], ldapUser]
return[call[ldapUser.isEmpty, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[rmUser] operator[SEP] Keyword[final] identifier[Node] identifier[node] operator[SEP] {
identifier[LdapUser] identifier[user] operator[=] operator[SEP] identifier[LdapUser] operator[SEP] identifier[node] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[try] {
identifier[deletionCount] operator[++] operator[SEP] identifier[ctx] operator[SEP] identifier[unbind] operator[SEP] identifier[getOuForNode] operator[SEP] identifier[user] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NamingException] identifier[ex] operator[SEP] {
identifier[handleNamingException] operator[SEP] identifier[user] , identifier[ex] operator[SEP] operator[SEP]
}
identifier[Node] identifier[ldapUser] operator[=] identifier[getUser] operator[SEP] identifier[user] operator[SEP] identifier[getUid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ldapUser] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP]
}
|
public double[] getPrediction(Instance instance) {
int predictionMode = this.getLearnerToUse(instance, this.predictionFunction);
return getPrediction(instance, predictionMode);
} | class class_name[name] begin[{]
method[getPrediction, return_type[type[double]], modifier[public], parameter[instance]] begin[{]
local_variable[type[int], predictionMode]
return[call[.getPrediction, parameter[member[.instance], member[.predictionMode]]]]
end[}]
END[}] | Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[getPrediction] operator[SEP] identifier[Instance] identifier[instance] operator[SEP] {
Keyword[int] identifier[predictionMode] operator[=] Keyword[this] operator[SEP] identifier[getLearnerToUse] operator[SEP] identifier[instance] , Keyword[this] operator[SEP] identifier[predictionFunction] operator[SEP] operator[SEP] Keyword[return] identifier[getPrediction] operator[SEP] identifier[instance] , identifier[predictionMode] operator[SEP] operator[SEP]
}
|
public ResourceFormatGenerator getGeneratorForFileExtension(final String extension) throws
UnsupportedFormatException {
for (final ResourceFormatGenerator generator : listGenerators()) {
if (generator.getFileExtensions().contains(extension)) {
return generator;
}
}
throw new UnsupportedFormatException("No provider available to parse file extension: " + extension);
} | class class_name[name] begin[{]
method[getGeneratorForFileExtension, return_type[type[ResourceFormatGenerator]], modifier[public], parameter[extension]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getFileExtensions, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[MethodInvocation(arguments=[MemberReference(member=extension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=generator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=listGenerators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=generator)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ResourceFormatGenerator, sub_type=None))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No provider available to parse file extension: "), operandr=MemberReference(member=extension, 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=UnsupportedFormatException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] identifier[ResourceFormatGenerator] identifier[getGeneratorForFileExtension] operator[SEP] Keyword[final] identifier[String] identifier[extension] operator[SEP] Keyword[throws] identifier[UnsupportedFormatException] {
Keyword[for] operator[SEP] Keyword[final] identifier[ResourceFormatGenerator] identifier[generator] operator[:] identifier[listGenerators] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[generator] operator[SEP] identifier[getFileExtensions] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[extension] operator[SEP] operator[SEP] {
Keyword[return] identifier[generator] operator[SEP]
}
}
Keyword[throw] Keyword[new] identifier[UnsupportedFormatException] operator[SEP] literal[String] operator[+] identifier[extension] operator[SEP] operator[SEP]
}
|
@Override
public GetUsagePlanKeysResult getUsagePlanKeys(GetUsagePlanKeysRequest request) {
request = beforeClientExecution(request);
return executeGetUsagePlanKeys(request);
} | class class_name[name] begin[{]
method[getUsagePlanKeys, return_type[type[GetUsagePlanKeysResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeGetUsagePlanKeys, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[GetUsagePlanKeysResult] identifier[getUsagePlanKeys] operator[SEP] identifier[GetUsagePlanKeysRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetUsagePlanKeys] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
@Override
public T addAsDirectories(final ArchivePath... paths) throws IllegalArgumentException {
// Precondition check
Validate.notNull(paths, "paths must be specified");
// Add
for (final ArchivePath path : paths) {
this.addAsDirectory(path);
}
// Return
return covariantReturn();
} | class class_name[name] begin[{]
method[addAsDirectories, return_type[type[T]], modifier[public], parameter[paths]] begin[{]
call[Validate.notNull, parameter[member[.paths], literal["paths must be specified"]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAsDirectory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ArchivePath, sub_type=None))), label=None)
return[call[.covariantReturn, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[addAsDirectories] operator[SEP] Keyword[final] identifier[ArchivePath] operator[...] identifier[paths] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[paths] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ArchivePath] identifier[path] operator[:] identifier[paths] operator[SEP] {
Keyword[this] operator[SEP] identifier[addAsDirectory] operator[SEP] identifier[path] operator[SEP] operator[SEP]
}
Keyword[return] identifier[covariantReturn] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean getBoolean(String pName, boolean defaultValue) {
String pValue = _properties.getProperty(pName);
return parseBoolean(pName, pValue, defaultValue);
} | class class_name[name] begin[{]
method[getBoolean, return_type[type[boolean]], modifier[public], parameter[pName, defaultValue]] begin[{]
local_variable[type[String], pValue]
return[call[.parseBoolean, parameter[member[.pName], member[.pValue], member[.defaultValue]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[getBoolean] operator[SEP] identifier[String] identifier[pName] , Keyword[boolean] identifier[defaultValue] operator[SEP] {
identifier[String] identifier[pValue] operator[=] identifier[_properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[pName] operator[SEP] operator[SEP] Keyword[return] identifier[parseBoolean] operator[SEP] identifier[pName] , identifier[pValue] , identifier[defaultValue] operator[SEP] operator[SEP]
}
|
public static void releaseClassLoadingSP(String name) {
synchronized (classLoadingSP) {
Pair<Thread,JoinPoint<NoException>> sp = classLoadingSP.get(name);
JoinPoint<NoException> jp = sp.getValue2();
jp.joined();
if (jp.isUnblocked())
classLoadingSP.remove(name);
}
} | class class_name[name] begin[{]
method[releaseClassLoadingSP, return_type[void], modifier[public static], parameter[name]] begin[{]
SYNCHRONIZED[member[.classLoadingSP]] BEGIN[{]
local_variable[type[Pair], sp]
local_variable[type[JoinPoint], jp]
call[jp.joined, parameter[]]
if[call[jp.isUnblocked, parameter[]]] begin[{]
call[classLoadingSP.remove, parameter[member[.name]]]
else begin[{]
None
end[}]
END[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[releaseClassLoadingSP] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[classLoadingSP] operator[SEP] {
identifier[Pair] operator[<] identifier[Thread] , identifier[JoinPoint] operator[<] identifier[NoException] operator[>] operator[>] identifier[sp] operator[=] identifier[classLoadingSP] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[JoinPoint] operator[<] identifier[NoException] operator[>] identifier[jp] operator[=] identifier[sp] operator[SEP] identifier[getValue2] operator[SEP] operator[SEP] operator[SEP] identifier[jp] operator[SEP] identifier[joined] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jp] operator[SEP] identifier[isUnblocked] operator[SEP] operator[SEP] operator[SEP] identifier[classLoadingSP] operator[SEP] identifier[remove] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
}
|
public int readRawVarint32() throws IOException {
byte tmp = readRawByte();
if (tmp >= 0) {
return tmp;
}
int result = tmp & 0x7f;
if ((tmp = readRawByte()) >= 0) {
result |= tmp << 7;
} else {
result |= (tmp & 0x7f) << 7;
if ((tmp = readRawByte()) >= 0) {
result |= tmp << 14;
} else {
result |= (tmp & 0x7f) << 14;
if ((tmp = readRawByte()) >= 0) {
result |= tmp << 21;
} else {
result |= (tmp & 0x7f) << 21;
result |= (tmp = readRawByte()) << 28;
if (tmp < 0) {
// Discard upper 32 bits.
for (int i = 0; i < 5; i++) {
if (readRawByte() >= 0) {
return result;
}
}
throw InvalidProtocolBufferException.malformedVarint();
}
}
}
}
return result;
} | class class_name[name] begin[{]
method[readRawVarint32, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[byte], tmp]
if[binary_operation[member[.tmp], >=, literal[0]]] begin[{]
return[member[.tmp]]
else begin[{]
None
end[}]
local_variable[type[int], result]
if[binary_operation[assign[member[.tmp], call[.readRawByte, parameter[]]], >=, literal[0]]] begin[{]
assign[member[.result], binary_operation[member[.tmp], <<, literal[7]]]
else begin[{]
assign[member[.result], binary_operation[binary_operation[member[.tmp], &, literal[0x7f]], <<, literal[7]]]
if[binary_operation[assign[member[.tmp], call[.readRawByte, parameter[]]], >=, literal[0]]] begin[{]
assign[member[.result], binary_operation[member[.tmp], <<, literal[14]]]
else begin[{]
assign[member[.result], binary_operation[binary_operation[member[.tmp], &, literal[0x7f]], <<, literal[14]]]
if[binary_operation[assign[member[.tmp], call[.readRawByte, parameter[]]], >=, literal[0]]] begin[{]
assign[member[.result], binary_operation[member[.tmp], <<, literal[21]]]
else begin[{]
assign[member[.result], binary_operation[binary_operation[member[.tmp], &, literal[0x7f]], <<, literal[21]]]
assign[member[.result], binary_operation[assign[member[.tmp], call[.readRawByte, parameter[]]], <<, literal[28]]]
if[binary_operation[member[.tmp], <, literal[0]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=readRawByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), 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)
ThrowStatement(expression=MethodInvocation(arguments=[], member=malformedVarint, postfix_operators=[], prefix_operators=[], qualifier=InvalidProtocolBufferException, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[readRawVarint32] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[byte] identifier[tmp] operator[=] identifier[readRawByte] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[tmp] operator[SEP]
}
Keyword[int] identifier[result] operator[=] identifier[tmp] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[tmp] operator[=] identifier[readRawByte] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
identifier[result] operator[|=] identifier[tmp] operator[<<] Other[7] operator[SEP]
}
Keyword[else] {
identifier[result] operator[|=] operator[SEP] identifier[tmp] operator[&] literal[Integer] operator[SEP] operator[<<] Other[7] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[tmp] operator[=] identifier[readRawByte] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
identifier[result] operator[|=] identifier[tmp] operator[<<] Other[14] operator[SEP]
}
Keyword[else] {
identifier[result] operator[|=] operator[SEP] identifier[tmp] operator[&] literal[Integer] operator[SEP] operator[<<] Other[14] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[tmp] operator[=] identifier[readRawByte] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
identifier[result] operator[|=] identifier[tmp] operator[<<] Other[21] operator[SEP]
}
Keyword[else] {
identifier[result] operator[|=] operator[SEP] identifier[tmp] operator[&] literal[Integer] operator[SEP] operator[<<] Other[21] operator[SEP] identifier[result] operator[|=] operator[SEP] identifier[tmp] operator[=] identifier[readRawByte] operator[SEP] operator[SEP] operator[SEP] operator[<<] Other[28] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[<] Other[0] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Other[5] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[readRawByte] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[result] operator[SEP]
}
}
Keyword[throw] identifier[InvalidProtocolBufferException] operator[SEP] identifier[malformedVarint] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static String buildHostsOnlyList(List<HostAndPort> hostAndPorts) {
StringBuilder sb = new StringBuilder();
for (HostAndPort hostAndPort : hostAndPorts) {
sb.append(hostAndPort.getHostText()).append(",");
}
if (sb.length() > 0) {
sb.delete(sb.length() - 1, sb.length());
}
return sb.toString();
} | class class_name[name] begin[{]
method[buildHostsOnlyList, return_type[type[String]], modifier[public static], parameter[hostAndPorts]] begin[{]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHostText, postfix_operators=[], prefix_operators=[], qualifier=hostAndPort, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=hostAndPorts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hostAndPort)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HostAndPort, sub_type=None))), label=None)
if[binary_operation[call[sb.length, parameter[]], >, literal[0]]] begin[{]
call[sb.delete, parameter[binary_operation[call[sb.length, parameter[]], -, literal[1]], call[sb.length, parameter[]]]]
else begin[{]
None
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[buildHostsOnlyList] operator[SEP] identifier[List] operator[<] identifier[HostAndPort] operator[>] identifier[hostAndPorts] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[HostAndPort] identifier[hostAndPort] operator[:] identifier[hostAndPorts] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[hostAndPort] operator[SEP] identifier[getHostText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[sb] operator[SEP] identifier[delete] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public ServiceFuture<RegistryListCredentialsResultInner> regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name, final ServiceCallback<RegistryListCredentialsResultInner> serviceCallback) {
return ServiceFuture.fromResponse(regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name), serviceCallback);
} | class class_name[name] begin[{]
method[regenerateCredentialAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, registryName, name, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.regenerateCredentialWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.registryName], member[.name]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[RegistryListCredentialsResultInner] operator[>] identifier[regenerateCredentialAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[registryName] , identifier[PasswordName] identifier[name] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[RegistryListCredentialsResultInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[regenerateCredentialWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[registryName] , identifier[name] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
@Override
@SuppressWarnings("unchecked")
public T forward() {
T x = modIn.getOutput();
y = (T) x.copyAndConvertAlgebra(s);
return y;
} | class class_name[name] begin[{]
method[forward, return_type[type[T]], modifier[public], parameter[]] begin[{]
local_variable[type[T], x]
assign[member[.y], Cast(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyAndConvertAlgebra, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
return[member[.y]]
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[T] identifier[forward] operator[SEP] operator[SEP] {
identifier[T] identifier[x] operator[=] identifier[modIn] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[SEP] identifier[y] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[x] operator[SEP] identifier[copyAndConvertAlgebra] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[return] identifier[y] operator[SEP]
}
|
public static int cusolverSpXcsrsymrcmHost(
cusolverSpHandle handle,
int n,
int nnzA,
cusparseMatDescr descrA,
Pointer csrRowPtrA,
Pointer csrColIndA,
Pointer p)
{
return checkResult(cusolverSpXcsrsymrcmHostNative(handle, n, nnzA, descrA, csrRowPtrA, csrColIndA, p));
} | class class_name[name] begin[{]
method[cusolverSpXcsrsymrcmHost, return_type[type[int]], modifier[public static], parameter[handle, n, nnzA, descrA, csrRowPtrA, csrColIndA, p]] begin[{]
return[call[.checkResult, parameter[call[.cusolverSpXcsrsymrcmHostNative, parameter[member[.handle], member[.n], member[.nnzA], member[.descrA], member[.csrRowPtrA], member[.csrColIndA], member[.p]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[cusolverSpXcsrsymrcmHost] operator[SEP] identifier[cusolverSpHandle] identifier[handle] , Keyword[int] identifier[n] , Keyword[int] identifier[nnzA] , identifier[cusparseMatDescr] identifier[descrA] , identifier[Pointer] identifier[csrRowPtrA] , identifier[Pointer] identifier[csrColIndA] , identifier[Pointer] identifier[p] operator[SEP] {
Keyword[return] identifier[checkResult] operator[SEP] identifier[cusolverSpXcsrsymrcmHostNative] operator[SEP] identifier[handle] , identifier[n] , identifier[nnzA] , identifier[descrA] , identifier[csrRowPtrA] , identifier[csrColIndA] , identifier[p] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setLatLngs(List<LatLng> latLngs) {
List<Point>points = new ArrayList<>();
for (LatLng latLng : latLngs) {
points.add(Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude()));
}
geometry = LineString.fromLngLats(points);
} | class class_name[name] begin[{]
method[setLatLngs, return_type[void], modifier[public], parameter[latLngs]] begin[{]
local_variable[type[List], points]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongitude, postfix_operators=[], prefix_operators=[], qualifier=latLng, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLatitude, postfix_operators=[], prefix_operators=[], qualifier=latLng, selectors=[], type_arguments=None)], member=fromLngLat, postfix_operators=[], prefix_operators=[], qualifier=Point, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=points, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=latLngs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=latLng)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LatLng, sub_type=None))), label=None)
assign[member[.geometry], call[LineString.fromLngLats, parameter[member[.points]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setLatLngs] operator[SEP] identifier[List] operator[<] identifier[LatLng] operator[>] identifier[latLngs] operator[SEP] {
identifier[List] operator[<] identifier[Point] operator[>] identifier[points] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[LatLng] identifier[latLng] operator[:] identifier[latLngs] operator[SEP] {
identifier[points] operator[SEP] identifier[add] operator[SEP] identifier[Point] operator[SEP] identifier[fromLngLat] operator[SEP] identifier[latLng] operator[SEP] identifier[getLongitude] operator[SEP] operator[SEP] , identifier[latLng] operator[SEP] identifier[getLatitude] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[geometry] operator[=] identifier[LineString] operator[SEP] identifier[fromLngLats] operator[SEP] identifier[points] operator[SEP] operator[SEP]
}
|
public void setLineColor(@ColorInt final int lineColor) {
queueEvent(new Runnable() {
@Override
public void run() {
scene.setLineColor(lineColor);
}
});
} | class class_name[name] begin[{]
method[setLineColor, return_type[void], modifier[public], parameter[lineColor]] begin[{]
call[.queueEvent, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lineColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLineColor, postfix_operators=[], prefix_operators=[], qualifier=scene, 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[}]
END[}] | Keyword[public] Keyword[void] identifier[setLineColor] operator[SEP] annotation[@] identifier[ColorInt] Keyword[final] Keyword[int] identifier[lineColor] operator[SEP] {
identifier[queueEvent] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[scene] operator[SEP] identifier[setLineColor] operator[SEP] identifier[lineColor] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
protected void updateFoundCount() {
SpiderScan sc = this.getSelectedScanner();
if (sc != null) {
this.getFoundCountValueLabel().setText(Integer.toString(sc.getNumberOfURIsFound()));
} else {
this.getFoundCountValueLabel().setText(ZERO_REQUESTS_LABEL_TEXT);
}
} | class class_name[name] begin[{]
method[updateFoundCount, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[SpiderScan], sc]
if[binary_operation[member[.sc], !=, literal[null]]] begin[{]
THIS[call[None.getFoundCountValueLabel, parameter[]]call[None.setText, parameter[call[Integer.toString, parameter[call[sc.getNumberOfURIsFound, parameter[]]]]]]]
else begin[{]
THIS[call[None.getFoundCountValueLabel, parameter[]]call[None.setText, parameter[member[.ZERO_REQUESTS_LABEL_TEXT]]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[updateFoundCount] operator[SEP] operator[SEP] {
identifier[SpiderScan] identifier[sc] operator[=] Keyword[this] operator[SEP] identifier[getSelectedScanner] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sc] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[getFoundCountValueLabel] operator[SEP] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[sc] operator[SEP] identifier[getNumberOfURIsFound] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[getFoundCountValueLabel] operator[SEP] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[ZERO_REQUESTS_LABEL_TEXT] operator[SEP] operator[SEP]
}
}
|
public void endTo(K to, M msg)
{
K key = getCurrentKey();
if (key.equals(to))
{
throw new IllegalArgumentException("current and to are equals");
}
if (key != null)
{
kill(key);
doFork(to, msg);
throw new ThreadStoppedException("suicide");
}
else
{
throw new IllegalArgumentException("called from wrong thread");
}
} | class class_name[name] begin[{]
method[endTo, return_type[void], modifier[public], parameter[to, msg]] begin[{]
local_variable[type[K], key]
if[call[key.equals, parameter[member[.to]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="current and to are equals")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.key], !=, literal[null]]] begin[{]
call[.kill, parameter[member[.key]]]
call[.doFork, parameter[member[.to], member[.msg]]]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="suicide")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThreadStoppedException, sub_type=None)), label=None)
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="called from wrong thread")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[endTo] operator[SEP] identifier[K] identifier[to] , identifier[M] identifier[msg] operator[SEP] {
identifier[K] identifier[key] operator[=] identifier[getCurrentKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[to] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[!=] Other[null] operator[SEP] {
identifier[kill] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[doFork] operator[SEP] identifier[to] , identifier[msg] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ThreadStoppedException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public Stream<IntPair> adjacent4Points(final int i, final int j) {
final IntPair up = i == 0 ? null : IntPair.of(i - 1, j);
final IntPair right = j == cols - 1 ? null : IntPair.of(i, j + 1);
final IntPair down = i == rows - 1 ? null : IntPair.of(i + 1, j);
final IntPair left = j == 0 ? null : IntPair.of(i, j - 1);
return Stream.of(up, right, down, left);
} | class class_name[name] begin[{]
method[adjacent4Points, return_type[type[Stream]], modifier[public], parameter[i, j]] begin[{]
local_variable[type[IntPair], up]
local_variable[type[IntPair], right]
local_variable[type[IntPair], down]
local_variable[type[IntPair], left]
return[call[Stream.of, parameter[member[.up], member[.right], member[.down], member[.left]]]]
end[}]
END[}] | Keyword[public] identifier[Stream] operator[<] identifier[IntPair] operator[>] identifier[adjacent4Points] operator[SEP] Keyword[final] Keyword[int] identifier[i] , Keyword[final] Keyword[int] identifier[j] operator[SEP] {
Keyword[final] identifier[IntPair] identifier[up] operator[=] identifier[i] operator[==] Other[0] operator[?] Other[null] operator[:] identifier[IntPair] operator[SEP] identifier[of] operator[SEP] identifier[i] operator[-] Other[1] , identifier[j] operator[SEP] operator[SEP] Keyword[final] identifier[IntPair] identifier[right] operator[=] identifier[j] operator[==] identifier[cols] operator[-] Other[1] operator[?] Other[null] operator[:] identifier[IntPair] operator[SEP] identifier[of] operator[SEP] identifier[i] , identifier[j] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[IntPair] identifier[down] operator[=] identifier[i] operator[==] identifier[rows] operator[-] Other[1] operator[?] Other[null] operator[:] identifier[IntPair] operator[SEP] identifier[of] operator[SEP] identifier[i] operator[+] Other[1] , identifier[j] operator[SEP] operator[SEP] Keyword[final] identifier[IntPair] identifier[left] operator[=] identifier[j] operator[==] Other[0] operator[?] Other[null] operator[:] identifier[IntPair] operator[SEP] identifier[of] operator[SEP] identifier[i] , identifier[j] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[Stream] operator[SEP] identifier[of] operator[SEP] identifier[up] , identifier[right] , identifier[down] , identifier[left] operator[SEP] operator[SEP]
}
|
@Override
public boolean sqlMapDocumentGenerated(Document document, IntrospectedTable introspectedTable) {
this.generateXmlElementWithSelective(document, introspectedTable);
this.generateXmlElement(document, introspectedTable, false);
if (introspectedTable.hasBLOBColumns()) {
this.generateXmlElement(document, introspectedTable, true);
}
if (this.allowBatchUpsert) {
this.generateBatchXmlElementSelective(document, introspectedTable);
this.generateBatchXmlElement(document, introspectedTable, false);
if (introspectedTable.hasBLOBColumns()) {
this.generateBatchXmlElement(document, introspectedTable, true);
}
}
return super.sqlMapDocumentGenerated(document, introspectedTable);
} | class class_name[name] begin[{]
method[sqlMapDocumentGenerated, return_type[type[boolean]], modifier[public], parameter[document, introspectedTable]] begin[{]
THIS[call[None.generateXmlElementWithSelective, parameter[member[.document], member[.introspectedTable]]]]
THIS[call[None.generateXmlElement, parameter[member[.document], member[.introspectedTable], literal[false]]]]
if[call[introspectedTable.hasBLOBColumns, parameter[]]] begin[{]
THIS[call[None.generateXmlElement, parameter[member[.document], member[.introspectedTable], literal[true]]]]
else begin[{]
None
end[}]
if[THIS[member[None.allowBatchUpsert]]] begin[{]
THIS[call[None.generateBatchXmlElementSelective, parameter[member[.document], member[.introspectedTable]]]]
THIS[call[None.generateBatchXmlElement, parameter[member[.document], member[.introspectedTable], literal[false]]]]
if[call[introspectedTable.hasBLOBColumns, parameter[]]] begin[{]
THIS[call[None.generateBatchXmlElement, parameter[member[.document], member[.introspectedTable], literal[true]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[SuperMethodInvocation(arguments=[MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=introspectedTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sqlMapDocumentGenerated, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[sqlMapDocumentGenerated] operator[SEP] identifier[Document] identifier[document] , identifier[IntrospectedTable] identifier[introspectedTable] operator[SEP] {
Keyword[this] operator[SEP] identifier[generateXmlElementWithSelective] operator[SEP] identifier[document] , identifier[introspectedTable] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[generateXmlElement] operator[SEP] identifier[document] , identifier[introspectedTable] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[introspectedTable] operator[SEP] identifier[hasBLOBColumns] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[generateXmlElement] operator[SEP] identifier[document] , identifier[introspectedTable] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[allowBatchUpsert] operator[SEP] {
Keyword[this] operator[SEP] identifier[generateBatchXmlElementSelective] operator[SEP] identifier[document] , identifier[introspectedTable] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[generateBatchXmlElement] operator[SEP] identifier[document] , identifier[introspectedTable] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[introspectedTable] operator[SEP] identifier[hasBLOBColumns] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[generateBatchXmlElement] operator[SEP] identifier[document] , identifier[introspectedTable] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[super] operator[SEP] identifier[sqlMapDocumentGenerated] operator[SEP] identifier[document] , identifier[introspectedTable] operator[SEP] operator[SEP]
}
|
public DscConfigurationInner update(String resourceGroupName, String automationAccountName, String configurationName, DscConfigurationUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, automationAccountName, configurationName, parameters).toBlocking().single().body();
} | class class_name[name] begin[{]
method[update, return_type[type[DscConfigurationInner]], modifier[public], parameter[resourceGroupName, automationAccountName, configurationName, parameters]] begin[{]
return[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.automationAccountName], member[.configurationName], member[.parameters]]]]
end[}]
END[}] | Keyword[public] identifier[DscConfigurationInner] identifier[update] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[automationAccountName] , identifier[String] identifier[configurationName] , identifier[DscConfigurationUpdateParameters] identifier[parameters] operator[SEP] {
Keyword[return] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[automationAccountName] , identifier[configurationName] , identifier[parameters] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public static int getCharCount(String charSet, String word)
{
int nCount = 0;
if (word != null)
{
String temp = word + " ";
for (int i = 0; i < word.length(); i++)
{
String s = temp.substring(i, i + 1);
if (charSet.indexOf(s) != -1)
nCount++;
}
}
return nCount;
} | class class_name[name] begin[{]
method[getCharCount, return_type[type[int]], modifier[public static], parameter[charSet, word]] begin[{]
local_variable[type[int], nCount]
if[binary_operation[member[.word], !=, literal[null]]] begin[{]
local_variable[type[String], temp]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=charSet, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MemberReference(member=nCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
return[member[.nCount]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[getCharCount] operator[SEP] identifier[String] identifier[charSet] , identifier[String] identifier[word] operator[SEP] {
Keyword[int] identifier[nCount] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[word] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[temp] operator[=] identifier[word] operator[+] literal[String] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[word] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[s] operator[=] identifier[temp] operator[SEP] identifier[substring] operator[SEP] identifier[i] , identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[charSet] operator[SEP] identifier[indexOf] operator[SEP] identifier[s] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] identifier[nCount] operator[++] operator[SEP]
}
}
Keyword[return] identifier[nCount] operator[SEP]
}
|
public void showInNavigation(CmsUUID entryId) {
CmsClientSitemapEntry entry = getEntryById(entryId);
CmsSitemapChange change = getChangeForEdit(
entry,
Collections.singletonList(
new CmsPropertyModification(
entryId.toString()
+ "/"
+ CmsClientProperty.PROPERTY_NAVINFO
+ "/"
+ CmsClientProperty.PATH_STRUCTURE_VALUE,
"")));
commitChange(change, null);
} | class class_name[name] begin[{]
method[showInNavigation, return_type[void], modifier[public], parameter[entryId]] begin[{]
local_variable[type[CmsClientSitemapEntry], entry]
local_variable[type[CmsSitemapChange], change]
call[.commitChange, parameter[member[.change], literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[showInNavigation] operator[SEP] identifier[CmsUUID] identifier[entryId] operator[SEP] {
identifier[CmsClientSitemapEntry] identifier[entry] operator[=] identifier[getEntryById] operator[SEP] identifier[entryId] operator[SEP] operator[SEP] identifier[CmsSitemapChange] identifier[change] operator[=] identifier[getChangeForEdit] operator[SEP] identifier[entry] , identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] Keyword[new] identifier[CmsPropertyModification] operator[SEP] identifier[entryId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[CmsClientProperty] operator[SEP] identifier[PROPERTY_NAVINFO] operator[+] literal[String] operator[+] identifier[CmsClientProperty] operator[SEP] identifier[PATH_STRUCTURE_VALUE] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[commitChange] operator[SEP] identifier[change] , Other[null] operator[SEP] operator[SEP]
}
|
public OvhOrder dedicated_server_serviceName_ip_duration_GET(String serviceName, String duration, OvhIpBlockSizeEnum blockSize, OvhIpCountryEnum country, String organisationId, OvhIpTypeOrderableEnum type) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/ip/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "blockSize", blockSize);
query(sb, "country", country);
query(sb, "organisationId", organisationId);
query(sb, "type", type);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOrder.class);
} | class class_name[name] begin[{]
method[dedicated_server_serviceName_ip_duration_GET, return_type[type[OvhOrder]], modifier[public], parameter[serviceName, duration, blockSize, country, organisationId, type]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["blockSize"], member[.blockSize]]]
call[.query, parameter[member[.sb], literal["country"], member[.country]]]
call[.query, parameter[member[.sb], literal["organisationId"], member[.organisationId]]]
call[.query, parameter[member[.sb], literal["type"], member[.type]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOrder, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhOrder] identifier[dedicated_server_serviceName_ip_duration_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[duration] , identifier[OvhIpBlockSizeEnum] identifier[blockSize] , identifier[OvhIpCountryEnum] identifier[country] , identifier[String] identifier[organisationId] , identifier[OvhIpTypeOrderableEnum] identifier[type] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[duration] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[blockSize] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[country] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[organisationId] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[type] 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[OvhOrder] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
int next() throws IOException, UnterminatedCommentException {
int c = get();
if (c == '/') {
switch (peek()) {
case '/':
for (;;) {
c = get();
if (c <= '\n') {
return c;
}
}
case '*':
get();
for (;;) {
switch (get()) {
case '*':
if (peek() == '/') {
get();
return ' ';
}
break;
case EOF:
throw new UnterminatedCommentException();
}
}
default:
return c;
}
}
return c;
} | class class_name[name] begin[{]
method[next, return_type[type[int]], modifier[default], parameter[]] begin[{]
local_variable[type[int], c]
if[binary_operation[member[.c], ==, literal['/']]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/')], statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=None, init=None, update=None), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*')], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['EOF'], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnterminatedCommentException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
return[member[.c]]
end[}]
END[}] | Keyword[int] identifier[next] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[UnterminatedCommentException] {
Keyword[int] identifier[c] operator[=] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[switch] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[c] operator[=] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<=] literal[String] operator[SEP] {
Keyword[return] identifier[c] operator[SEP]
}
}
Keyword[case] literal[String] operator[:] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[switch] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[EOF] operator[:] Keyword[throw] Keyword[new] identifier[UnterminatedCommentException] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[default] operator[:] Keyword[return] identifier[c] operator[SEP]
}
}
Keyword[return] identifier[c] operator[SEP]
}
|
protected void updateCompanies(final LoginContext _login,
final Person _person)
throws EFapsException
{
if (!JAASSystem.getAllJAASSystems().isEmpty()) {
_person.setCompanies(JAASSystem.getAllJAASSystems().iterator().next(), _person.getCompaniesFromDB(null));
}
} | class class_name[name] begin[{]
method[updateCompanies, return_type[void], modifier[protected], parameter[_login, _person]] begin[{]
if[call[JAASSystem.getAllJAASSystems, parameter[]]] begin[{]
call[_person.setCompanies, parameter[call[JAASSystem.getAllJAASSystems, parameter[]], call[_person.getCompaniesFromDB, parameter[literal[null]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[updateCompanies] operator[SEP] Keyword[final] identifier[LoginContext] identifier[_login] , Keyword[final] identifier[Person] identifier[_person] operator[SEP] Keyword[throws] identifier[EFapsException] {
Keyword[if] operator[SEP] operator[!] identifier[JAASSystem] operator[SEP] identifier[getAllJAASSystems] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[_person] operator[SEP] identifier[setCompanies] operator[SEP] identifier[JAASSystem] operator[SEP] identifier[getAllJAASSystems] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] , identifier[_person] operator[SEP] identifier[getCompaniesFromDB] operator[SEP] Other[null] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static void compareAccumulatorTypes(Object name,
@SuppressWarnings("rawtypes") Class<? extends Accumulator> first,
@SuppressWarnings("rawtypes") Class<? extends Accumulator> second)
throws UnsupportedOperationException {
if (first != second) {
throw new UnsupportedOperationException("The accumulator object '" + name
+ "' was created with two different types: " + first + " and " + second);
}
} | class class_name[name] begin[{]
method[compareAccumulatorTypes, return_type[void], modifier[public static], parameter[name, first, second]] begin[{]
if[binary_operation[member[.first], !=, member[.second]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The accumulator object '"), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' was created with two different types: "), operator=+), operandr=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" and "), operator=+), operandr=MemberReference(member=second, 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=UnsupportedOperationException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[compareAccumulatorTypes] operator[SEP] identifier[Object] identifier[name] , annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Accumulator] operator[>] identifier[first] , annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Accumulator] operator[>] identifier[second] operator[SEP] Keyword[throws] identifier[UnsupportedOperationException] {
Keyword[if] operator[SEP] identifier[first] operator[!=] identifier[second] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[first] operator[+] literal[String] operator[+] identifier[second] operator[SEP] operator[SEP]
}
}
|
private static URL makeURLFromFilespec(final String filespec, final String relativePrefix)
throws IOException
{
// make sure the file is absolute & canonical file url
File file = new File(decode(filespec));
// if we have a prefix and the file is not abs then prepend
if (relativePrefix != null && !file.isAbsolute())
{
file = new File(relativePrefix, filespec);
}
// make sure it is canonical (no ../ and such)
file = file.getCanonicalFile();
return file.toURI().toURL();
} | class class_name[name] begin[{]
method[makeURLFromFilespec, return_type[type[URL]], modifier[private static], parameter[filespec, relativePrefix]] begin[{]
local_variable[type[File], file]
if[binary_operation[binary_operation[member[.relativePrefix], !=, literal[null]], &&, call[file.isAbsolute, parameter[]]]] begin[{]
assign[member[.file], ClassCreator(arguments=[MemberReference(member=relativePrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filespec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]
else begin[{]
None
end[}]
assign[member[.file], call[file.getCanonicalFile, parameter[]]]
return[call[file.toURI, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[URL] identifier[makeURLFromFilespec] operator[SEP] Keyword[final] identifier[String] identifier[filespec] , Keyword[final] identifier[String] identifier[relativePrefix] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[decode] operator[SEP] identifier[filespec] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[relativePrefix] operator[!=] Other[null] operator[&&] operator[!] identifier[file] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] {
identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[relativePrefix] , identifier[filespec] operator[SEP] operator[SEP]
}
identifier[file] operator[=] identifier[file] operator[SEP] identifier[getCanonicalFile] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[file] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Integer assign(final Integer value, final Integer defaultValueIfNull) {
return value != null ? value : defaultValueIfNull;
} | class class_name[name] begin[{]
method[assign, return_type[type[Integer]], modifier[public static], parameter[value, defaultValueIfNull]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=defaultValueIfNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Integer] identifier[assign] operator[SEP] Keyword[final] identifier[Integer] identifier[value] , Keyword[final] identifier[Integer] identifier[defaultValueIfNull] operator[SEP] {
Keyword[return] identifier[value] operator[!=] Other[null] operator[?] identifier[value] operator[:] identifier[defaultValueIfNull] operator[SEP]
}
|
public void setBeginSection(String v) {
if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_beginSection == null)
jcasType.jcas.throwFeatMissing("beginSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
jcasType.ll_cas.ll_setStringValue(addr, ((Passage_Type)jcasType).casFeatCode_beginSection, v);} | class class_name[name] begin[{]
method[setBeginSection, return_type[void], modifier[public], parameter[v]] begin[{]
if[binary_operation[member[Passage_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Passage_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["beginSection"], literal["edu.cmu.lti.oaqa.type.retrieval.Passage"]]]
else begin[{]
None
end[}]
call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Passage_Type, sub_type=None)), member[.v]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setBeginSection] operator[SEP] identifier[String] identifier[v] operator[SEP] {
Keyword[if] operator[SEP] identifier[Passage_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Passage_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_beginSection] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Passage_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_beginSection] , identifier[v] operator[SEP] operator[SEP]
}
|
private void ensureIndexIsUnlocked(String dataDir) {
Collection<File> lockFiles = new ArrayList<File>(2);
lockFiles.add(
new File(
CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "index") + "write.lock"));
lockFiles.add(
new File(
CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "spellcheck")
+ "write.lock"));
for (File lockFile : lockFiles) {
if (lockFile.exists()) {
lockFile.delete();
LOG.warn(
"Forcely unlocking index with data dir \""
+ dataDir
+ "\" by removing file \""
+ lockFile.getAbsolutePath()
+ "\".");
}
}
} | class class_name[name] begin[{]
method[ensureIndexIsUnlocked, return_type[void], modifier[private], parameter[dataDir]] begin[{]
local_variable[type[Collection], lockFiles]
call[lockFiles.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=dataDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addTrailingSeparator, postfix_operators=[], prefix_operators=[], qualifier=CmsFileUtil, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="index"), operator=+)], member=addTrailingSeparator, postfix_operators=[], prefix_operators=[], qualifier=CmsFileUtil, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="write.lock"), 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))]]
call[lockFiles.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=dataDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addTrailingSeparator, postfix_operators=[], prefix_operators=[], qualifier=CmsFileUtil, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="spellcheck"), operator=+)], member=addTrailingSeparator, postfix_operators=[], prefix_operators=[], qualifier=CmsFileUtil, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="write.lock"), 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))]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=lockFile, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=lockFile, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Forcely unlocking index with data dir \""), operandr=MemberReference(member=dataDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" by removing file \""), operator=+), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=lockFile, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=lockFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=lockFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[ensureIndexIsUnlocked] operator[SEP] identifier[String] identifier[dataDir] operator[SEP] {
identifier[Collection] operator[<] identifier[File] operator[>] identifier[lockFiles] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[File] operator[>] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[lockFiles] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[CmsFileUtil] operator[SEP] identifier[addTrailingSeparator] operator[SEP] identifier[CmsFileUtil] operator[SEP] identifier[addTrailingSeparator] operator[SEP] identifier[dataDir] operator[SEP] operator[+] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[lockFiles] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[CmsFileUtil] operator[SEP] identifier[addTrailingSeparator] operator[SEP] identifier[CmsFileUtil] operator[SEP] identifier[addTrailingSeparator] operator[SEP] identifier[dataDir] operator[SEP] operator[+] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[lockFile] operator[:] identifier[lockFiles] operator[SEP] {
Keyword[if] operator[SEP] identifier[lockFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[lockFile] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[dataDir] operator[+] literal[String] operator[+] identifier[lockFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
}
|
public void marshall(Edge edge, ProtocolMarshaller protocolMarshaller) {
if (edge == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(edge.getReferenceId(), REFERENCEID_BINDING);
protocolMarshaller.marshall(edge.getStartTime(), STARTTIME_BINDING);
protocolMarshaller.marshall(edge.getEndTime(), ENDTIME_BINDING);
protocolMarshaller.marshall(edge.getSummaryStatistics(), SUMMARYSTATISTICS_BINDING);
protocolMarshaller.marshall(edge.getResponseTimeHistogram(), RESPONSETIMEHISTOGRAM_BINDING);
protocolMarshaller.marshall(edge.getAliases(), ALIASES_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[edge, protocolMarshaller]] begin[{]
if[binary_operation[member[.edge], ==, 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=getReferenceId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), MemberReference(member=REFERENCEID_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=getStartTime, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), MemberReference(member=STARTTIME_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=getEndTime, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), MemberReference(member=ENDTIME_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=getSummaryStatistics, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), MemberReference(member=SUMMARYSTATISTICS_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=getResponseTimeHistogram, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), MemberReference(member=RESPONSETIMEHISTOGRAM_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=getAliases, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), MemberReference(member=ALIASES_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[Edge] identifier[edge] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[edge] 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[edge] operator[SEP] identifier[getReferenceId] operator[SEP] operator[SEP] , identifier[REFERENCEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[edge] operator[SEP] identifier[getStartTime] operator[SEP] operator[SEP] , identifier[STARTTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[edge] operator[SEP] identifier[getEndTime] operator[SEP] operator[SEP] , identifier[ENDTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[edge] operator[SEP] identifier[getSummaryStatistics] operator[SEP] operator[SEP] , identifier[SUMMARYSTATISTICS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[edge] operator[SEP] identifier[getResponseTimeHistogram] operator[SEP] operator[SEP] , identifier[RESPONSETIMEHISTOGRAM_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[edge] operator[SEP] identifier[getAliases] operator[SEP] operator[SEP] , identifier[ALIASES_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]
}
}
|
@Broadcast(writeEntity = false)
@POST
@Produces("application/json")
public Response broadcast(Message message) {
return new Response(message.author, message.message);
} | class class_name[name] begin[{]
method[broadcast, return_type[type[Response]], modifier[public], parameter[message]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=author, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Broadcast] operator[SEP] identifier[writeEntity] operator[=] literal[boolean] operator[SEP] annotation[@] identifier[POST] annotation[@] identifier[Produces] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Response] identifier[broadcast] operator[SEP] identifier[Message] identifier[message] operator[SEP] {
Keyword[return] Keyword[new] identifier[Response] operator[SEP] identifier[message] operator[SEP] identifier[author] , identifier[message] operator[SEP] identifier[message] operator[SEP] operator[SEP]
}
|
public Object getAttribute(File file, String attribute) {
String view = getViewName(attribute);
String attr = getSingleAttribute(attribute);
return getAttribute(file, view, attr);
} | class class_name[name] begin[{]
method[getAttribute, return_type[type[Object]], modifier[public], parameter[file, attribute]] begin[{]
local_variable[type[String], view]
local_variable[type[String], attr]
return[call[.getAttribute, parameter[member[.file], member[.view], member[.attr]]]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[getAttribute] operator[SEP] identifier[File] identifier[file] , identifier[String] identifier[attribute] operator[SEP] {
identifier[String] identifier[view] operator[=] identifier[getViewName] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[String] identifier[attr] operator[=] identifier[getSingleAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] Keyword[return] identifier[getAttribute] operator[SEP] identifier[file] , identifier[view] , identifier[attr] operator[SEP] operator[SEP]
}
|
public MODCAInterchangeSetISid createMODCAInterchangeSetISidFromString(EDataType eDataType, String initialValue) {
MODCAInterchangeSetISid result = MODCAInterchangeSetISid.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | class class_name[name] begin[{]
method[createMODCAInterchangeSetISidFromString, return_type[type[MODCAInterchangeSetISid]], modifier[public], parameter[eDataType, initialValue]] begin[{]
local_variable[type[MODCAInterchangeSetISid], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[MODCAInterchangeSetISid] identifier[createMODCAInterchangeSetISidFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] {
identifier[MODCAInterchangeSetISid] identifier[result] operator[=] identifier[MODCAInterchangeSetISid] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
@Override
public List<byte[]> hmget(final byte[] key, final byte[]... fields) {
checkIsInMultiOrPipeline();
client.hmget(key, fields);
return client.getBinaryMultiBulkReply();
} | class class_name[name] begin[{]
method[hmget, return_type[type[List]], modifier[public], parameter[key, fields]] begin[{]
call[.checkIsInMultiOrPipeline, parameter[]]
call[client.hmget, parameter[member[.key], member[.fields]]]
return[call[client.getBinaryMultiBulkReply, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[hmget] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[key] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] operator[...] identifier[fields] operator[SEP] {
identifier[checkIsInMultiOrPipeline] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[hmget] operator[SEP] identifier[key] , identifier[fields] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[getBinaryMultiBulkReply] operator[SEP] operator[SEP] operator[SEP]
}
|
protected UserTransaction getUserTransaction(boolean injection, Object injectionContext) throws NamingException
{
final UserTransaction ut = AccessController.doPrivileged(new PrivilegedAction<UserTransaction>() {
@Override
public UserTransaction run() {
return userTranSvcRef.getBundle().getBundleContext().getService(userTranSvcRef);
}
});
final UserTransactionDecorator utd = getUserTransactionDecorator();
if (utd == null) {
return ut;
} else {
return utd.decorateUserTransaction(ut, injection, injectionContext);
}
} | class class_name[name] begin[{]
method[getUserTransaction, return_type[type[UserTransaction]], modifier[protected], parameter[injection, injectionContext]] begin[{]
local_variable[type[UserTransaction], ut]
local_variable[type[UserTransactionDecorator], utd]
if[binary_operation[member[.utd], ==, literal[null]]] begin[{]
return[member[.ut]]
else begin[{]
return[call[utd.decorateUserTransaction, parameter[member[.ut], member[.injection], member[.injectionContext]]]]
end[}]
end[}]
END[}] | Keyword[protected] identifier[UserTransaction] identifier[getUserTransaction] operator[SEP] Keyword[boolean] identifier[injection] , identifier[Object] identifier[injectionContext] operator[SEP] Keyword[throws] identifier[NamingException] {
Keyword[final] identifier[UserTransaction] identifier[ut] operator[=] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[UserTransaction] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[UserTransaction] identifier[run] operator[SEP] operator[SEP] {
Keyword[return] identifier[userTranSvcRef] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[getBundleContext] operator[SEP] operator[SEP] operator[SEP] identifier[getService] operator[SEP] identifier[userTranSvcRef] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[final] identifier[UserTransactionDecorator] identifier[utd] operator[=] identifier[getUserTransactionDecorator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[utd] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[ut] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[utd] operator[SEP] identifier[decorateUserTransaction] operator[SEP] identifier[ut] , identifier[injection] , identifier[injectionContext] operator[SEP] operator[SEP]
}
}
|
protected boolean delete(@NotNull ByteIterable key, @Nullable ByteIterable value) {
if (deleteImpl(key, value)) {
TreeCursorMutable.notifyCursors(this);
return true;
}
return false;
} | class class_name[name] begin[{]
method[delete, return_type[type[boolean]], modifier[protected], parameter[key, value]] begin[{]
if[call[.deleteImpl, parameter[member[.key], member[.value]]]] begin[{]
call[TreeCursorMutable.notifyCursors, parameter[THIS[]]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[protected] Keyword[boolean] identifier[delete] operator[SEP] annotation[@] identifier[NotNull] identifier[ByteIterable] identifier[key] , annotation[@] identifier[Nullable] identifier[ByteIterable] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteImpl] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] {
identifier[TreeCursorMutable] operator[SEP] identifier[notifyCursors] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void deleteSystemDestination(JsDestinationAddress destAddr) throws SIResourceException, SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deleteSystemDestination", new Object[] { destAddr });
BaseDestinationHandler destinationHandler = null;
DestinationTypeFilter filter = new DestinationTypeFilter();
filter.VISIBLE = Boolean.TRUE;
filter.ALIAS = Boolean.FALSE;
filter.FOREIGN_DESTINATION = Boolean.FALSE;
DestinationHandler dh =
destinationIndex.findByName(destAddr.getDestinationName(), messageProcessor.getMessagingEngineBus(), filter);
try
{
checkDestinationHandlerExists(
dh != null,
destAddr.getDestinationName(),
messageProcessor.getMessagingEngineName());
} catch (SITemporaryDestinationNotFoundException e)
{
// // FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DestinationManager.deleteSystemDestination",
"1:5408:1.508.1.7",
this);
// This shouldn't occur as the Connection will create a valid system destination.
// Or validate that the destination address passed in is a system destination
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteSystemDestination", "SIErrorException");
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0003",
new Object[] { "com.ibm.ws.sib.processor.impl.DestinationManager",
"1:5421:1.508.1.7",
e,
destAddr.getDestinationName() },
null),
e);
}
destinationHandler = (BaseDestinationHandler) dh;
deleteSystemDestination(destinationHandler);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteSystemDestination");
} | class class_name[name] begin[{]
method[deleteSystemDestination, return_type[void], modifier[public], parameter[destAddr]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["deleteSystemDestination"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=destAddr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[BaseDestinationHandler], destinationHandler]
local_variable[type[DestinationTypeFilter], filter]
assign[member[filter.VISIBLE], member[Boolean.TRUE]]
assign[member[filter.ALIAS], member[Boolean.FALSE]]
assign[member[filter.FOREIGN_DESTINATION], member[Boolean.FALSE]]
local_variable[type[DestinationHandler], dh]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=dh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), MethodInvocation(arguments=[], member=getDestinationName, postfix_operators=[], prefix_operators=[], qualifier=destAddr, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMessagingEngineName, postfix_operators=[], prefix_operators=[], qualifier=messageProcessor, selectors=[], type_arguments=None)], member=checkDestinationHandlerExists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.DestinationManager.deleteSystemDestination"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:5408:1.508.1.7"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="deleteSystemDestination"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SIErrorException")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_MESSAGING_ERROR_CWSIP0003"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.DestinationManager"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:5421:1.508.1.7"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDestinationName, postfix_operators=[], prefix_operators=[], qualifier=destAddr, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIErrorException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SITemporaryDestinationNotFoundException']))], finally_block=None, label=None, resources=None)
assign[member[.destinationHandler], Cast(expression=MemberReference(member=dh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BaseDestinationHandler, sub_type=None))]
call[.deleteSystemDestination, parameter[member[.destinationHandler]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["deleteSystemDestination"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[deleteSystemDestination] operator[SEP] identifier[JsDestinationAddress] identifier[destAddr] operator[SEP] Keyword[throws] identifier[SIResourceException] , identifier[SINotPossibleInCurrentConfigurationException] {
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[Object] operator[SEP] operator[SEP] {
identifier[destAddr]
} operator[SEP] operator[SEP] identifier[BaseDestinationHandler] identifier[destinationHandler] operator[=] Other[null] operator[SEP] identifier[DestinationTypeFilter] identifier[filter] operator[=] Keyword[new] identifier[DestinationTypeFilter] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[VISIBLE] operator[=] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] identifier[filter] operator[SEP] identifier[ALIAS] operator[=] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] identifier[filter] operator[SEP] identifier[FOREIGN_DESTINATION] operator[=] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] identifier[DestinationHandler] identifier[dh] operator[=] identifier[destinationIndex] operator[SEP] identifier[findByName] operator[SEP] identifier[destAddr] operator[SEP] identifier[getDestinationName] operator[SEP] operator[SEP] , identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineBus] operator[SEP] operator[SEP] , identifier[filter] operator[SEP] operator[SEP] Keyword[try] {
identifier[checkDestinationHandlerExists] operator[SEP] identifier[dh] operator[!=] Other[null] , identifier[destAddr] operator[SEP] identifier[getDestinationName] operator[SEP] operator[SEP] , identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SITemporaryDestinationNotFoundException] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] 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] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , literal[String] , identifier[e] , identifier[destAddr] operator[SEP] identifier[getDestinationName] operator[SEP] operator[SEP]
} , Other[null] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
identifier[destinationHandler] operator[=] operator[SEP] identifier[BaseDestinationHandler] operator[SEP] identifier[dh] operator[SEP] identifier[deleteSystemDestination] operator[SEP] identifier[destinationHandler] 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]
}
|
@Nonnull
public CSSImportRule addMediaQuery (@Nonnull final CSSMediaQuery aMediaQuery)
{
ValueEnforcer.notNull (aMediaQuery, "MediaQuery");
m_aMediaQueries.add (aMediaQuery);
return this;
} | class class_name[name] begin[{]
method[addMediaQuery, return_type[type[CSSImportRule]], modifier[public], parameter[aMediaQuery]] begin[{]
call[ValueEnforcer.notNull, parameter[member[.aMediaQuery], literal["MediaQuery"]]]
call[m_aMediaQueries.add, parameter[member[.aMediaQuery]]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] identifier[CSSImportRule] identifier[addMediaQuery] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[CSSMediaQuery] identifier[aMediaQuery] operator[SEP] {
identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aMediaQuery] , literal[String] operator[SEP] operator[SEP] identifier[m_aMediaQueries] operator[SEP] identifier[add] operator[SEP] identifier[aMediaQuery] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE__ARGUMENTS:
return arguments != null && !arguments.isEmpty();
case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE:
return type != null;
}
return super.eIsSet(featureID);
} | class class_name[name] begin[{]
method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=JVM_PARAMETERIZED_TYPE_REFERENCE__ARGUMENTS, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=arguments, selectors=[], type_arguments=None), operator=&&), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_PARAMETERIZED_TYPE_REFERENCE__ARGUMENTS] operator[:] Keyword[return] identifier[arguments] operator[!=] Other[null] operator[&&] operator[!] identifier[arguments] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE] operator[:] Keyword[return] identifier[type] operator[!=] Other[null] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
public static CloseableHttpResponse proxy(IncomingRequest incomingRequest) throws IOException, HttpErrorPage {
MatchedRequest matchedRequest = selectProvider(incomingRequest);
return matchedRequest.getDriver().proxy(matchedRequest.getRelativeUri(), incomingRequest);
} | class class_name[name] begin[{]
method[proxy, return_type[type[CloseableHttpResponse]], modifier[public static], parameter[incomingRequest]] begin[{]
local_variable[type[MatchedRequest], matchedRequest]
return[call[matchedRequest.getDriver, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CloseableHttpResponse] identifier[proxy] operator[SEP] identifier[IncomingRequest] identifier[incomingRequest] operator[SEP] Keyword[throws] identifier[IOException] , identifier[HttpErrorPage] {
identifier[MatchedRequest] identifier[matchedRequest] operator[=] identifier[selectProvider] operator[SEP] identifier[incomingRequest] operator[SEP] operator[SEP] Keyword[return] identifier[matchedRequest] operator[SEP] identifier[getDriver] operator[SEP] operator[SEP] operator[SEP] identifier[proxy] operator[SEP] identifier[matchedRequest] operator[SEP] identifier[getRelativeUri] operator[SEP] operator[SEP] , identifier[incomingRequest] operator[SEP] operator[SEP]
}
|
public void invoke(String method, Object[] params, IPendingServiceCallback callback) {
IPendingServiceCall call = new PendingCall(method, params);
if (callback != null) {
call.registerCallback(callback);
}
invoke(call);
} | class class_name[name] begin[{]
method[invoke, return_type[void], modifier[public], parameter[method, params, callback]] begin[{]
local_variable[type[IPendingServiceCall], call]
if[binary_operation[member[.callback], !=, literal[null]]] begin[{]
call[call.registerCallback, parameter[member[.callback]]]
else begin[{]
None
end[}]
call[.invoke, parameter[member[.call]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[invoke] operator[SEP] identifier[String] identifier[method] , identifier[Object] operator[SEP] operator[SEP] identifier[params] , identifier[IPendingServiceCallback] identifier[callback] operator[SEP] {
identifier[IPendingServiceCall] identifier[call] operator[=] Keyword[new] identifier[PendingCall] operator[SEP] identifier[method] , identifier[params] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[callback] operator[!=] Other[null] operator[SEP] {
identifier[call] operator[SEP] identifier[registerCallback] operator[SEP] identifier[callback] operator[SEP] operator[SEP]
}
identifier[invoke] operator[SEP] identifier[call] operator[SEP] operator[SEP]
}
|
private void _recurse (@Nonnull final Block aRoot, final boolean bListMode)
{
Block aBlock;
Block aList;
Line aLine = aRoot.m_aLines;
if (bListMode)
{
aRoot.removeListIndent (m_bUseExtensions);
if (m_bUseExtensions && aRoot.m_aLines != null && aRoot.m_aLines.getLineType (m_bUseExtensions) != ELineType.CODE)
{
aRoot.m_sID = aRoot.m_aLines.stripID ();
}
}
while (aLine != null && aLine.m_bIsEmpty)
aLine = aLine.m_aNext;
if (aLine == null)
return;
while (aLine != null)
{
final ELineType eType = aLine.getLineType (m_bUseExtensions);
switch (eType)
{
case OTHER:
{
final boolean bWasEmpty = aLine.m_bPrevEmpty;
while (aLine != null && !aLine.m_bIsEmpty)
{
final ELineType eType2 = aLine.getLineType (m_bUseExtensions);
if ((bListMode || m_bUseExtensions) && (eType2 == ELineType.OLIST || eType2 == ELineType.ULIST))
break;
if (m_bUseExtensions &&
(eType2 == ELineType.CODE || eType2 == ELineType.FENCED_CODE || eType2 == ELineType.PLUGIN))
break;
if (eType2 == ELineType.HEADLINE ||
eType2 == ELineType.HEADLINE1 ||
eType2 == ELineType.HEADLINE2 ||
eType2 == ELineType.HR ||
eType2 == ELineType.BQUOTE ||
eType2 == ELineType.XML ||
eType2 == ELineType.XML_COMMENT)
break;
aLine = aLine.m_aNext;
}
final EBlockType eBlockType;
if (aLine != null && !aLine.m_bIsEmpty)
{
eBlockType = (bListMode && !bWasEmpty) ? EBlockType.NONE : EBlockType.PARAGRAPH;
aRoot.split (aLine.m_aPrevious).m_eType = eBlockType;
aRoot.removeLeadingEmptyLines ();
}
else
{
eBlockType = (bListMode && (aLine == null || !aLine.m_bIsEmpty) && !bWasEmpty) ? EBlockType.NONE
: EBlockType.PARAGRAPH;
aRoot.split (aLine == null ? aRoot.m_aLineTail : aLine).m_eType = eBlockType;
aRoot.removeLeadingEmptyLines ();
}
aLine = aRoot.m_aLines;
break;
}
case CODE:
while (aLine != null && (aLine.m_bIsEmpty || aLine.m_nLeading > 3))
{
aLine = aLine.m_aNext;
}
aBlock = aRoot.split (aLine != null ? aLine.m_aPrevious : aRoot.m_aLineTail);
aBlock.m_eType = EBlockType.CODE;
aBlock.removeSurroundingEmptyLines ();
break;
case XML:
case XML_COMMENT:
if (aLine.m_aPrevious != null)
{
// FIXME ... this looks wrong
aRoot.split (aLine.m_aPrevious);
}
aRoot.split (aLine.m_aXmlEndLine).m_eType = eType == ELineType.XML ? EBlockType.XML : EBlockType.XML_COMMENT;
aRoot.removeLeadingEmptyLines ();
aLine = aRoot.m_aLines;
break;
case BQUOTE:
while (aLine != null)
{
if (!aLine.m_bIsEmpty &&
aLine.m_bPrevEmpty &&
aLine.m_nLeading == 0 &&
aLine.getLineType (m_bUseExtensions) != ELineType.BQUOTE)
break;
aLine = aLine.m_aNext;
}
aBlock = aRoot.split (aLine != null ? aLine.m_aPrevious : aRoot.m_aLineTail);
aBlock.m_eType = EBlockType.BLOCKQUOTE;
aBlock.removeSurroundingEmptyLines ();
aBlock.removeBlockQuotePrefix ();
_recurse (aBlock, false);
aLine = aRoot.m_aLines;
break;
case HR:
if (aLine.m_aPrevious != null)
{
// FIXME ... this looks wrong
aRoot.split (aLine.m_aPrevious);
}
aRoot.split (aLine).m_eType = EBlockType.RULER;
aRoot.removeLeadingEmptyLines ();
aLine = aRoot.m_aLines;
break;
case FENCED_CODE:
aLine = aLine.m_aNext;
while (aLine != null)
{
if (aLine.getLineType (m_bUseExtensions) == ELineType.FENCED_CODE)
break;
// TODO ... is this really necessary? Maybe add a special
// flag?
aLine = aLine.m_aNext;
}
if (aLine != null)
aLine = aLine.m_aNext;
aBlock = aRoot.split (aLine != null ? aLine.m_aPrevious : aRoot.m_aLineTail);
aBlock.m_eType = EBlockType.FENCED_CODE;
aBlock.m_sMeta = MarkdownHelper.getMetaFromFence (aBlock.m_aLines.m_sValue);
aBlock.m_aLines.setEmpty ();
if (aBlock.m_aLineTail.getLineType (m_bUseExtensions) == ELineType.FENCED_CODE)
aBlock.m_aLineTail.setEmpty ();
aBlock.removeSurroundingEmptyLines ();
break;
case PLUGIN:
aLine = aLine.m_aNext;
while (aLine != null)
{
if (aLine.getLineType (m_bUseExtensions) == ELineType.PLUGIN)
break;
// TODO ... is this really necessary? Maybe add a special
// flag?
aLine = aLine.m_aNext;
}
if (aLine != null)
aLine = aLine.m_aNext;
aBlock = aRoot.split (aLine != null ? aLine.m_aPrevious : aRoot.m_aLineTail);
aBlock.m_eType = EBlockType.PLUGIN;
aBlock.m_sMeta = MarkdownHelper.getMetaFromFence (aBlock.m_aLines.m_sValue);
aBlock.m_aLines.setEmpty ();
if (aBlock.m_aLineTail.getLineType (m_bUseExtensions) == ELineType.PLUGIN)
aBlock.m_aLineTail.setEmpty ();
aBlock.removeSurroundingEmptyLines ();
break;
case HEADLINE:
case HEADLINE1:
case HEADLINE2:
if (aLine.m_aPrevious != null)
aRoot.split (aLine.m_aPrevious);
if (eType != ELineType.HEADLINE)
aLine.m_aNext.setEmpty ();
aBlock = aRoot.split (aLine);
aBlock.m_eType = EBlockType.HEADLINE;
if (eType != ELineType.HEADLINE)
aBlock.m_nHeadlineDepth = eType == ELineType.HEADLINE1 ? 1 : 2;
if (m_bUseExtensions)
aBlock.m_sID = aBlock.m_aLines.stripID ();
aBlock.transfromHeadline ();
aRoot.removeLeadingEmptyLines ();
aLine = aRoot.m_aLines;
break;
case OLIST:
case ULIST:
while (aLine != null)
{
final ELineType eType2 = aLine.getLineType (m_bUseExtensions);
if (!aLine.m_bIsEmpty &&
(aLine.m_bPrevEmpty && aLine.m_nLeading == 0 && !(eType2 == ELineType.OLIST || eType2 == ELineType.ULIST)))
break;
aLine = aLine.m_aNext;
}
aList = aRoot.split (aLine != null ? aLine.m_aPrevious : aRoot.m_aLineTail);
aList.m_eType = eType == ELineType.OLIST ? EBlockType.ORDERED_LIST : EBlockType.UNORDERED_LIST;
aList.m_aLines.m_bPrevEmpty = false;
aList.removeSurroundingEmptyLines ();
aList.m_aLines.m_bPrevEmpty = false;
_initListBlock (aList);
aBlock = aList.m_aBlocks;
while (aBlock != null)
{
_recurse (aBlock, true);
aBlock = aBlock.m_aNext;
}
aList.expandListParagraphs ();
break;
default:
aLine = aLine.m_aNext;
break;
}
}
} | class class_name[name] begin[{]
method[_recurse, return_type[void], modifier[private], parameter[aRoot, bListMode]] begin[{]
local_variable[type[Block], aBlock]
local_variable[type[Block], aList]
local_variable[type[Line], aLine]
if[member[.bListMode]] begin[{]
call[aRoot.removeListIndent, parameter[member[.m_bUseExtensions]]]
if[binary_operation[binary_operation[member[.m_bUseExtensions], &&, binary_operation[member[aRoot.m_aLines], !=, literal[null]]], &&, binary_operation[call[aRoot.m_aLines.getLineType, parameter[member[.m_bUseExtensions]]], !=, member[ELineType.CODE]]]] begin[{]
assign[member[aRoot.m_sID], call[aRoot.m_aLines.stripID, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
while[binary_operation[binary_operation[member[.aLine], !=, literal[null]], &&, member[aLine.m_bIsEmpty]]] begin[{]
assign[member[.aLine], member[aLine.m_aNext]]
end[}]
if[binary_operation[member[.aLine], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
while[binary_operation[member[.aLine], !=, literal[null]]] begin[{]
local_variable[type[ELineType], eType]
SwitchStatement(cases=[SwitchStatementCase(case=['OTHER'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=m_bPrevEmpty, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), name=bWasEmpty)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLineType, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[], type_arguments=None), name=eType2)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ELineType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bListMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OLIST, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ULIST, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operator=&&), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CODE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FENCED_CODE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PLUGIN, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operator=&&), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HEADLINE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HEADLINE1, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HEADLINE2, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HR, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BQUOTE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=XML, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=XML_COMMENT, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MemberReference(member=m_bIsEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=aLine, selectors=[]), operator=&&), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=eBlockType)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=EBlockType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MemberReference(member=m_bIsEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=aLine, selectors=[]), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=eBlockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bListMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MemberReference(member=m_bIsEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=aLine, selectors=[]), operator=||), operator=&&), operandr=MemberReference(member=bWasEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), if_false=MemberReference(member=PARAGRAPH, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]), if_true=MemberReference(member=NONE, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]))), label=None), StatementExpression(expression=Assignment(expressionl=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=m_aLineTail, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[]))], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[MemberReference(member=m_eType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), type==, value=MemberReference(member=eBlockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeLeadingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=eBlockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=bListMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bWasEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), if_false=MemberReference(member=PARAGRAPH, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]), if_true=MemberReference(member=NONE, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]))), label=None), StatementExpression(expression=Assignment(expressionl=MethodInvocation(arguments=[MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[MemberReference(member=m_eType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), type==, value=MemberReference(member=eBlockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeLeadingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[])), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['CODE'], statements=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=m_bIsEmpty, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=m_nLeading, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=>), operator=||), operator=&&), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=m_aLineTail, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[]), if_true=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]))], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_eType, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MemberReference(member=CODE, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeSurroundingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['XML', 'XML_COMMENT'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MethodInvocation(arguments=[MemberReference(member=m_aXmlEndLine, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[MemberReference(member=m_eType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=eType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=XML, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), if_false=MemberReference(member=XML_COMMENT, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]), if_true=MemberReference(member=XML, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeLeadingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['BQUOTE'], statements=[WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_bIsEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=aLine, selectors=[]), operandr=MemberReference(member=m_bPrevEmpty, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=m_nLeading, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLineType, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[], type_arguments=None), operandr=MemberReference(member=BQUOTE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=m_aLineTail, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[]), if_true=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]))], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_eType, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MemberReference(member=BLOCKQUOTE, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeSurroundingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeBlockQuotePrefix, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=_recurse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HR'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MethodInvocation(arguments=[MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[MemberReference(member=m_eType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), type==, value=MemberReference(member=RULER, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeLeadingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['FENCED_CODE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLineType, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[], type_arguments=None), operandr=MemberReference(member=FENCED_CODE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=m_aLineTail, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[]), if_true=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]))], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_eType, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MemberReference(member=FENCED_CODE, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_sMeta, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=m_sValue, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLines, selectors=[])], member=getMetaFromFence, postfix_operators=[], prefix_operators=[], qualifier=MarkdownHelper, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=setEmpty, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLines, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLineType, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLineTail, selectors=[], type_arguments=None), operandr=MemberReference(member=FENCED_CODE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=setEmpty, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLineTail, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=removeSurroundingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PLUGIN'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLineType, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[], type_arguments=None), operandr=MemberReference(member=PLUGIN, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=m_aLineTail, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[]), if_true=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]))], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_eType, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MemberReference(member=PLUGIN, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_sMeta, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=m_sValue, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLines, selectors=[])], member=getMetaFromFence, postfix_operators=[], prefix_operators=[], qualifier=MarkdownHelper, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=setEmpty, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLines, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLineType, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLineTail, selectors=[], type_arguments=None), operandr=MemberReference(member=PLUGIN, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=setEmpty, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLineTail, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=removeSurroundingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HEADLINE', 'HEADLINE1', 'HEADLINE2'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HEADLINE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=setEmpty, postfix_operators=[], prefix_operators=[], qualifier=aLine.m_aNext, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_eType, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MemberReference(member=HEADLINE, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HEADLINE, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_nHeadlineDepth, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=eType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HEADLINE1, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))), label=None)), IfStatement(condition=MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_sID, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[]), type==, value=MethodInvocation(arguments=[], member=stripID, postfix_operators=[], prefix_operators=[], qualifier=aBlock.m_aLines, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=transfromHeadline, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeLeadingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aLines, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['OLIST', 'ULIST'], statements=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=m_bUseExtensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLineType, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[], type_arguments=None), name=eType2)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ELineType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_bIsEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=aLine, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_bPrevEmpty, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=m_nLeading, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OLIST, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=eType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ULIST, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), operator=||), operator=&&), operator=&&), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=m_aLineTail, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[]), if_true=MemberReference(member=m_aPrevious, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[]))], member=split, postfix_operators=[], prefix_operators=[], qualifier=aRoot, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_eType, postfix_operators=[], prefix_operators=[], qualifier=aList, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=eType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OLIST, postfix_operators=[], prefix_operators=[], qualifier=ELineType, selectors=[]), operator===), if_false=MemberReference(member=UNORDERED_LIST, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]), if_true=MemberReference(member=ORDERED_LIST, postfix_operators=[], prefix_operators=[], qualifier=EBlockType, selectors=[]))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_bPrevEmpty, postfix_operators=[], prefix_operators=[], qualifier=aList.m_aLines, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=removeSurroundingEmptyLines, postfix_operators=[], prefix_operators=[], qualifier=aList, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_bPrevEmpty, postfix_operators=[], prefix_operators=[], qualifier=aList.m_aLines, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=_initListBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aBlocks, postfix_operators=[], prefix_operators=[], qualifier=aList, selectors=[])), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=_recurse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aBlock, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=aBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=expandListParagraphs, postfix_operators=[], prefix_operators=[], qualifier=aList, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=aLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_aNext, postfix_operators=[], prefix_operators=[], qualifier=aLine, selectors=[])), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=eType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[_recurse] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Block] identifier[aRoot] , Keyword[final] Keyword[boolean] identifier[bListMode] operator[SEP] {
identifier[Block] identifier[aBlock] operator[SEP] identifier[Block] identifier[aList] operator[SEP] identifier[Line] identifier[aLine] operator[=] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] Keyword[if] operator[SEP] identifier[bListMode] operator[SEP] {
identifier[aRoot] operator[SEP] identifier[removeListIndent] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_bUseExtensions] operator[&&] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[!=] Other[null] operator[&&] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[!=] identifier[ELineType] operator[SEP] identifier[CODE] operator[SEP] {
identifier[aRoot] operator[SEP] identifier[m_sID] operator[=] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] identifier[stripID] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[&&] identifier[aLine] operator[SEP] identifier[m_bIsEmpty] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP] Keyword[if] operator[SEP] identifier[aLine] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[ELineType] identifier[eType] operator[=] identifier[aLine] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[eType] operator[SEP] {
Keyword[case] identifier[OTHER] operator[:] {
Keyword[final] Keyword[boolean] identifier[bWasEmpty] operator[=] identifier[aLine] operator[SEP] identifier[m_bPrevEmpty] operator[SEP] Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[&&] operator[!] identifier[aLine] operator[SEP] identifier[m_bIsEmpty] operator[SEP] {
Keyword[final] identifier[ELineType] identifier[eType2] operator[=] identifier[aLine] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[bListMode] operator[||] identifier[m_bUseExtensions] operator[SEP] operator[&&] operator[SEP] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[OLIST] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[ULIST] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[m_bUseExtensions] operator[&&] operator[SEP] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[CODE] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[FENCED_CODE] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[PLUGIN] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[HEADLINE] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[HEADLINE1] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[HEADLINE2] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[HR] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[BQUOTE] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[XML] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[XML_COMMENT] operator[SEP] Keyword[break] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP]
}
Keyword[final] identifier[EBlockType] identifier[eBlockType] operator[SEP] Keyword[if] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[&&] operator[!] identifier[aLine] operator[SEP] identifier[m_bIsEmpty] operator[SEP] {
identifier[eBlockType] operator[=] operator[SEP] identifier[bListMode] operator[&&] operator[!] identifier[bWasEmpty] operator[SEP] operator[?] identifier[EBlockType] operator[SEP] identifier[NONE] operator[:] identifier[EBlockType] operator[SEP] identifier[PARAGRAPH] operator[SEP] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[SEP] operator[SEP] identifier[m_eType] operator[=] identifier[eBlockType] operator[SEP] identifier[aRoot] operator[SEP] identifier[removeLeadingEmptyLines] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[eBlockType] operator[=] operator[SEP] identifier[bListMode] operator[&&] operator[SEP] identifier[aLine] operator[==] Other[null] operator[||] operator[!] identifier[aLine] operator[SEP] identifier[m_bIsEmpty] operator[SEP] operator[&&] operator[!] identifier[bWasEmpty] operator[SEP] operator[?] identifier[EBlockType] operator[SEP] identifier[NONE] operator[:] identifier[EBlockType] operator[SEP] identifier[PARAGRAPH] operator[SEP] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[==] Other[null] operator[?] identifier[aRoot] operator[SEP] identifier[m_aLineTail] operator[:] identifier[aLine] operator[SEP] operator[SEP] identifier[m_eType] operator[=] identifier[eBlockType] operator[SEP] identifier[aRoot] operator[SEP] identifier[removeLeadingEmptyLines] operator[SEP] operator[SEP] operator[SEP]
}
identifier[aLine] operator[=] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[CODE] operator[:] Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[&&] operator[SEP] identifier[aLine] operator[SEP] identifier[m_bIsEmpty] operator[||] identifier[aLine] operator[SEP] identifier[m_nLeading] operator[>] Other[3] operator[SEP] operator[SEP] {
identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP]
}
identifier[aBlock] operator[=] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[?] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[:] identifier[aRoot] operator[SEP] identifier[m_aLineTail] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_eType] operator[=] identifier[EBlockType] operator[SEP] identifier[CODE] operator[SEP] identifier[aBlock] operator[SEP] identifier[removeSurroundingEmptyLines] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[XML] operator[:] Keyword[case] identifier[XML_COMMENT] operator[:] Keyword[if] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[!=] Other[null] operator[SEP] {
identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[SEP] operator[SEP]
}
identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aXmlEndLine] operator[SEP] operator[SEP] identifier[m_eType] operator[=] identifier[eType] operator[==] identifier[ELineType] operator[SEP] identifier[XML] operator[?] identifier[EBlockType] operator[SEP] identifier[XML] operator[:] identifier[EBlockType] operator[SEP] identifier[XML_COMMENT] operator[SEP] identifier[aRoot] operator[SEP] identifier[removeLeadingEmptyLines] operator[SEP] operator[SEP] operator[SEP] identifier[aLine] operator[=] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[BQUOTE] operator[:] Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[aLine] operator[SEP] identifier[m_bIsEmpty] operator[&&] identifier[aLine] operator[SEP] identifier[m_bPrevEmpty] operator[&&] identifier[aLine] operator[SEP] identifier[m_nLeading] operator[==] Other[0] operator[&&] identifier[aLine] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[!=] identifier[ELineType] operator[SEP] identifier[BQUOTE] operator[SEP] Keyword[break] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP]
}
identifier[aBlock] operator[=] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[?] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[:] identifier[aRoot] operator[SEP] identifier[m_aLineTail] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_eType] operator[=] identifier[EBlockType] operator[SEP] identifier[BLOCKQUOTE] operator[SEP] identifier[aBlock] operator[SEP] identifier[removeSurroundingEmptyLines] operator[SEP] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[removeBlockQuotePrefix] operator[SEP] operator[SEP] operator[SEP] identifier[_recurse] operator[SEP] identifier[aBlock] , literal[boolean] operator[SEP] operator[SEP] identifier[aLine] operator[=] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HR] operator[:] Keyword[if] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[!=] Other[null] operator[SEP] {
identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[SEP] operator[SEP]
}
identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[SEP] operator[SEP] identifier[m_eType] operator[=] identifier[EBlockType] operator[SEP] identifier[RULER] operator[SEP] identifier[aRoot] operator[SEP] identifier[removeLeadingEmptyLines] operator[SEP] operator[SEP] operator[SEP] identifier[aLine] operator[=] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[FENCED_CODE] operator[:] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP] Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[aLine] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[==] identifier[ELineType] operator[SEP] identifier[FENCED_CODE] operator[SEP] Keyword[break] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP]
}
Keyword[if] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP] identifier[aBlock] operator[=] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[?] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[:] identifier[aRoot] operator[SEP] identifier[m_aLineTail] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_eType] operator[=] identifier[EBlockType] operator[SEP] identifier[FENCED_CODE] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_sMeta] operator[=] identifier[MarkdownHelper] operator[SEP] identifier[getMetaFromFence] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLines] operator[SEP] identifier[m_sValue] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLines] operator[SEP] identifier[setEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLineTail] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[==] identifier[ELineType] operator[SEP] identifier[FENCED_CODE] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLineTail] operator[SEP] identifier[setEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[removeSurroundingEmptyLines] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PLUGIN] operator[:] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP] Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[aLine] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[==] identifier[ELineType] operator[SEP] identifier[PLUGIN] operator[SEP] Keyword[break] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP]
}
Keyword[if] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP] identifier[aBlock] operator[=] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[?] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[:] identifier[aRoot] operator[SEP] identifier[m_aLineTail] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_eType] operator[=] identifier[EBlockType] operator[SEP] identifier[PLUGIN] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_sMeta] operator[=] identifier[MarkdownHelper] operator[SEP] identifier[getMetaFromFence] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLines] operator[SEP] identifier[m_sValue] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLines] operator[SEP] identifier[setEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLineTail] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[==] identifier[ELineType] operator[SEP] identifier[PLUGIN] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_aLineTail] operator[SEP] identifier[setEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[removeSurroundingEmptyLines] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HEADLINE] operator[:] Keyword[case] identifier[HEADLINE1] operator[:] Keyword[case] identifier[HEADLINE2] operator[:] Keyword[if] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[!=] Other[null] operator[SEP] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eType] operator[!=] identifier[ELineType] operator[SEP] identifier[HEADLINE] operator[SEP] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP] identifier[setEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[aBlock] operator[=] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_eType] operator[=] identifier[EBlockType] operator[SEP] identifier[HEADLINE] operator[SEP] Keyword[if] operator[SEP] identifier[eType] operator[!=] identifier[ELineType] operator[SEP] identifier[HEADLINE] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_nHeadlineDepth] operator[=] identifier[eType] operator[==] identifier[ELineType] operator[SEP] identifier[HEADLINE1] operator[?] Other[1] operator[:] Other[2] operator[SEP] Keyword[if] operator[SEP] identifier[m_bUseExtensions] operator[SEP] identifier[aBlock] operator[SEP] identifier[m_sID] operator[=] identifier[aBlock] operator[SEP] identifier[m_aLines] operator[SEP] identifier[stripID] operator[SEP] operator[SEP] operator[SEP] identifier[aBlock] operator[SEP] identifier[transfromHeadline] operator[SEP] operator[SEP] operator[SEP] identifier[aRoot] operator[SEP] identifier[removeLeadingEmptyLines] operator[SEP] operator[SEP] operator[SEP] identifier[aLine] operator[=] identifier[aRoot] operator[SEP] identifier[m_aLines] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[OLIST] operator[:] Keyword[case] identifier[ULIST] operator[:] Keyword[while] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[ELineType] identifier[eType2] operator[=] identifier[aLine] operator[SEP] identifier[getLineType] operator[SEP] identifier[m_bUseExtensions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[aLine] operator[SEP] identifier[m_bIsEmpty] operator[&&] operator[SEP] identifier[aLine] operator[SEP] identifier[m_bPrevEmpty] operator[&&] identifier[aLine] operator[SEP] identifier[m_nLeading] operator[==] Other[0] operator[&&] operator[!] operator[SEP] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[OLIST] operator[||] identifier[eType2] operator[==] identifier[ELineType] operator[SEP] identifier[ULIST] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP]
}
identifier[aList] operator[=] identifier[aRoot] operator[SEP] identifier[split] operator[SEP] identifier[aLine] operator[!=] Other[null] operator[?] identifier[aLine] operator[SEP] identifier[m_aPrevious] operator[:] identifier[aRoot] operator[SEP] identifier[m_aLineTail] operator[SEP] operator[SEP] identifier[aList] operator[SEP] identifier[m_eType] operator[=] identifier[eType] operator[==] identifier[ELineType] operator[SEP] identifier[OLIST] operator[?] identifier[EBlockType] operator[SEP] identifier[ORDERED_LIST] operator[:] identifier[EBlockType] operator[SEP] identifier[UNORDERED_LIST] operator[SEP] identifier[aList] operator[SEP] identifier[m_aLines] operator[SEP] identifier[m_bPrevEmpty] operator[=] literal[boolean] operator[SEP] identifier[aList] operator[SEP] identifier[removeSurroundingEmptyLines] operator[SEP] operator[SEP] operator[SEP] identifier[aList] operator[SEP] identifier[m_aLines] operator[SEP] identifier[m_bPrevEmpty] operator[=] literal[boolean] operator[SEP] identifier[_initListBlock] operator[SEP] identifier[aList] operator[SEP] operator[SEP] identifier[aBlock] operator[=] identifier[aList] operator[SEP] identifier[m_aBlocks] operator[SEP] Keyword[while] operator[SEP] identifier[aBlock] operator[!=] Other[null] operator[SEP] {
identifier[_recurse] operator[SEP] identifier[aBlock] , literal[boolean] operator[SEP] operator[SEP] identifier[aBlock] operator[=] identifier[aBlock] operator[SEP] identifier[m_aNext] operator[SEP]
}
identifier[aList] operator[SEP] identifier[expandListParagraphs] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[aLine] operator[=] identifier[aLine] operator[SEP] identifier[m_aNext] operator[SEP] Keyword[break] operator[SEP]
}
}
}
|
public static MozuUrl deleteCategoryByIdUrl(Boolean cascadeDelete, Integer categoryId, Boolean forceDelete, Boolean reassignToParent)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/?cascadeDelete={cascadeDelete}&forceDelete={forceDelete}&reassignToParent={reassignToParent}");
formatter.formatUrl("cascadeDelete", cascadeDelete);
formatter.formatUrl("categoryId", categoryId);
formatter.formatUrl("forceDelete", forceDelete);
formatter.formatUrl("reassignToParent", reassignToParent);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | class class_name[name] begin[{]
method[deleteCategoryByIdUrl, return_type[type[MozuUrl]], modifier[public static], parameter[cascadeDelete, categoryId, forceDelete, reassignToParent]] begin[{]
local_variable[type[UrlFormatter], formatter]
call[formatter.formatUrl, parameter[literal["cascadeDelete"], member[.cascadeDelete]]]
call[formatter.formatUrl, parameter[literal["categoryId"], member[.categoryId]]]
call[formatter.formatUrl, parameter[literal["forceDelete"], member[.forceDelete]]]
call[formatter.formatUrl, parameter[literal["reassignToParent"], member[.reassignToParent]]]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getResourceUrl, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None), MemberReference(member=TENANT_POD, postfix_operators=[], prefix_operators=[], qualifier=MozuUrl.UrlLocation, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MozuUrl, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[MozuUrl] identifier[deleteCategoryByIdUrl] operator[SEP] identifier[Boolean] identifier[cascadeDelete] , identifier[Integer] identifier[categoryId] , identifier[Boolean] identifier[forceDelete] , identifier[Boolean] identifier[reassignToParent] operator[SEP] {
identifier[UrlFormatter] identifier[formatter] operator[=] Keyword[new] identifier[UrlFormatter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[cascadeDelete] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[categoryId] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[forceDelete] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[reassignToParent] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[MozuUrl] operator[SEP] identifier[formatter] operator[SEP] identifier[getResourceUrl] operator[SEP] operator[SEP] , identifier[MozuUrl] operator[SEP] identifier[UrlLocation] operator[SEP] identifier[TENANT_POD] operator[SEP] operator[SEP]
}
|
public OperationFuture<Link> restore(Server server, Group group) {
return baseServerResponse(
restore(server, groupService.findByRef(group).getId())
);
} | class class_name[name] begin[{]
method[restore, return_type[type[OperationFuture]], modifier[public], parameter[server, group]] begin[{]
return[call[.baseServerResponse, parameter[call[.restore, parameter[member[.server], call[groupService.findByRef, parameter[member[.group]]]]]]]]
end[}]
END[}] | Keyword[public] identifier[OperationFuture] operator[<] identifier[Link] operator[>] identifier[restore] operator[SEP] identifier[Server] identifier[server] , identifier[Group] identifier[group] operator[SEP] {
Keyword[return] identifier[baseServerResponse] operator[SEP] identifier[restore] operator[SEP] identifier[server] , identifier[groupService] operator[SEP] identifier[findByRef] operator[SEP] identifier[group] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void pluginSkipped(int pluginId, String reason) {
Plugin plugin = pluginFactory.getPlugin(pluginId);
if (plugin == null) {
return;
}
pluginSkipped(plugin, reason);
} | class class_name[name] begin[{]
method[pluginSkipped, return_type[void], modifier[public], parameter[pluginId, reason]] begin[{]
local_variable[type[Plugin], plugin]
if[binary_operation[member[.plugin], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[.pluginSkipped, parameter[member[.plugin], member[.reason]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[pluginSkipped] operator[SEP] Keyword[int] identifier[pluginId] , identifier[String] identifier[reason] operator[SEP] {
identifier[Plugin] identifier[plugin] operator[=] identifier[pluginFactory] operator[SEP] identifier[getPlugin] operator[SEP] identifier[pluginId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[plugin] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[pluginSkipped] operator[SEP] identifier[plugin] , identifier[reason] operator[SEP] operator[SEP]
}
|
public Map<String, List<String>> buildDepsForAllComponents() {
Map<String, List<String>> ret = new HashMap<String, List<String>>();
Iterator<CmsSetupComponent> itComponents = CmsCollectionsGenericWrapper.<CmsSetupComponent> list(
m_components.elementList()).iterator();
while (itComponents.hasNext()) {
CmsSetupComponent component = itComponents.next();
// if component a depends on component b, and component c depends also on component b:
// build a map with a list containing "a" and "c" keyed by "b" to get a
// list of components depending on component "b"...
Iterator<String> itDeps = component.getDependencies().iterator();
while (itDeps.hasNext()) {
String dependency = itDeps.next();
// get the list of dependent modules
List<String> componentDependencies = ret.get(dependency);
if (componentDependencies == null) {
// build a new list if "b" has no dependent modules yet
componentDependencies = new ArrayList<String>();
ret.put(dependency, componentDependencies);
}
// add "a" as a module depending on "b"
componentDependencies.add(component.getId());
}
}
itComponents = CmsCollectionsGenericWrapper.<CmsSetupComponent> list(m_components.elementList()).iterator();
while (itComponents.hasNext()) {
CmsSetupComponent component = itComponents.next();
if (ret.get(component.getId()) == null) {
ret.put(component.getId(), new ArrayList<String>());
}
}
return ret;
} | class class_name[name] begin[{]
method[buildDepsForAllComponents, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], ret]
local_variable[type[Iterator], itComponents]
while[call[itComponents.hasNext, parameter[]]] begin[{]
local_variable[type[CmsSetupComponent], component]
local_variable[type[Iterator], itDeps]
while[call[itDeps.hasNext, parameter[]]] begin[{]
local_variable[type[String], dependency]
local_variable[type[List], componentDependencies]
if[binary_operation[member[.componentDependencies], ==, literal[null]]] begin[{]
assign[member[.componentDependencies], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
call[ret.put, parameter[member[.dependency], member[.componentDependencies]]]
else begin[{]
None
end[}]
call[componentDependencies.add, parameter[call[component.getId, parameter[]]]]
end[}]
end[}]
assign[member[.itComponents], call[.CmsCollectionsGenericWrapper, parameter[call[m_components.elementList, parameter[]]]]]
while[call[itComponents.hasNext, parameter[]]] begin[{]
local_variable[type[CmsSetupComponent], component]
if[binary_operation[call[ret.get, parameter[call[component.getId, parameter[]]]], ==, literal[null]]] begin[{]
call[ret.put, parameter[call[component.getId, parameter[]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
return[member[.ret]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[buildDepsForAllComponents] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[ret] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[CmsSetupComponent] operator[>] identifier[itComponents] operator[=] identifier[CmsCollectionsGenericWrapper] operator[SEP] operator[<] identifier[CmsSetupComponent] operator[>] identifier[list] operator[SEP] identifier[m_components] operator[SEP] identifier[elementList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itComponents] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsSetupComponent] identifier[component] operator[=] identifier[itComponents] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[itDeps] operator[=] identifier[component] operator[SEP] identifier[getDependencies] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itDeps] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[dependency] operator[=] identifier[itDeps] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[componentDependencies] operator[=] identifier[ret] operator[SEP] identifier[get] operator[SEP] identifier[dependency] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[componentDependencies] operator[==] Other[null] operator[SEP] {
identifier[componentDependencies] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[put] operator[SEP] identifier[dependency] , identifier[componentDependencies] operator[SEP] operator[SEP]
}
identifier[componentDependencies] operator[SEP] identifier[add] operator[SEP] identifier[component] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[itComponents] operator[=] identifier[CmsCollectionsGenericWrapper] operator[SEP] operator[<] identifier[CmsSetupComponent] operator[>] identifier[list] operator[SEP] identifier[m_components] operator[SEP] identifier[elementList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itComponents] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsSetupComponent] identifier[component] operator[=] identifier[itComponents] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ret] operator[SEP] identifier[get] operator[SEP] identifier[component] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[ret] operator[SEP] identifier[put] operator[SEP] identifier[component] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[ret] operator[SEP]
}
|
private String write(String logDir) throws IOException, ExecutionException, InterruptedException {
final File file = new File(logDir, "trace_" + System.currentTimeMillis() + ".json.gz");
if (file.exists()) {
throw new IOException("Trace file " + file.getAbsolutePath() + " already exists");
}
if (!file.getParentFile().canWrite() || !file.getParentFile().canExecute()) {
throw new IOException("Trace file " + file.getAbsolutePath() + " is not writable");
}
SettableFuture<Future<?>> f = SettableFuture.create();
m_work.offer(() -> f.set(dumpEvents(file)));
final Future<?> writeFuture = f.get();
if (writeFuture != null) {
writeFuture.get(); // Wait for the write to finish without blocking new events
return file.getAbsolutePath();
} else {
// A write is already in progress, ignore this request
return null;
}
} | class class_name[name] begin[{]
method[write, return_type[type[String]], modifier[private], parameter[logDir]] begin[{]
local_variable[type[File], file]
if[call[file.exists, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trace file "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" already exists"), 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)
else begin[{]
None
end[}]
if[binary_operation[call[file.getParentFile, parameter[]], ||, call[file.getParentFile, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trace file "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not writable"), 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)
else begin[{]
None
end[}]
local_variable[type[SettableFuture], f]
call[m_work.offer, parameter[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dumpEvents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), parameters=[])]]
local_variable[type[Future], writeFuture]
if[binary_operation[member[.writeFuture], !=, literal[null]]] begin[{]
call[writeFuture.get, parameter[]]
return[call[file.getAbsolutePath, parameter[]]]
else begin[{]
return[literal[null]]
end[}]
end[}]
END[}] | Keyword[private] identifier[String] identifier[write] operator[SEP] identifier[String] identifier[logDir] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ExecutionException] , identifier[InterruptedException] {
Keyword[final] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[logDir] , literal[String] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[canWrite] operator[SEP] operator[SEP] operator[||] operator[!] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[canExecute] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[SettableFuture] operator[<] identifier[Future] operator[<] operator[?] operator[>] operator[>] identifier[f] operator[=] identifier[SettableFuture] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[m_work] operator[SEP] identifier[offer] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[f] operator[SEP] identifier[set] operator[SEP] identifier[dumpEvents] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Future] operator[<] operator[?] operator[>] identifier[writeFuture] operator[=] identifier[f] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[writeFuture] operator[!=] Other[null] operator[SEP] {
identifier[writeFuture] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public static double truncate(double value, int places) {
if (places < 0) {
throw new IllegalArgumentException();
}
long factor = (long) java.lang.Math.pow(10, places);
value = value * factor;
long tmp = (long) value;
return (double) tmp / factor;
} | class class_name[name] begin[{]
method[truncate, return_type[type[double]], modifier[public static], parameter[value, places]] begin[{]
if[binary_operation[member[.places], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[long], factor]
assign[member[.value], binary_operation[member[.value], *, member[.factor]]]
local_variable[type[long], tmp]
return[binary_operation[Cast(expression=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), /, member[.factor]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[truncate] operator[SEP] Keyword[double] identifier[value] , Keyword[int] identifier[places] operator[SEP] {
Keyword[if] operator[SEP] identifier[places] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[long] identifier[factor] operator[=] operator[SEP] Keyword[long] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] Other[10] , identifier[places] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[value] operator[*] identifier[factor] operator[SEP] Keyword[long] identifier[tmp] operator[=] operator[SEP] Keyword[long] operator[SEP] identifier[value] operator[SEP] Keyword[return] operator[SEP] Keyword[double] operator[SEP] identifier[tmp] operator[/] identifier[factor] operator[SEP]
}
|
public void registerBeanFactory(String theName, String groupName, final Class beanClass) {
getProxyBuilder().registerFactory(theName, new AbstractFactory() {
public Object newInstance(FactoryBuilderSupport builder, Object name, Object value,
Map properties) throws InstantiationException, IllegalAccessException {
if (checkValueIsTypeNotString(value, name, beanClass)) {
return value;
} else {
return beanClass.newInstance();
}
}
});
getRegistrationGroup(groupName).add(theName);
} | class class_name[name] begin[{]
method[registerBeanFactory, return_type[void], modifier[public], parameter[theName, groupName, beanClass]] begin[{]
call[.getProxyBuilder, parameter[]]
call[.getRegistrationGroup, parameter[member[.groupName]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[registerBeanFactory] operator[SEP] identifier[String] identifier[theName] , identifier[String] identifier[groupName] , Keyword[final] identifier[Class] identifier[beanClass] operator[SEP] {
identifier[getProxyBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[registerFactory] operator[SEP] identifier[theName] , Keyword[new] identifier[AbstractFactory] operator[SEP] operator[SEP] {
Keyword[public] identifier[Object] identifier[newInstance] operator[SEP] identifier[FactoryBuilderSupport] identifier[builder] , identifier[Object] identifier[name] , identifier[Object] identifier[value] , identifier[Map] identifier[properties] operator[SEP] Keyword[throws] identifier[InstantiationException] , identifier[IllegalAccessException] {
Keyword[if] operator[SEP] identifier[checkValueIsTypeNotString] operator[SEP] identifier[value] , identifier[name] , identifier[beanClass] operator[SEP] operator[SEP] {
Keyword[return] identifier[value] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[beanClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP] identifier[getRegistrationGroup] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[theName] operator[SEP] operator[SEP]
}
|
private static void inlineImgNodes(final Document doc, final String basePath) {
// handle null inputs
if (doc == null) return;
final String fixedBasePath = basePath == null ? "" : basePath;
final List<Node> imageNodes = XMLUtilities.getChildNodes(doc.getDocumentElement(), "img");
for (final Node node : imageNodes) {
final NamedNodeMap attributes = node.getAttributes();
final Node srcAttribute = attributes.getNamedItem("src");
if (srcAttribute != null) {
final String src = srcAttribute.getTextContent();
final File srcFile = new File(fixedBasePath + "/" + src);
if (srcFile.exists()) {
final byte[] srcFileByteArray = FileUtilities.readFileContentsAsByteArray(srcFile);
if (srcFileByteArray != null) {
// get the file extension of the original image
final int extensionStringLocation = src.lastIndexOf(".");
// make sure we have an extension
if (extensionStringLocation != -1 && extensionStringLocation != src.length() - 1) {
final String extension = src.substring(extensionStringLocation + 1);
// encode the image
final byte[] srcFileEncodedByteArray = Base64.encodeBase64(srcFileByteArray);
final String srcFileEncodedString = new String(srcFileEncodedByteArray);
final Node parent = node.getParentNode();
if (parent != null) {
final Element newImgNode = doc.createElement("img");
newImgNode.setAttribute("src", "data:image/" + extension + ";base64," + srcFileEncodedString);
parent.replaceChild(newImgNode, node);
}
}
}
}
}
}
} | class class_name[name] begin[{]
method[inlineImgNodes, return_type[void], modifier[private static], parameter[doc, basePath]] begin[{]
if[binary_operation[member[.doc], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[String], fixedBasePath]
local_variable[type[List], imageNodes]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), name=attributes)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=NamedNodeMap, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="src")], member=getNamedItem, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), name=srcAttribute)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=srcAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTextContent, postfix_operators=[], prefix_operators=[], qualifier=srcAttribute, selectors=[], type_arguments=None), name=src)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=fixedBasePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=src, 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)), name=srcFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=srcFile, 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=srcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFileContentsAsByteArray, postfix_operators=[], prefix_operators=[], qualifier=FileUtilities, selectors=[], type_arguments=None), name=srcFileByteArray)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=srcFileByteArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), name=extensionStringLocation)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=extensionStringLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=extensionStringLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=extensionStringLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), name=extension)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=srcFileByteArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encodeBase64, postfix_operators=[], prefix_operators=[], qualifier=Base64, selectors=[], type_arguments=None), name=srcFileEncodedByteArray)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=srcFileEncodedByteArray, 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=String, sub_type=None)), name=srcFileEncodedString)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParentNode, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), name=parent)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="img")], member=createElement, postfix_operators=[], prefix_operators=[], qualifier=doc, selectors=[], type_arguments=None), name=newImgNode)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="src"), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data:image/"), operandr=MemberReference(member=extension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";base64,"), operator=+), operandr=MemberReference(member=srcFileEncodedString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=newImgNode, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newImgNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replaceChild, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), label=None)]))]))]))]))]))]), control=EnhancedForControl(iterable=MemberReference(member=imageNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[inlineImgNodes] operator[SEP] Keyword[final] identifier[Document] identifier[doc] , Keyword[final] identifier[String] identifier[basePath] operator[SEP] {
Keyword[if] operator[SEP] identifier[doc] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[final] identifier[String] identifier[fixedBasePath] operator[=] identifier[basePath] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[basePath] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Node] operator[>] identifier[imageNodes] operator[=] identifier[XMLUtilities] operator[SEP] identifier[getChildNodes] operator[SEP] identifier[doc] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Node] identifier[node] operator[:] identifier[imageNodes] operator[SEP] {
Keyword[final] identifier[NamedNodeMap] identifier[attributes] operator[=] identifier[node] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Node] identifier[srcAttribute] operator[=] identifier[attributes] operator[SEP] identifier[getNamedItem] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[srcAttribute] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[String] identifier[src] operator[=] identifier[srcAttribute] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[srcFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[fixedBasePath] operator[+] literal[String] operator[+] identifier[src] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[srcFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[srcFileByteArray] operator[=] identifier[FileUtilities] operator[SEP] identifier[readFileContentsAsByteArray] operator[SEP] identifier[srcFile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[srcFileByteArray] operator[!=] Other[null] operator[SEP] {
Keyword[final] Keyword[int] identifier[extensionStringLocation] operator[=] identifier[src] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extensionStringLocation] operator[!=] operator[-] Other[1] operator[&&] identifier[extensionStringLocation] operator[!=] identifier[src] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] {
Keyword[final] identifier[String] identifier[extension] operator[=] identifier[src] operator[SEP] identifier[substring] operator[SEP] identifier[extensionStringLocation] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[srcFileEncodedByteArray] operator[=] identifier[Base64] operator[SEP] identifier[encodeBase64] operator[SEP] identifier[srcFileByteArray] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[srcFileEncodedString] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[srcFileEncodedByteArray] operator[SEP] operator[SEP] Keyword[final] identifier[Node] identifier[parent] operator[=] identifier[node] operator[SEP] identifier[getParentNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[Element] identifier[newImgNode] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[newImgNode] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[+] identifier[extension] operator[+] literal[String] operator[+] identifier[srcFileEncodedString] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[replaceChild] operator[SEP] identifier[newImgNode] , identifier[node] operator[SEP] operator[SEP]
}
}
}
}
}
}
}
|
@Deprecated
public static URL convertRequestToUrl(Request<?> request, boolean removeLeadingSlashInResourcePath) {
return convertRequestToUrl(request, removeLeadingSlashInResourcePath, true);
} | class class_name[name] begin[{]
method[convertRequestToUrl, return_type[type[URL]], modifier[public static], parameter[request, removeLeadingSlashInResourcePath]] begin[{]
return[call[.convertRequestToUrl, parameter[member[.request], member[.removeLeadingSlashInResourcePath], literal[true]]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[URL] identifier[convertRequestToUrl] operator[SEP] identifier[Request] operator[<] operator[?] operator[>] identifier[request] , Keyword[boolean] identifier[removeLeadingSlashInResourcePath] operator[SEP] {
Keyword[return] identifier[convertRequestToUrl] operator[SEP] identifier[request] , identifier[removeLeadingSlashInResourcePath] , literal[boolean] operator[SEP] operator[SEP]
}
|
@Override
public boolean process(WeaveEnvironment environment, Scanner scanner) {
// interested in all classes:
final ScanResult scanResult = scanner.scan(new ScanRequest());
final Worker w = new Worker(environment);
boolean result = false;
for (WeavableClass<?> weavableClass : scanResult.getClasses()) {
result = w.weave(weavableClass.getTarget()) || result;
}
return result;
} | class class_name[name] begin[{]
method[process, return_type[type[boolean]], modifier[public], parameter[environment, scanner]] begin[{]
local_variable[type[ScanResult], scanResult]
local_variable[type[Worker], w]
local_variable[type[boolean], result]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTarget, postfix_operators=[], prefix_operators=[], qualifier=weavableClass, selectors=[], type_arguments=None)], member=weave, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), operandr=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClasses, postfix_operators=[], prefix_operators=[], qualifier=scanResult, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=weavableClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=WeavableClass, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[process] operator[SEP] identifier[WeaveEnvironment] identifier[environment] , identifier[Scanner] identifier[scanner] operator[SEP] {
Keyword[final] identifier[ScanResult] identifier[scanResult] operator[=] identifier[scanner] operator[SEP] identifier[scan] operator[SEP] Keyword[new] identifier[ScanRequest] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Worker] identifier[w] operator[=] Keyword[new] identifier[Worker] operator[SEP] identifier[environment] operator[SEP] operator[SEP] Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[WeavableClass] operator[<] operator[?] operator[>] identifier[weavableClass] operator[:] identifier[scanResult] operator[SEP] identifier[getClasses] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[=] identifier[w] operator[SEP] identifier[weave] operator[SEP] identifier[weavableClass] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[result] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public boolean toBoolean(String name, boolean defaultValue) {
String property = getProperties().getProperty(name);
return property != null ? Boolean.parseBoolean(property) : defaultValue;
} | class class_name[name] begin[{]
method[toBoolean, return_type[type[boolean]], modifier[public], parameter[name, defaultValue]] begin[{]
local_variable[type[String], property]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseBoolean, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[toBoolean] operator[SEP] identifier[String] identifier[name] , Keyword[boolean] identifier[defaultValue] operator[SEP] {
identifier[String] identifier[property] operator[=] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[property] operator[!=] Other[null] operator[?] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[property] operator[SEP] operator[:] identifier[defaultValue] operator[SEP]
}
|
public void serverChanged(HadoopServer location, int type) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
ServerView.this.viewer.refresh();
}
});
} | class class_name[name] begin[{]
method[serverChanged, return_type[void], modifier[public], parameter[location, type]] begin[{]
call[Display.getDefault, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[serverChanged] operator[SEP] identifier[HadoopServer] identifier[location] , Keyword[int] identifier[type] operator[SEP] {
identifier[Display] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[syncExec] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[ServerView] operator[SEP] Keyword[this] operator[SEP] identifier[viewer] operator[SEP] identifier[refresh] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@Override
public Set<Entry<String, GroovyRunner>> entrySet() {
Map<String, GroovyRunner> map = getMap();
readLock.lock();
try {
if (map.isEmpty()) {
return Collections.emptySet();
}
return Collections.unmodifiableSet(new LinkedHashSet<>(map.entrySet()));
} finally {
readLock.unlock();
}
} | class class_name[name] begin[{]
method[entrySet, return_type[type[Set]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], map]
call[readLock.lock, parameter[]]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=emptySet, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashSet, sub_type=None))], member=unmodifiableSet, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=readLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[Entry] operator[<] identifier[String] , identifier[GroovyRunner] operator[>] operator[>] identifier[entrySet] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[GroovyRunner] operator[>] identifier[map] operator[=] identifier[getMap] operator[SEP] operator[SEP] operator[SEP] identifier[readLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[map] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableSet] operator[SEP] Keyword[new] identifier[LinkedHashSet] operator[<] operator[>] operator[SEP] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[readLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static void setFieldValue(Object obj, ReflectedInfo info, Object value) throws Siren4JException {
if (obj == null) {
throw new IllegalArgumentException("obj cannot be null");
}
if (info == null) {
throw new IllegalArgumentException("info cannot be null");
}
if (info.getSetter() != null) {
Method setter = info.getSetter();
setter.setAccessible(true);
try {
setter.invoke(obj, new Object[]{value});
} catch (Exception e) {
throw new Siren4JException(e);
}
} else {
// No setter set field directly
try {
info.getField().set(obj, value);
} catch (Exception e) {
throw new Siren4JException(e);
}
}
} | class class_name[name] begin[{]
method[setFieldValue, return_type[void], modifier[public static], parameter[obj, info, value]] begin[{]
if[binary_operation[member[.obj], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="obj cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.info], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="info cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[info.getSetter, parameter[]], !=, literal[null]]] begin[{]
local_variable[type[Method], setter]
call[setter.setAccessible, parameter[literal[true]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=setter, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Siren4JException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getField, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[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=Siren4JException, 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[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setFieldValue] operator[SEP] identifier[Object] identifier[obj] , identifier[ReflectedInfo] identifier[info] , identifier[Object] identifier[value] operator[SEP] Keyword[throws] identifier[Siren4JException] {
Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[info] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[info] operator[SEP] identifier[getSetter] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[Method] identifier[setter] operator[=] identifier[info] operator[SEP] identifier[getSetter] operator[SEP] operator[SEP] operator[SEP] identifier[setter] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[try] {
identifier[setter] operator[SEP] identifier[invoke] operator[SEP] identifier[obj] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[value]
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Siren4JException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[try] {
identifier[info] operator[SEP] identifier[getField] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[obj] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Siren4JException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public int submitFilePathOrClasspath(
String filePathOrResourceClasspath) {
return submitStream(JMOptional
.getOptional(JMFiles.readLines(filePathOrResourceClasspath))
.orElseGet(() -> JMResources
.readLines(filePathOrResourceClasspath)).stream());
} | class class_name[name] begin[{]
method[submitFilePathOrClasspath, return_type[type[int]], modifier[public], parameter[filePathOrResourceClasspath]] begin[{]
return[call[.submitStream, parameter[call[JMOptional.getOptional, parameter[call[JMFiles.readLines, parameter[member[.filePathOrResourceClasspath]]]]]]]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[submitFilePathOrClasspath] operator[SEP] identifier[String] identifier[filePathOrResourceClasspath] operator[SEP] {
Keyword[return] identifier[submitStream] operator[SEP] identifier[JMOptional] operator[SEP] identifier[getOptional] operator[SEP] identifier[JMFiles] operator[SEP] identifier[readLines] operator[SEP] identifier[filePathOrResourceClasspath] operator[SEP] operator[SEP] operator[SEP] identifier[orElseGet] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[JMResources] operator[SEP] identifier[readLines] operator[SEP] identifier[filePathOrResourceClasspath] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public String toJSONString()
{
final JSONObject object = toJSONObject();
if (null != object)
{
return object.toString();
}
return null;
} | class class_name[name] begin[{]
method[toJSONString, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[JSONObject], object]
if[binary_operation[literal[null], !=, member[.object]]] begin[{]
return[call[object.toString, parameter[]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toJSONString] operator[SEP] operator[SEP] {
Keyword[final] identifier[JSONObject] identifier[object] operator[=] identifier[toJSONObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[object] operator[SEP] {
Keyword[return] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@Override
public CreateMatchmakingRuleSetResult createMatchmakingRuleSet(CreateMatchmakingRuleSetRequest request) {
request = beforeClientExecution(request);
return executeCreateMatchmakingRuleSet(request);
} | class class_name[name] begin[{]
method[createMatchmakingRuleSet, return_type[type[CreateMatchmakingRuleSetResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeCreateMatchmakingRuleSet, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CreateMatchmakingRuleSetResult] identifier[createMatchmakingRuleSet] operator[SEP] identifier[CreateMatchmakingRuleSetRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeCreateMatchmakingRuleSet] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
@Override
public <R> R notSupported(final SQLSupplier<R> supplier) {
return transactionManager.notSupported(supplier);
} | class class_name[name] begin[{]
method[notSupported, return_type[type[R]], modifier[public], parameter[supplier]] begin[{]
return[call[transactionManager.notSupported, parameter[member[.supplier]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[R] operator[>] identifier[R] identifier[notSupported] operator[SEP] Keyword[final] identifier[SQLSupplier] operator[<] identifier[R] operator[>] identifier[supplier] operator[SEP] {
Keyword[return] identifier[transactionManager] operator[SEP] identifier[notSupported] operator[SEP] identifier[supplier] operator[SEP] operator[SEP]
}
|
public Output compile(Context context) throws CompilationException {
Objects.requireNonNull(context, "Parameter context must not be null");
if (context instanceof FileContext) {
return compile((FileContext) context);
}
if (context instanceof StringContext) {
return compile((StringContext) context);
}
throw new UnsupportedContextException(context);
} | class class_name[name] begin[{]
method[compile, return_type[type[Output]], modifier[public], parameter[context]] begin[{]
call[Objects.requireNonNull, parameter[member[.context], literal["Parameter context must not be null"]]]
if[binary_operation[member[.context], instanceof, type[FileContext]]] begin[{]
return[call[.compile, parameter[Cast(expression=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FileContext, sub_type=None))]]]
else begin[{]
None
end[}]
if[binary_operation[member[.context], instanceof, type[StringContext]]] begin[{]
return[call[.compile, parameter[Cast(expression=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StringContext, sub_type=None))]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[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=UnsupportedContextException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] identifier[Output] identifier[compile] operator[SEP] identifier[Context] identifier[context] operator[SEP] Keyword[throws] identifier[CompilationException] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[context] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] Keyword[instanceof] identifier[FileContext] operator[SEP] {
Keyword[return] identifier[compile] operator[SEP] operator[SEP] identifier[FileContext] operator[SEP] identifier[context] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[context] Keyword[instanceof] identifier[StringContext] operator[SEP] {
Keyword[return] identifier[compile] operator[SEP] operator[SEP] identifier[StringContext] operator[SEP] identifier[context] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[UnsupportedContextException] operator[SEP] identifier[context] operator[SEP] operator[SEP]
}
|
private boolean isSupportedOnNode(Class<? extends HttpServlet> servlet) {
LOGGER.entering();
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(CONNECTION_TIMEOUT)
.setSocketTimeout(CONNECTION_TIMEOUT).build();
CloseableHttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(requestConfig).build();
String url = String.format("http://%s:%d/extra/%s", machine, getRemoteHost().getPort(),
servlet.getSimpleName());
try {
HttpGet get = new HttpGet(url);
final HttpResponse getResponse = client.execute(get);
if (getResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
proxyLogger.warning("Node " + getId() + " does not have or support " + servlet.getSimpleName());
LOGGER.exiting(false);
return false;
}
} catch (IOException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
LOGGER.exiting(false);
return false;
} finally {
try {
client.close();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
}
LOGGER.exiting(true);
return true;
} | class class_name[name] begin[{]
method[isSupportedOnNode, return_type[type[boolean]], modifier[private], parameter[servlet]] begin[{]
call[LOGGER.entering, parameter[]]
local_variable[type[RequestConfig], requestConfig]
local_variable[type[CloseableHttpClient], client]
local_variable[type[String], url]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=url, 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=HttpGet, sub_type=None)), name=get)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpGet, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), name=getResponse)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=HttpResponse, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatusLine, postfix_operators=[], prefix_operators=[], qualifier=getResponse, selectors=[MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=SC_OK, postfix_operators=[], prefix_operators=[], qualifier=HttpStatus, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Node "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not have or support "), operator=+), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=servlet, selectors=[], type_arguments=None), operator=+)], member=warning, postfix_operators=[], prefix_operators=[], qualifier=proxyLogger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=exiting, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=exiting, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)], label=None, resources=None)
call[LOGGER.exiting, parameter[literal[true]]]
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isSupportedOnNode] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[HttpServlet] operator[>] identifier[servlet] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[entering] operator[SEP] operator[SEP] operator[SEP] identifier[RequestConfig] identifier[requestConfig] operator[=] identifier[RequestConfig] operator[SEP] identifier[custom] operator[SEP] operator[SEP] operator[SEP] identifier[setConnectTimeout] operator[SEP] identifier[CONNECTION_TIMEOUT] operator[SEP] operator[SEP] identifier[setSocketTimeout] operator[SEP] identifier[CONNECTION_TIMEOUT] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[CloseableHttpClient] identifier[client] operator[=] identifier[HttpClientBuilder] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[setDefaultRequestConfig] operator[SEP] identifier[requestConfig] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[machine] , identifier[getRemoteHost] operator[SEP] operator[SEP] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] , identifier[servlet] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[HttpGet] identifier[get] operator[=] Keyword[new] identifier[HttpGet] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[final] identifier[HttpResponse] identifier[getResponse] operator[=] identifier[client] operator[SEP] identifier[execute] operator[SEP] identifier[get] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getResponse] operator[SEP] identifier[getStatusLine] operator[SEP] operator[SEP] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[!=] identifier[HttpStatus] operator[SEP] identifier[SC_OK] operator[SEP] {
identifier[proxyLogger] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[+] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[servlet] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[exiting] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[exiting] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
identifier[client] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[LOGGER] operator[SEP] identifier[exiting] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public static CountryList getCountries(Context context) {
if (mCountries != null) {
return mCountries;
}
mCountries = new CountryList();
try {
JSONArray countries = new JSONArray(getJsonFromRaw(context, R.raw.countries));
for (int i = 0; i < countries.length(); i++) {
try {
JSONObject country = (JSONObject) countries.get(i);
mCountries.add(new Country(country.getString("name"), country.getString("iso2"), country.getInt("dialCode")));
} catch (JSONException e) {
e.printStackTrace();
}
}
} catch (JSONException e) {
e.printStackTrace();
}
return mCountries;
} | class class_name[name] begin[{]
method[getCountries, return_type[type[CountryList]], modifier[public static], parameter[context]] begin[{]
if[binary_operation[member[.mCountries], !=, literal[null]]] begin[{]
return[member[.mCountries]]
else begin[{]
None
end[}]
assign[member[.mCountries], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CountryList, sub_type=None))]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=countries, postfix_operators=[], prefix_operators=[], qualifier=R.raw, selectors=[])], member=getJsonFromRaw, 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=JSONArray, sub_type=None)), name=countries)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=countries, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), name=country)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=country, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="iso2")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=country, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dialCode")], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=country, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Country, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=mCountries, 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=['JSONException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=countries, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], 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=['JSONException']))], finally_block=None, label=None, resources=None)
return[member[.mCountries]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CountryList] identifier[getCountries] operator[SEP] identifier[Context] identifier[context] operator[SEP] {
Keyword[if] operator[SEP] identifier[mCountries] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[mCountries] operator[SEP]
}
identifier[mCountries] operator[=] Keyword[new] identifier[CountryList] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[JSONArray] identifier[countries] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] identifier[getJsonFromRaw] operator[SEP] identifier[context] , identifier[R] operator[SEP] identifier[raw] operator[SEP] identifier[countries] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[countries] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[try] {
identifier[JSONObject] identifier[country] operator[=] operator[SEP] identifier[JSONObject] operator[SEP] identifier[countries] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[mCountries] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Country] operator[SEP] identifier[country] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[country] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[country] operator[SEP] identifier[getInt] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[JSONException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[JSONException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[mCountries] operator[SEP]
}
|
public void marshall(GetDeploymentsRequest getDeploymentsRequest, ProtocolMarshaller protocolMarshaller) {
if (getDeploymentsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getDeploymentsRequest.getRestApiId(), RESTAPIID_BINDING);
protocolMarshaller.marshall(getDeploymentsRequest.getPosition(), POSITION_BINDING);
protocolMarshaller.marshall(getDeploymentsRequest.getLimit(), LIMIT_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[getDeploymentsRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.getDeploymentsRequest], ==, 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=getRestApiId, postfix_operators=[], prefix_operators=[], qualifier=getDeploymentsRequest, selectors=[], type_arguments=None), MemberReference(member=RESTAPIID_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=getPosition, postfix_operators=[], prefix_operators=[], qualifier=getDeploymentsRequest, selectors=[], type_arguments=None), MemberReference(member=POSITION_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=getLimit, postfix_operators=[], prefix_operators=[], qualifier=getDeploymentsRequest, selectors=[], type_arguments=None), MemberReference(member=LIMIT_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[GetDeploymentsRequest] identifier[getDeploymentsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[getDeploymentsRequest] 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[getDeploymentsRequest] operator[SEP] identifier[getRestApiId] operator[SEP] operator[SEP] , identifier[RESTAPIID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getDeploymentsRequest] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] , identifier[POSITION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getDeploymentsRequest] operator[SEP] identifier[getLimit] operator[SEP] operator[SEP] , identifier[LIMIT_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
protected void _predict(Dataframe newData) {
//This method uses similar approach to the training but the most important
//difference is that we do not wish to modify the original training params.
//as a result we need to modify the code to use additional temporary
//counts for the testing data and merge them with the parameters from the
//training data in order to make a decision
ModelParameters modelParameters = knowledgeBase.getModelParameters();
TrainingParameters trainingParameters = knowledgeBase.getTrainingParameters();
//get model parameters
int d = modelParameters.getD();
int k = trainingParameters.getK(); //number of topics
Map<List<Object>, Integer> topicWordCounts = modelParameters.getTopicWordCounts();
Map<Integer, Integer> topicCounts = modelParameters.getTopicCounts();
StorageEngine storageEngine = knowledgeBase.getStorageEngine();
//we create temporary maps for the prediction sets to avoid modifing the maps that we already learned
Map<List<Object>, Integer> tmp_topicAssignmentOfDocumentWord = storageEngine.getBigMap("tmp_topicAssignmentOfDocumentWord", (Class<List<Object>>)(Class<?>)List.class, Integer.class, MapType.HASHMAP, StorageHint.IN_CACHE, false, true);
Map<List<Integer>, Integer> tmp_documentTopicCounts = storageEngine.getBigMap("tmp_documentTopicCounts", (Class<List<Integer>>)(Class<?>)List.class, Integer.class, MapType.HASHMAP, StorageHint.IN_MEMORY, false, true);
Map<List<Object>, Integer> tmp_topicWordCounts = storageEngine.getBigMap("tmp_topicWordCounts", (Class<List<Object>>)(Class<?>)List.class, Integer.class, MapType.HASHMAP, StorageHint.IN_CACHE, false, true);
Map<Integer, Integer> tmp_topicCounts = storageEngine.getBigMap("tmp_topicCounts", Integer.class, Integer.class, MapType.HASHMAP, StorageHint.IN_MEMORY, false, true);
//initialize topic assignments of each word randomly and update the counters
for(Map.Entry<Integer, Record> e : newData.entries()) {
Integer rId = e.getKey();
Record r = e.getValue();
Integer documentId = rId;
for(Map.Entry<Object, Object> entry : r.getX().entrySet()) {
Object wordPosition = entry.getKey();
Object word = entry.getValue();
//sample a topic
Integer topic = PHPMethods.mt_rand(0,k-1);
increase(tmp_topicCounts, topic);
tmp_topicAssignmentOfDocumentWord.put(Arrays.asList(documentId, wordPosition), topic);
increase(tmp_documentTopicCounts, Arrays.asList(documentId, topic));
increase(tmp_topicWordCounts, Arrays.asList(topic, word));
}
}
double alpha = trainingParameters.getAlpha();
double beta = trainingParameters.getBeta();
int maxIterations = trainingParameters.getMaxIterations();
for(int iteration=0;iteration<maxIterations;++iteration) {
logger.debug("Iteration {}", iteration);
//collapsed gibbs sampler
int changedCounter = 0;
double perplexity = 0.0;
double totalDatasetWords = 0.0;
for(Map.Entry<Integer, Record> e : newData.entries()) {
Integer rId = e.getKey();
Record r = e.getValue();
Integer documentId = rId;
AssociativeArray topicAssignments = new AssociativeArray();
for(int j=0;j<k;++j) {
topicAssignments.put(j, 0.0);
}
int totalDocumentWords = r.getX().size();
totalDatasetWords+=totalDocumentWords;
for(Map.Entry<Object, Object> entry : r.getX().entrySet()) {
Object wordPosition = entry.getKey();
Object word = entry.getValue();
//remove the word from the dataset
Integer topic = tmp_topicAssignmentOfDocumentWord.get(Arrays.asList(documentId, wordPosition));
decrease(tmp_topicCounts, topic);
decrease(tmp_documentTopicCounts, Arrays.asList(documentId, topic));
decrease(tmp_topicWordCounts, Arrays.asList(topic, word));
int numberOfDocumentWords = r.getX().size()-1;
//compute the posteriors of the topics and sample from it
AssociativeArray topicProbabilities = new AssociativeArray();
for(int j=0;j<k;++j) {
//get the counts from the current testing data
List<Object> topicWordKey = Arrays.asList(j,word);
Integer njw = tmp_topicWordCounts.get(topicWordKey);
double enumerator;
if(njw !=null) {
enumerator = njw + beta;
}
else {
enumerator = beta;
}
//get also the counts from the training data
Integer njw_original = topicWordCounts.get(topicWordKey);
if(njw_original!=null) {
enumerator+=njw_original;
}
Integer njd = tmp_documentTopicCounts.get(Arrays.asList(documentId, j));
if(njd != null) {
enumerator *= (njd + alpha);
}
else {
enumerator *= alpha;
}
//add the counts from testing data
double denominator = tmp_topicCounts.get((Integer)j)+beta*d -1;
//and the ones from training data
denominator+=topicCounts.get((Integer)j);
denominator *= numberOfDocumentWords+alpha*k;
topicProbabilities.put(j, enumerator/denominator);
}
perplexity += Math.log(Descriptives.sum(topicProbabilities.toFlatDataCollection()));
//normalize probabilities
//Descriptives.normalize(topicProbabilities);
//sample from these probabilieis
Integer newTopic = (Integer)SimpleRandomSampling.weightedSampling(topicProbabilities, 1, true).iterator().next();
topic = newTopic; //new topic assignment
//add back the word in the dataset
tmp_topicAssignmentOfDocumentWord.put(Arrays.asList(documentId, wordPosition), topic);
increase(tmp_topicCounts, topic);
increase(tmp_documentTopicCounts, Arrays.asList(documentId, topic));
increase(tmp_topicWordCounts, Arrays.asList(topic, word));
topicAssignments.put(topic, TypeInference.toDouble(topicAssignments.get(topic))+1.0/totalDocumentWords);
}
Object mainTopic=MapMethods.selectMaxKeyValue(topicAssignments).getKey();
if(!mainTopic.equals(r.getYPredicted())) {
++changedCounter;
}
newData._unsafe_set(rId, new Record(r.getX(), r.getY(), mainTopic, topicAssignments));
}
perplexity=Math.exp(-perplexity/totalDatasetWords);
logger.debug("Reassigned Records {} - Perplexity: {}", changedCounter, perplexity);
if(changedCounter==0) {
break;
}
}
//Drop the temporary Collection
storageEngine.dropBigMap("tmp_topicAssignmentOfDocumentWord", tmp_topicAssignmentOfDocumentWord);
storageEngine.dropBigMap("tmp_documentTopicCounts", tmp_documentTopicCounts);
storageEngine.dropBigMap("tmp_topicWordCounts", tmp_topicWordCounts);
storageEngine.dropBigMap("tmp_topicCounts", tmp_topicCounts);
} | class class_name[name] begin[{]
method[_predict, return_type[void], modifier[protected], parameter[newData]] begin[{]
local_variable[type[ModelParameters], modelParameters]
local_variable[type[TrainingParameters], trainingParameters]
local_variable[type[int], d]
local_variable[type[int], k]
local_variable[type[Map], topicWordCounts]
local_variable[type[Map], topicCounts]
local_variable[type[StorageEngine], storageEngine]
local_variable[type[Map], tmp_topicAssignmentOfDocumentWord]
local_variable[type[Map], tmp_documentTopicCounts]
local_variable[type[Map], tmp_topicWordCounts]
local_variable[type[Map], tmp_topicCounts]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=rId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=documentId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), 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=wordPosition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=word)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=mt_rand, postfix_operators=[], prefix_operators=[], qualifier=PHPMethods, selectors=[], type_arguments=None), name=topic)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_topicCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=increase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=documentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wordPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=tmp_topicAssignmentOfDocumentWord, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_documentTopicCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=documentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=increase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_topicWordCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=increase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, 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)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=newData, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
local_variable[type[double], alpha]
local_variable[type[double], beta]
local_variable[type[int], maxIterations]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Iteration {}"), MemberReference(member=iteration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=changedCounter)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), name=perplexity)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), name=totalDatasetWords)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=rId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=documentId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, 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=AssociativeArray, sub_type=None)), name=topicAssignments)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AssociativeArray, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0)], member=put, postfix_operators=[], prefix_operators=[], qualifier=topicAssignments, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=totalDocumentWords)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalDatasetWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=totalDocumentWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), 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=wordPosition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=word)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=documentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wordPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=tmp_topicAssignmentOfDocumentWord, selectors=[], type_arguments=None), name=topic)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_topicCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decrease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_documentTopicCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=documentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=decrease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_topicWordCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=decrease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=numberOfDocumentWords)], modifiers=set(), type=BasicType(dimensions=[], name=int)), 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=AssociativeArray, sub_type=None)), name=topicProbabilities)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AssociativeArray, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), name=topicWordKey)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=topicWordKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tmp_topicWordCounts, selectors=[], type_arguments=None), name=njw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=enumerator)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=njw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=enumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=beta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=enumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=njw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=beta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=topicWordKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=topicWordCounts, selectors=[], type_arguments=None), name=njw_original)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=njw_original, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=enumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=njw_original, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=documentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=tmp_documentTopicCounts, selectors=[], type_arguments=None), name=njd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=njd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=enumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=enumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=BinaryOperation(operandl=MemberReference(member=njd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Cast(expression=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=get, postfix_operators=[], prefix_operators=[], qualifier=tmp_topicCounts, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=beta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=denominator)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=denominator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=get, postfix_operators=[], prefix_operators=[], qualifier=topicCounts, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=denominator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=BinaryOperation(operandl=MemberReference(member=numberOfDocumentWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=enumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=denominator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)], member=put, postfix_operators=[], prefix_operators=[], qualifier=topicProbabilities, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=perplexity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toFlatDataCollection, postfix_operators=[], prefix_operators=[], qualifier=topicProbabilities, selectors=[], type_arguments=None)], member=sum, postfix_operators=[], prefix_operators=[], qualifier=Descriptives, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=topicProbabilities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=weightedSampling, postfix_operators=[], prefix_operators=[], qualifier=SimpleRandomSampling, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=newTopic)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newTopic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=documentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wordPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=tmp_topicAssignmentOfDocumentWord, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_topicCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=increase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_documentTopicCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=documentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=increase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp_topicWordCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=increase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=topicAssignments, selectors=[], type_arguments=None)], member=toDouble, postfix_operators=[], prefix_operators=[], qualifier=TypeInference, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operandr=MemberReference(member=totalDocumentWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operator=+)], member=put, postfix_operators=[], prefix_operators=[], qualifier=topicAssignments, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, 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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=topicAssignments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=selectMaxKeyValue, postfix_operators=[], prefix_operators=[], qualifier=MapMethods, selectors=[MethodInvocation(arguments=[], member=getKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=mainTopic)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getYPredicted, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=mainTopic, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=changedCounter, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getY, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), MemberReference(member=mainTopic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topicAssignments, 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=Record, sub_type=None))], member=_unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=newData, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=newData, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=perplexity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=perplexity, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), operandr=MemberReference(member=totalDatasetWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)], member=exp, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reassigned Records {} - Perplexity: {}"), MemberReference(member=changedCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=perplexity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=changedCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iteration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxIterations, 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=iteration)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=iteration, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
call[storageEngine.dropBigMap, parameter[literal["tmp_topicAssignmentOfDocumentWord"], member[.tmp_topicAssignmentOfDocumentWord]]]
call[storageEngine.dropBigMap, parameter[literal["tmp_documentTopicCounts"], member[.tmp_documentTopicCounts]]]
call[storageEngine.dropBigMap, parameter[literal["tmp_topicWordCounts"], member[.tmp_topicWordCounts]]]
call[storageEngine.dropBigMap, parameter[literal["tmp_topicCounts"], member[.tmp_topicCounts]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[_predict] operator[SEP] identifier[Dataframe] identifier[newData] operator[SEP] {
identifier[ModelParameters] identifier[modelParameters] operator[=] identifier[knowledgeBase] operator[SEP] identifier[getModelParameters] operator[SEP] operator[SEP] operator[SEP] identifier[TrainingParameters] identifier[trainingParameters] operator[=] identifier[knowledgeBase] operator[SEP] identifier[getTrainingParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[d] operator[=] identifier[modelParameters] operator[SEP] identifier[getD] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[k] operator[=] identifier[trainingParameters] operator[SEP] identifier[getK] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[List] operator[<] identifier[Object] operator[>] , identifier[Integer] operator[>] identifier[topicWordCounts] operator[=] identifier[modelParameters] operator[SEP] identifier[getTopicWordCounts] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[topicCounts] operator[=] identifier[modelParameters] operator[SEP] identifier[getTopicCounts] operator[SEP] operator[SEP] operator[SEP] identifier[StorageEngine] identifier[storageEngine] operator[=] identifier[knowledgeBase] operator[SEP] identifier[getStorageEngine] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[List] operator[<] identifier[Object] operator[>] , identifier[Integer] operator[>] identifier[tmp_topicAssignmentOfDocumentWord] operator[=] identifier[storageEngine] operator[SEP] identifier[getBigMap] operator[SEP] literal[String] , operator[SEP] identifier[Class] operator[<] identifier[List] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[List] operator[SEP] Keyword[class] , identifier[Integer] operator[SEP] Keyword[class] , identifier[MapType] operator[SEP] identifier[HASHMAP] , identifier[StorageHint] operator[SEP] identifier[IN_CACHE] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] , identifier[Integer] operator[>] identifier[tmp_documentTopicCounts] operator[=] identifier[storageEngine] operator[SEP] identifier[getBigMap] operator[SEP] literal[String] , operator[SEP] identifier[Class] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[List] operator[SEP] Keyword[class] , identifier[Integer] operator[SEP] Keyword[class] , identifier[MapType] operator[SEP] identifier[HASHMAP] , identifier[StorageHint] operator[SEP] identifier[IN_MEMORY] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[List] operator[<] identifier[Object] operator[>] , identifier[Integer] operator[>] identifier[tmp_topicWordCounts] operator[=] identifier[storageEngine] operator[SEP] identifier[getBigMap] operator[SEP] literal[String] , operator[SEP] identifier[Class] operator[<] identifier[List] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[List] operator[SEP] Keyword[class] , identifier[Integer] operator[SEP] Keyword[class] , identifier[MapType] operator[SEP] identifier[HASHMAP] , identifier[StorageHint] operator[SEP] identifier[IN_CACHE] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[tmp_topicCounts] operator[=] identifier[storageEngine] operator[SEP] identifier[getBigMap] operator[SEP] literal[String] , identifier[Integer] operator[SEP] Keyword[class] , identifier[Integer] operator[SEP] Keyword[class] , identifier[MapType] operator[SEP] identifier[HASHMAP] , identifier[StorageHint] operator[SEP] identifier[IN_MEMORY] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[Record] operator[>] identifier[e] operator[:] identifier[newData] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] {
identifier[Integer] identifier[rId] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[r] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[documentId] operator[=] identifier[rId] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[r] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Object] identifier[wordPosition] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[word] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[topic] operator[=] identifier[PHPMethods] operator[SEP] identifier[mt_rand] operator[SEP] Other[0] , identifier[k] operator[-] Other[1] operator[SEP] operator[SEP] identifier[increase] operator[SEP] identifier[tmp_topicCounts] , identifier[topic] operator[SEP] operator[SEP] identifier[tmp_topicAssignmentOfDocumentWord] operator[SEP] identifier[put] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[documentId] , identifier[wordPosition] operator[SEP] , identifier[topic] operator[SEP] operator[SEP] identifier[increase] operator[SEP] identifier[tmp_documentTopicCounts] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[documentId] , identifier[topic] operator[SEP] operator[SEP] operator[SEP] identifier[increase] operator[SEP] identifier[tmp_topicWordCounts] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[topic] , identifier[word] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[double] identifier[alpha] operator[=] identifier[trainingParameters] operator[SEP] identifier[getAlpha] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[beta] operator[=] identifier[trainingParameters] operator[SEP] identifier[getBeta] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[maxIterations] operator[=] identifier[trainingParameters] operator[SEP] identifier[getMaxIterations] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[iteration] operator[=] Other[0] operator[SEP] identifier[iteration] operator[<] identifier[maxIterations] operator[SEP] operator[++] identifier[iteration] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[iteration] operator[SEP] operator[SEP] Keyword[int] identifier[changedCounter] operator[=] Other[0] operator[SEP] Keyword[double] identifier[perplexity] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[totalDatasetWords] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[Record] operator[>] identifier[e] operator[:] identifier[newData] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] {
identifier[Integer] identifier[rId] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[r] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[documentId] operator[=] identifier[rId] operator[SEP] identifier[AssociativeArray] identifier[topicAssignments] operator[=] Keyword[new] identifier[AssociativeArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[k] operator[SEP] operator[++] identifier[j] operator[SEP] {
identifier[topicAssignments] operator[SEP] identifier[put] operator[SEP] identifier[j] , literal[Float] operator[SEP] operator[SEP]
}
Keyword[int] identifier[totalDocumentWords] operator[=] identifier[r] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[totalDatasetWords] operator[+=] identifier[totalDocumentWords] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[r] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Object] identifier[wordPosition] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[word] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[topic] operator[=] identifier[tmp_topicAssignmentOfDocumentWord] operator[SEP] identifier[get] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[documentId] , identifier[wordPosition] operator[SEP] operator[SEP] operator[SEP] identifier[decrease] operator[SEP] identifier[tmp_topicCounts] , identifier[topic] operator[SEP] operator[SEP] identifier[decrease] operator[SEP] identifier[tmp_documentTopicCounts] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[documentId] , identifier[topic] operator[SEP] operator[SEP] operator[SEP] identifier[decrease] operator[SEP] identifier[tmp_topicWordCounts] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[topic] , identifier[word] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numberOfDocumentWords] operator[=] identifier[r] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[AssociativeArray] identifier[topicProbabilities] operator[=] Keyword[new] identifier[AssociativeArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[k] operator[SEP] operator[++] identifier[j] operator[SEP] {
identifier[List] operator[<] identifier[Object] operator[>] identifier[topicWordKey] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[j] , identifier[word] operator[SEP] operator[SEP] identifier[Integer] identifier[njw] operator[=] identifier[tmp_topicWordCounts] operator[SEP] identifier[get] operator[SEP] identifier[topicWordKey] operator[SEP] operator[SEP] Keyword[double] identifier[enumerator] operator[SEP] Keyword[if] operator[SEP] identifier[njw] operator[!=] Other[null] operator[SEP] {
identifier[enumerator] operator[=] identifier[njw] operator[+] identifier[beta] operator[SEP]
}
Keyword[else] {
identifier[enumerator] operator[=] identifier[beta] operator[SEP]
}
identifier[Integer] identifier[njw_original] operator[=] identifier[topicWordCounts] operator[SEP] identifier[get] operator[SEP] identifier[topicWordKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[njw_original] operator[!=] Other[null] operator[SEP] {
identifier[enumerator] operator[+=] identifier[njw_original] operator[SEP]
}
identifier[Integer] identifier[njd] operator[=] identifier[tmp_documentTopicCounts] operator[SEP] identifier[get] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[documentId] , identifier[j] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[njd] operator[!=] Other[null] operator[SEP] {
identifier[enumerator] operator[*=] operator[SEP] identifier[njd] operator[+] identifier[alpha] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[enumerator] operator[*=] identifier[alpha] operator[SEP]
}
Keyword[double] identifier[denominator] operator[=] identifier[tmp_topicCounts] operator[SEP] identifier[get] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[j] operator[SEP] operator[+] identifier[beta] operator[*] identifier[d] operator[-] Other[1] operator[SEP] identifier[denominator] operator[+=] identifier[topicCounts] operator[SEP] identifier[get] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[denominator] operator[*=] identifier[numberOfDocumentWords] operator[+] identifier[alpha] operator[*] identifier[k] operator[SEP] identifier[topicProbabilities] operator[SEP] identifier[put] operator[SEP] identifier[j] , identifier[enumerator] operator[/] identifier[denominator] operator[SEP] operator[SEP]
}
identifier[perplexity] operator[+=] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[Descriptives] operator[SEP] identifier[sum] operator[SEP] identifier[topicProbabilities] operator[SEP] identifier[toFlatDataCollection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[newTopic] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[SimpleRandomSampling] operator[SEP] identifier[weightedSampling] operator[SEP] identifier[topicProbabilities] , Other[1] , literal[boolean] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[topic] operator[=] identifier[newTopic] operator[SEP] identifier[tmp_topicAssignmentOfDocumentWord] operator[SEP] identifier[put] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[documentId] , identifier[wordPosition] operator[SEP] , identifier[topic] operator[SEP] operator[SEP] identifier[increase] operator[SEP] identifier[tmp_topicCounts] , identifier[topic] operator[SEP] operator[SEP] identifier[increase] operator[SEP] identifier[tmp_documentTopicCounts] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[documentId] , identifier[topic] operator[SEP] operator[SEP] operator[SEP] identifier[increase] operator[SEP] identifier[tmp_topicWordCounts] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[topic] , identifier[word] operator[SEP] operator[SEP] operator[SEP] identifier[topicAssignments] operator[SEP] identifier[put] operator[SEP] identifier[topic] , identifier[TypeInference] operator[SEP] identifier[toDouble] operator[SEP] identifier[topicAssignments] operator[SEP] identifier[get] operator[SEP] identifier[topic] operator[SEP] operator[SEP] operator[+] literal[Float] operator[/] identifier[totalDocumentWords] operator[SEP] operator[SEP]
}
identifier[Object] identifier[mainTopic] operator[=] identifier[MapMethods] operator[SEP] identifier[selectMaxKeyValue] operator[SEP] identifier[topicAssignments] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mainTopic] operator[SEP] identifier[equals] operator[SEP] identifier[r] operator[SEP] identifier[getYPredicted] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
operator[++] identifier[changedCounter] operator[SEP]
}
identifier[newData] operator[SEP] identifier[_unsafe_set] operator[SEP] identifier[rId] , Keyword[new] identifier[Record] operator[SEP] identifier[r] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[r] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[mainTopic] , identifier[topicAssignments] operator[SEP] operator[SEP] operator[SEP]
}
identifier[perplexity] operator[=] identifier[Math] operator[SEP] identifier[exp] operator[SEP] operator[-] identifier[perplexity] operator[/] identifier[totalDatasetWords] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[changedCounter] , identifier[perplexity] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[changedCounter] operator[==] Other[0] operator[SEP] {
Keyword[break] operator[SEP]
}
}
identifier[storageEngine] operator[SEP] identifier[dropBigMap] operator[SEP] literal[String] , identifier[tmp_topicAssignmentOfDocumentWord] operator[SEP] operator[SEP] identifier[storageEngine] operator[SEP] identifier[dropBigMap] operator[SEP] literal[String] , identifier[tmp_documentTopicCounts] operator[SEP] operator[SEP] identifier[storageEngine] operator[SEP] identifier[dropBigMap] operator[SEP] literal[String] , identifier[tmp_topicWordCounts] operator[SEP] operator[SEP] identifier[storageEngine] operator[SEP] identifier[dropBigMap] operator[SEP] literal[String] , identifier[tmp_topicCounts] operator[SEP] operator[SEP]
}
|
protected void startQueue() {
if (executor == null) {
logger.debug("Starting the receiving thread pool.");
executor = new ThreadPoolExecutor(
numberOfWorkerThreads,
numberOfWorkerThreads,
threadKeepAliveTime, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(),
getThreadFactory());
executor.allowCoreThreadTimeOut(true);
//Start with one thread, and build it up gradually as it needs.
executor.prestartCoreThread();
logger.info("ReceiveQueue started! Current pool size: {}", executor.getPoolSize());
} else {
if (executor.getCorePoolSize() < numberOfWorkerThreads) {
//If the number has increased we need to set the max first, or we'll get an IllegalArgumentException
executor.setMaximumPoolSize(numberOfWorkerThreads);
executor.setCorePoolSize(numberOfWorkerThreads);
} else if (executor.getCorePoolSize() > numberOfWorkerThreads) {
//If the number has decreased we need to set the core first.
executor.setCorePoolSize(numberOfWorkerThreads);
executor.setMaximumPoolSize(numberOfWorkerThreads);
}
logger.info("ReceiveQueue running. Current pool size: {}. Current Queue size: {}",
executor.getPoolSize(), getQueueSize());
logger.info("Nr of active pool-threads: {}", executor.getActiveCount());
}
} | class class_name[name] begin[{]
method[startQueue, return_type[void], modifier[protected], parameter[]] begin[{]
if[binary_operation[member[.executor], ==, literal[null]]] begin[{]
call[logger.debug, parameter[literal["Starting the receiving thread pool."]]]
assign[member[.executor], ClassCreator(arguments=[MemberReference(member=numberOfWorkerThreads, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numberOfWorkerThreads, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=threadKeepAliveTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[]), 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=Runnable, sub_type=None))], dimensions=None, name=LinkedBlockingQueue, sub_type=None)), MethodInvocation(arguments=[], member=getThreadFactory, 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=ThreadPoolExecutor, sub_type=None))]
call[executor.allowCoreThreadTimeOut, parameter[literal[true]]]
call[executor.prestartCoreThread, parameter[]]
call[logger.info, parameter[literal["ReceiveQueue started! Current pool size: {}"], call[executor.getPoolSize, parameter[]]]]
else begin[{]
if[binary_operation[call[executor.getCorePoolSize, parameter[]], <, member[.numberOfWorkerThreads]]] begin[{]
call[executor.setMaximumPoolSize, parameter[member[.numberOfWorkerThreads]]]
call[executor.setCorePoolSize, parameter[member[.numberOfWorkerThreads]]]
else begin[{]
if[binary_operation[call[executor.getCorePoolSize, parameter[]], >, member[.numberOfWorkerThreads]]] begin[{]
call[executor.setCorePoolSize, parameter[member[.numberOfWorkerThreads]]]
call[executor.setMaximumPoolSize, parameter[member[.numberOfWorkerThreads]]]
else begin[{]
None
end[}]
end[}]
call[logger.info, parameter[literal["ReceiveQueue running. Current pool size: {}. Current Queue size: {}"], call[executor.getPoolSize, parameter[]], call[.getQueueSize, parameter[]]]]
call[logger.info, parameter[literal["Nr of active pool-threads: {}"], call[executor.getActiveCount, parameter[]]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[startQueue] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[executor] operator[==] Other[null] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[executor] operator[=] Keyword[new] identifier[ThreadPoolExecutor] operator[SEP] identifier[numberOfWorkerThreads] , identifier[numberOfWorkerThreads] , identifier[threadKeepAliveTime] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] , Keyword[new] identifier[LinkedBlockingQueue] operator[<] identifier[Runnable] operator[>] operator[SEP] operator[SEP] , identifier[getThreadFactory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[executor] operator[SEP] identifier[allowCoreThreadTimeOut] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[executor] operator[SEP] identifier[prestartCoreThread] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[executor] operator[SEP] identifier[getPoolSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[executor] operator[SEP] identifier[getCorePoolSize] operator[SEP] operator[SEP] operator[<] identifier[numberOfWorkerThreads] operator[SEP] {
identifier[executor] operator[SEP] identifier[setMaximumPoolSize] operator[SEP] identifier[numberOfWorkerThreads] operator[SEP] operator[SEP] identifier[executor] operator[SEP] identifier[setCorePoolSize] operator[SEP] identifier[numberOfWorkerThreads] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[executor] operator[SEP] identifier[getCorePoolSize] operator[SEP] operator[SEP] operator[>] identifier[numberOfWorkerThreads] operator[SEP] {
identifier[executor] operator[SEP] identifier[setCorePoolSize] operator[SEP] identifier[numberOfWorkerThreads] operator[SEP] operator[SEP] identifier[executor] operator[SEP] identifier[setMaximumPoolSize] operator[SEP] identifier[numberOfWorkerThreads] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[executor] operator[SEP] identifier[getPoolSize] operator[SEP] operator[SEP] , identifier[getQueueSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[executor] operator[SEP] identifier[getActiveCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Deprecated
public File getClassesDir() {
final FileCollection col = getClassesDirs();
return (col == null) ? null : col.getSingleFile();
} | class class_name[name] begin[{]
method[getClassesDir, return_type[type[File]], modifier[public], parameter[]] begin[{]
local_variable[type[FileCollection], col]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getSingleFile, postfix_operators=[], prefix_operators=[], qualifier=col, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] identifier[File] identifier[getClassesDir] operator[SEP] operator[SEP] {
Keyword[final] identifier[FileCollection] identifier[col] operator[=] identifier[getClassesDirs] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[col] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[col] operator[SEP] identifier[getSingleFile] operator[SEP] operator[SEP] operator[SEP]
}
|
protected String determineDefaultSegmentValue(Properties params) {
boolean preferSegmentPerEntity = ConfigurationHelper.getBoolean( CONFIG_PREFER_SEGMENT_PER_ENTITY, params, false );
String defaultToUse = preferSegmentPerEntity ? params.getProperty( PersistentIdentifierGenerator.TABLE ) : DEF_SEGMENT_VALUE;
log.infof( "explicit segment value for id generator [%1$s.%2$s] suggested; using default [%3$s]", tableName, segmentColumnName, defaultToUse );
return defaultToUse;
} | class class_name[name] begin[{]
method[determineDefaultSegmentValue, return_type[type[String]], modifier[protected], parameter[params]] begin[{]
local_variable[type[boolean], preferSegmentPerEntity]
local_variable[type[String], defaultToUse]
call[log.infof, parameter[literal["explicit segment value for id generator [%1$s.%2$s] suggested; using default [%3$s]"], member[.tableName], member[.segmentColumnName], member[.defaultToUse]]]
return[member[.defaultToUse]]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[determineDefaultSegmentValue] operator[SEP] identifier[Properties] identifier[params] operator[SEP] {
Keyword[boolean] identifier[preferSegmentPerEntity] operator[=] identifier[ConfigurationHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[CONFIG_PREFER_SEGMENT_PER_ENTITY] , identifier[params] , literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[defaultToUse] operator[=] identifier[preferSegmentPerEntity] operator[?] identifier[params] operator[SEP] identifier[getProperty] operator[SEP] identifier[PersistentIdentifierGenerator] operator[SEP] identifier[TABLE] operator[SEP] operator[:] identifier[DEF_SEGMENT_VALUE] operator[SEP] identifier[log] operator[SEP] identifier[infof] operator[SEP] literal[String] , identifier[tableName] , identifier[segmentColumnName] , identifier[defaultToUse] operator[SEP] operator[SEP] Keyword[return] identifier[defaultToUse] operator[SEP]
}
|
protected void print(final Level level, final String message, final Throwable throwable) {
if (!isEnabled(level)) {
return;
}
StringBuilder msg = new StringBuilder()
.append(slf.getElapsedTime()).append(' ').append('[')
.append(level).append(']').append(' ')
.append(getCallerClass()).append(' ').append('-')
.append(' ').append(message);
System.out.println(msg.toString());
if (throwable != null) {
throwable.printStackTrace(System.out);
}
} | class class_name[name] begin[{]
method[print, return_type[void], modifier[protected], parameter[level, message, throwable]] begin[{]
if[call[.isEnabled, parameter[member[.level]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], msg]
call[System.out.println, parameter[call[msg.toString, parameter[]]]]
if[binary_operation[member[.throwable], !=, literal[null]]] begin[{]
call[throwable.printStackTrace, parameter[member[System.out]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[print] operator[SEP] Keyword[final] identifier[Level] identifier[level] , Keyword[final] identifier[String] identifier[message] , Keyword[final] identifier[Throwable] identifier[throwable] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isEnabled] operator[SEP] identifier[level] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[StringBuilder] identifier[msg] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[slf] operator[SEP] identifier[getElapsedTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[level] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getCallerClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[throwable] operator[!=] Other[null] operator[SEP] {
identifier[throwable] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] operator[SEP]
}
}
|
public static boolean fixPSQ(Document doc) {
Element datasources = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "data-sources", false, true);
if (datasources != null && datasources.hasAttribute("preserve-single-quote")) {
Boolean b = Caster.toBoolean(datasources.getAttribute("preserve-single-quote"), null);
if (b != null) datasources.setAttribute("psq", Caster.toString(!b.booleanValue()));
datasources.removeAttribute("preserve-single-quote");
return true;
}
return false;
} | class class_name[name] begin[{]
method[fixPSQ, return_type[type[boolean]], modifier[public static], parameter[doc]] begin[{]
local_variable[type[Element], datasources]
if[binary_operation[binary_operation[member[.datasources], !=, literal[null]], &&, call[datasources.hasAttribute, parameter[literal["preserve-single-quote"]]]]] begin[{]
local_variable[type[Boolean], b]
if[binary_operation[member[.b], !=, literal[null]]] begin[{]
call[datasources.setAttribute, parameter[literal["psq"], call[Caster.toString, parameter[call[b.booleanValue, parameter[]]]]]]
else begin[{]
None
end[}]
call[datasources.removeAttribute, parameter[literal["preserve-single-quote"]]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[fixPSQ] operator[SEP] identifier[Document] identifier[doc] operator[SEP] {
identifier[Element] identifier[datasources] operator[=] identifier[XMLConfigWebFactory] operator[SEP] identifier[getChildByName] operator[SEP] identifier[doc] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] , literal[String] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[datasources] operator[!=] Other[null] operator[&&] identifier[datasources] operator[SEP] identifier[hasAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[Boolean] identifier[b] operator[=] identifier[Caster] operator[SEP] identifier[toBoolean] operator[SEP] identifier[datasources] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[SEP] identifier[datasources] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[Caster] operator[SEP] identifier[toString] operator[SEP] operator[!] identifier[b] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[datasources] operator[SEP] identifier[removeAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
void appendAttribute(int namespaceIndex, int localNameIndex, int prefixIndex,
boolean isID,
int m_char_current_start, int contentLength)
{
// %TBD% isID is not currently honored.
// W0 High: Namespace Low: Node Type
int w0 = ATTRIBUTE_NODE | namespaceIndex<<16;
// W1: Parent
int w1 = currentParent;
// W2: Next (not yet resolved)
int w2 = 0;
// W3: Tagname high: prefix Low: local name
int w3 = localNameIndex | prefixIndex<<16;
/**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff));
// Add node
int ourslot = appendNode(w0, w1, w2, w3);
previousSibling = ourslot; // Should attributes be previous siblings
// Attribute's content is currently appended as a Text Node
// W0: Node Type
w0 = TEXT_NODE;
// W1: Parent
w1 = ourslot;
// W2: Start Position within buffer
w2 = m_char_current_start;
// W3: Length
w3 = contentLength;
appendNode(w0, w1, w2, w3);
// Attrs are Parents
previousSiblingWasParent = true;
return ;//(m_docHandle | ourslot);
} | class class_name[name] begin[{]
method[appendAttribute, return_type[void], modifier[default], parameter[namespaceIndex, localNameIndex, prefixIndex, isID, m_char_current_start, contentLength]] begin[{]
local_variable[type[int], w0]
local_variable[type[int], w1]
local_variable[type[int], w2]
local_variable[type[int], w3]
call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["set w3="], +, member[.w3]], +, literal[" "]], +, binary_operation[member[.w3], >>, literal[16]]], +, literal["/"]], +, binary_operation[member[.w3], &, literal[0xffff]]]]]
local_variable[type[int], ourslot]
assign[member[.previousSibling], member[.ourslot]]
assign[member[.w0], member[.TEXT_NODE]]
assign[member[.w1], member[.ourslot]]
assign[member[.w2], member[.m_char_current_start]]
assign[member[.w3], member[.contentLength]]
call[.appendNode, parameter[member[.w0], member[.w1], member[.w2], member[.w3]]]
assign[member[.previousSiblingWasParent], literal[true]]
return[None]
end[}]
END[}] | Keyword[void] identifier[appendAttribute] operator[SEP] Keyword[int] identifier[namespaceIndex] , Keyword[int] identifier[localNameIndex] , Keyword[int] identifier[prefixIndex] , Keyword[boolean] identifier[isID] , Keyword[int] identifier[m_char_current_start] , Keyword[int] identifier[contentLength] operator[SEP] {
Keyword[int] identifier[w0] operator[=] identifier[ATTRIBUTE_NODE] operator[|] identifier[namespaceIndex] operator[<<] Other[16] operator[SEP] Keyword[int] identifier[w1] operator[=] identifier[currentParent] operator[SEP] Keyword[int] identifier[w2] operator[=] Other[0] operator[SEP] Keyword[int] identifier[w3] operator[=] identifier[localNameIndex] operator[|] identifier[prefixIndex] operator[<<] Other[16] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[w3] operator[+] literal[String] operator[+] operator[SEP] identifier[w3] operator[>] operator[>] Other[16] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[w3] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ourslot] operator[=] identifier[appendNode] operator[SEP] identifier[w0] , identifier[w1] , identifier[w2] , identifier[w3] operator[SEP] operator[SEP] identifier[previousSibling] operator[=] identifier[ourslot] operator[SEP] identifier[w0] operator[=] identifier[TEXT_NODE] operator[SEP] identifier[w1] operator[=] identifier[ourslot] operator[SEP] identifier[w2] operator[=] identifier[m_char_current_start] operator[SEP] identifier[w3] operator[=] identifier[contentLength] operator[SEP] identifier[appendNode] operator[SEP] identifier[w0] , identifier[w1] , identifier[w2] , identifier[w3] operator[SEP] operator[SEP] identifier[previousSiblingWasParent] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP]
}
|
public static File getClasspathFile(String filename, ClassLoader classLoader) {
if(filename == null) {
throw LOG.nullParameter("filename");
}
URL fileUrl = null;
if (classLoader != null) {
fileUrl = classLoader.getResource(filename);
}
if (fileUrl == null) {
// Try the current Thread context classloader
classLoader = Thread.currentThread().getContextClassLoader();
fileUrl = classLoader.getResource(filename);
if (fileUrl == null) {
// Finally, try the classloader for this class
classLoader = IoUtil.class.getClassLoader();
fileUrl = classLoader.getResource(filename);
}
}
if(fileUrl == null) {
throw LOG.fileNotFoundException(filename);
}
try {
return new File(fileUrl.toURI());
} catch(URISyntaxException e) {
throw LOG.fileNotFoundException(filename, e);
}
} | class class_name[name] begin[{]
method[getClasspathFile, return_type[type[File]], modifier[public static], parameter[filename, classLoader]] begin[{]
if[binary_operation[member[.filename], ==, literal[null]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="filename")], member=nullParameter, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
local_variable[type[URL], fileUrl]
if[binary_operation[member[.classLoader], !=, literal[null]]] begin[{]
assign[member[.fileUrl], call[classLoader.getResource, parameter[member[.filename]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.fileUrl], ==, literal[null]]] begin[{]
assign[member[.classLoader], call[Thread.currentThread, parameter[]]]
assign[member[.fileUrl], call[classLoader.getResource, parameter[member[.filename]]]]
if[binary_operation[member[.fileUrl], ==, literal[null]]] begin[{]
assign[member[.classLoader], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IoUtil, sub_type=None))]
assign[member[.fileUrl], call[classLoader.getResource, parameter[member[.filename]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.fileUrl], ==, literal[null]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fileNotFoundException, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=fileUrl, 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)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fileNotFoundException, postfix_operators=[], prefix_operators=[], qualifier=LOG, 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[}] | Keyword[public] Keyword[static] identifier[File] identifier[getClasspathFile] operator[SEP] identifier[String] identifier[filename] , identifier[ClassLoader] identifier[classLoader] operator[SEP] {
Keyword[if] operator[SEP] identifier[filename] operator[==] Other[null] operator[SEP] {
Keyword[throw] identifier[LOG] operator[SEP] identifier[nullParameter] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[URL] identifier[fileUrl] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[classLoader] operator[!=] Other[null] operator[SEP] {
identifier[fileUrl] operator[=] identifier[classLoader] operator[SEP] identifier[getResource] operator[SEP] identifier[filename] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[fileUrl] operator[==] Other[null] operator[SEP] {
identifier[classLoader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[fileUrl] operator[=] identifier[classLoader] operator[SEP] identifier[getResource] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileUrl] operator[==] Other[null] operator[SEP] {
identifier[classLoader] operator[=] identifier[IoUtil] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[fileUrl] operator[=] identifier[classLoader] operator[SEP] identifier[getResource] operator[SEP] identifier[filename] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[fileUrl] operator[==] Other[null] operator[SEP] {
Keyword[throw] identifier[LOG] operator[SEP] identifier[fileNotFoundException] operator[SEP] identifier[filename] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[return] Keyword[new] identifier[File] operator[SEP] identifier[fileUrl] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] {
Keyword[throw] identifier[LOG] operator[SEP] identifier[fileNotFoundException] operator[SEP] identifier[filename] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public void sendRedirect(int statusCode, String url) throws IOException {
getWrapped().sendRedirect(statusCode, url);
} | class class_name[name] begin[{]
method[sendRedirect, return_type[void], modifier[public], parameter[statusCode, url]] begin[{]
call[.getWrapped, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[sendRedirect] operator[SEP] Keyword[int] identifier[statusCode] , identifier[String] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[getWrapped] operator[SEP] operator[SEP] operator[SEP] identifier[sendRedirect] operator[SEP] identifier[statusCode] , identifier[url] operator[SEP] operator[SEP]
}
|
int decode( byte[] buffer, int bufferIndex ) {
int start = headerStart = bufferIndex;
bufferIndex += readHeaderWireFormat( buffer, bufferIndex );
bufferIndex += readAndXWireFormat( buffer, bufferIndex );
length = bufferIndex - start;
return length;
} | class class_name[name] begin[{]
method[decode, return_type[type[int]], modifier[default], parameter[buffer, bufferIndex]] begin[{]
local_variable[type[int], start]
assign[member[.bufferIndex], call[.readHeaderWireFormat, parameter[member[.buffer], member[.bufferIndex]]]]
assign[member[.bufferIndex], call[.readAndXWireFormat, parameter[member[.buffer], member[.bufferIndex]]]]
assign[member[.length], binary_operation[member[.bufferIndex], -, member[.start]]]
return[member[.length]]
end[}]
END[}] | Keyword[int] identifier[decode] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] , Keyword[int] identifier[bufferIndex] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[headerStart] operator[=] identifier[bufferIndex] operator[SEP] identifier[bufferIndex] operator[+=] identifier[readHeaderWireFormat] operator[SEP] identifier[buffer] , identifier[bufferIndex] operator[SEP] operator[SEP] identifier[bufferIndex] operator[+=] identifier[readAndXWireFormat] operator[SEP] identifier[buffer] , identifier[bufferIndex] operator[SEP] operator[SEP] identifier[length] operator[=] identifier[bufferIndex] operator[-] identifier[start] operator[SEP] Keyword[return] identifier[length] operator[SEP]
}
|
public static <T> OptionalKind<T> narrow(final Higher<optional, T> future) {
return (OptionalKind<T>)future;
} | class class_name[name] begin[{]
method[narrow, return_type[type[OptionalKind]], modifier[public static], parameter[future]] begin[{]
return[Cast(expression=MemberReference(member=future, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=OptionalKind, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[OptionalKind] operator[<] identifier[T] operator[>] identifier[narrow] operator[SEP] Keyword[final] identifier[Higher] operator[<] identifier[optional] , identifier[T] operator[>] identifier[future] operator[SEP] {
Keyword[return] operator[SEP] identifier[OptionalKind] operator[<] identifier[T] operator[>] operator[SEP] identifier[future] operator[SEP]
}
|
public List<Entity> pageForEntityList(Entity where, Page page) throws SQLException {
return page(where, page, EntityListHandler.create());
} | class class_name[name] begin[{]
method[pageForEntityList, return_type[type[List]], modifier[public], parameter[where, page]] begin[{]
return[call[.page, parameter[member[.where], member[.page], call[EntityListHandler.create, parameter[]]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[Entity] operator[>] identifier[pageForEntityList] operator[SEP] identifier[Entity] identifier[where] , identifier[Page] identifier[page] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[return] identifier[page] operator[SEP] identifier[where] , identifier[page] , identifier[EntityListHandler] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) {
getButtonPainter(c).doPaint(g, c, width, height, extendedCacheKeys);
} | class class_name[name] begin[{]
method[doPaint, return_type[void], modifier[protected], parameter[g, c, width, height, extendedCacheKeys]] begin[{]
call[.getButtonPainter, parameter[member[.c]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[doPaint] operator[SEP] identifier[Graphics2D] identifier[g] , identifier[JComponent] identifier[c] , Keyword[int] identifier[width] , Keyword[int] identifier[height] , identifier[Object] operator[SEP] operator[SEP] identifier[extendedCacheKeys] operator[SEP] {
identifier[getButtonPainter] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[doPaint] operator[SEP] identifier[g] , identifier[c] , identifier[width] , identifier[height] , identifier[extendedCacheKeys] operator[SEP] operator[SEP]
}
|
public static Type resolveRawGeneric(final TypeVariable variable,
final LinkedHashMap<String, Type> generics) {
final Type res;
if (variable.getBounds().length > 1) {
// case: T extends A & B --> ? extends A & B
final List<Type> types = new ArrayList<Type>();
for (Type bound : variable.getBounds()) {
// replace possible named generics with actual type (for cases like K extends T)
final Type actual = GenericsUtils.resolveTypeVariables(bound, generics);
if (actual instanceof WildcardType && ((WildcardType) actual).getUpperBounds().length > 0) {
// case: T extends A & B, K extends T & C --> K must be aggregated as ? extends A & B & C
// this case is impossible in java, but allowed in groovy
types.addAll(Arrays.asList(GenericsUtils
.resolveTypeVariables(((WildcardType) actual).getUpperBounds(), generics)));
} else {
types.add(actual);
}
}
// case: T extends Object & Something (may appear because of transitive generics resolution)
// only one object could appear (because wildcard could only be
// ? extends type (or generic) & exact interface (& exact interface))
// (repackaged from type declaration)
types.remove(Object.class);
if (types.size() > 1) {
// repackaging as impossible wildcard <? extends A & B> to store all known information
res = WildcardTypeImpl.upper(types.toArray(new Type[0]));
} else {
// if one type remain - use it directly; if no types remain - use Object
res = types.isEmpty() ? Object.class : types.get(0);
}
} else {
// case: simple generic declaration <T> (implicitly extends Object)
res = GenericsUtils.resolveTypeVariables(variable.getBounds()[0], generics);
}
return res;
} | class class_name[name] begin[{]
method[resolveRawGeneric, return_type[type[Type]], modifier[public static], parameter[variable, generics]] begin[{]
local_variable[type[Type], res]
if[binary_operation[call[variable.getBounds, parameter[]], >, literal[1]]] begin[{]
local_variable[type[List], types]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=generics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveTypeVariables, postfix_operators=[], prefix_operators=[], qualifier=GenericsUtils, selectors=[], type_arguments=None), name=actual)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=WildcardType, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=Cast(expression=MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WildcardType, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WildcardType, sub_type=None)), MemberReference(member=generics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveTypeVariables, postfix_operators=[], prefix_operators=[], qualifier=GenericsUtils, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getBounds, postfix_operators=[], prefix_operators=[], qualifier=variable, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bound)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
call[types.remove, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
if[binary_operation[call[types.size, parameter[]], >, literal[1]]] begin[{]
assign[member[.res], call[WildcardTypeImpl.upper, parameter[call[types.toArray, parameter[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=Type, sub_type=None))]]]]]
else begin[{]
assign[member[.res], TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None), if_true=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)))]
end[}]
else begin[{]
assign[member[.res], call[GenericsUtils.resolveTypeVariables, parameter[call[variable.getBounds, parameter[]], member[.generics]]]]
end[}]
return[member[.res]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Type] identifier[resolveRawGeneric] operator[SEP] Keyword[final] identifier[TypeVariable] identifier[variable] , Keyword[final] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[Type] operator[>] identifier[generics] operator[SEP] {
Keyword[final] identifier[Type] identifier[res] operator[SEP] Keyword[if] operator[SEP] identifier[variable] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[Type] operator[>] identifier[types] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Type] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Type] identifier[bound] operator[:] identifier[variable] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[Type] identifier[actual] operator[=] identifier[GenericsUtils] operator[SEP] identifier[resolveTypeVariables] operator[SEP] identifier[bound] , identifier[generics] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actual] Keyword[instanceof] identifier[WildcardType] operator[&&] operator[SEP] operator[SEP] identifier[WildcardType] operator[SEP] identifier[actual] operator[SEP] operator[SEP] identifier[getUpperBounds] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[types] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[GenericsUtils] operator[SEP] identifier[resolveTypeVariables] operator[SEP] operator[SEP] operator[SEP] identifier[WildcardType] operator[SEP] identifier[actual] operator[SEP] operator[SEP] identifier[getUpperBounds] operator[SEP] operator[SEP] , identifier[generics] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[types] operator[SEP] identifier[add] operator[SEP] identifier[actual] operator[SEP] operator[SEP]
}
}
identifier[types] operator[SEP] identifier[remove] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[types] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[res] operator[=] identifier[WildcardTypeImpl] operator[SEP] identifier[upper] operator[SEP] identifier[types] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Type] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[res] operator[=] identifier[types] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] identifier[Object] operator[SEP] Keyword[class] operator[:] identifier[types] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[res] operator[=] identifier[GenericsUtils] operator[SEP] identifier[resolveTypeVariables] operator[SEP] identifier[variable] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] , identifier[generics] operator[SEP] operator[SEP]
}
Keyword[return] identifier[res] operator[SEP]
}
|
public Range intersectionWithTouch(Range other) {
if (!intersectsWithOrTouches(other))
return null;
return new Range(Math.max(lower, other.lower), Math.min(upper, other.upper), reversed && other.reversed);
} | class class_name[name] begin[{]
method[intersectionWithTouch, return_type[type[Range]], modifier[public], parameter[other]] begin[{]
if[call[.intersectsWithOrTouches, parameter[member[.other]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=lower, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lower, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[])], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=upper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=upper, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=reversed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=reversed, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=&&)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Range, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Range] identifier[intersectionWithTouch] operator[SEP] identifier[Range] identifier[other] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[intersectsWithOrTouches] operator[SEP] identifier[other] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[Range] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[lower] , identifier[other] operator[SEP] identifier[lower] operator[SEP] , identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[upper] , identifier[other] operator[SEP] identifier[upper] operator[SEP] , identifier[reversed] operator[&&] identifier[other] operator[SEP] identifier[reversed] operator[SEP] operator[SEP]
}
|
public static ImmutableList<JClassType> filterSubtypesForSerialization( TreeLogger logger, RebindConfiguration configuration,
JClassType type ) {
boolean filterOnlySupportedType = isObjectOrSerializable( type );
ImmutableList.Builder<JClassType> builder = ImmutableList.builder();
if ( type.getSubtypes().length > 0 ) {
for ( JClassType subtype : type.getSubtypes() ) {
if ( null == subtype.isAnnotation()
&& subtype.isPublic()
&& (!filterOnlySupportedType || configuration.isTypeSupportedForSerialization( logger, subtype ))
&& !findFirstEncounteredAnnotationsOnAllHierarchy( configuration, subtype.isClassOrInterface(), JsonIgnoreType.class, Optional.of( type ) ).isPresent()) {
builder.add( subtype );
}
}
}
return builder.build();
} | class class_name[name] begin[{]
method[filterSubtypesForSerialization, return_type[type[ImmutableList]], modifier[public static], parameter[logger, configuration, type]] begin[{]
local_variable[type[boolean], filterOnlySupportedType]
local_variable[type[ImmutableList], builder]
if[binary_operation[call[type.getSubtypes, parameter[]], >, literal[0]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=isAnnotation, postfix_operators=[], prefix_operators=[], qualifier=subtype, selectors=[], type_arguments=None), operator===), operandr=MethodInvocation(arguments=[], member=isPublic, postfix_operators=[], prefix_operators=[], qualifier=subtype, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=filterOnlySupportedType, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subtype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTypeSupportedForSerialization, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), operator=||), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=isClassOrInterface, postfix_operators=[], prefix_operators=[], qualifier=subtype, selectors=[], type_arguments=None), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonIgnoreType, sub_type=None)), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None)], member=findFirstEncounteredAnnotationsOnAllHierarchy, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[MethodInvocation(arguments=[], member=isPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subtype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSubtypes, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subtype)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JClassType, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[call[builder.build, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ImmutableList] operator[<] identifier[JClassType] operator[>] identifier[filterSubtypesForSerialization] operator[SEP] identifier[TreeLogger] identifier[logger] , identifier[RebindConfiguration] identifier[configuration] , identifier[JClassType] identifier[type] operator[SEP] {
Keyword[boolean] identifier[filterOnlySupportedType] operator[=] identifier[isObjectOrSerializable] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[JClassType] operator[>] identifier[builder] operator[=] identifier[ImmutableList] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[getSubtypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] identifier[JClassType] identifier[subtype] operator[:] identifier[type] operator[SEP] identifier[getSubtypes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[subtype] operator[SEP] identifier[isAnnotation] operator[SEP] operator[SEP] operator[&&] identifier[subtype] operator[SEP] identifier[isPublic] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[filterOnlySupportedType] operator[||] identifier[configuration] operator[SEP] identifier[isTypeSupportedForSerialization] operator[SEP] identifier[logger] , identifier[subtype] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[findFirstEncounteredAnnotationsOnAllHierarchy] operator[SEP] identifier[configuration] , identifier[subtype] operator[SEP] identifier[isClassOrInterface] operator[SEP] operator[SEP] , identifier[JsonIgnoreType] operator[SEP] Keyword[class] , identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[builder] operator[SEP] identifier[add] operator[SEP] identifier[subtype] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean accept(XVisitor visitor) {
/*
* Check whether the visitor may run.
*/
if (visitor.precondition()) {
/*
* Yes, it may. Now initialize.
*/
visitor.init(this);
/*
* First call.
*/
visitor.visitLogPre(this);
/*
* Visit the extensions.
*/
for (XExtension extension: extensions) {
extension.accept(visitor, this);
}
/*
* Visit the classifiers.
*/
for (XEventClassifier classifier: classifiers) {
classifier.accept(visitor, this);
}
/*
* Visit the attributes.
*/
for (XAttribute attribute: attributes.values()) {
attribute.accept(visitor, this);
}
/*
* Visit the traces.
*/
for (XTrace trace: this) {
trace.accept(visitor, this);
}
/*
* Last call.
*/
visitor.visitLogPost(this);
return true;
}
return false;
} | class class_name[name] begin[{]
method[accept, return_type[type[boolean]], modifier[public], parameter[visitor]] begin[{]
if[call[visitor.precondition, parameter[]]] begin[{]
call[visitor.init, parameter[THIS[]]]
call[visitor.visitLogPre, parameter[THIS[]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=extension, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=extensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=extension)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XExtension, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=classifier, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=classifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classifier)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XEventClassifier, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XAttribute, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=trace, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=trace)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XTrace, sub_type=None))), label=None)
call[visitor.visitLogPost, parameter[THIS[]]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[XVisitor] identifier[visitor] operator[SEP] {
Keyword[if] operator[SEP] identifier[visitor] operator[SEP] identifier[precondition] operator[SEP] operator[SEP] operator[SEP] {
identifier[visitor] operator[SEP] identifier[init] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[visitor] operator[SEP] identifier[visitLogPre] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[XExtension] identifier[extension] operator[:] identifier[extensions] operator[SEP] {
identifier[extension] operator[SEP] identifier[accept] operator[SEP] identifier[visitor] , Keyword[this] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[XEventClassifier] identifier[classifier] operator[:] identifier[classifiers] operator[SEP] {
identifier[classifier] operator[SEP] identifier[accept] operator[SEP] identifier[visitor] , Keyword[this] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[XAttribute] identifier[attribute] operator[:] identifier[attributes] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[attribute] operator[SEP] identifier[accept] operator[SEP] identifier[visitor] , Keyword[this] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[XTrace] identifier[trace] operator[:] Keyword[this] operator[SEP] {
identifier[trace] operator[SEP] identifier[accept] operator[SEP] identifier[visitor] , Keyword[this] operator[SEP] operator[SEP]
}
identifier[visitor] operator[SEP] identifier[visitLogPost] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void addControlDependency(SDVariable controlDependency){
String cdN = controlDependency.getVarName();
String n = this.getVarName();
Variable v = sameDiff.getVariables().get(n);
if(v.getControlDeps() == null)
v.setControlDeps(new ArrayList<String>());
if(!v.getControlDeps().contains(cdN))
v.getControlDeps().add(cdN);
Variable v2 = sameDiff.getVariables().get(cdN);
if(v2.getControlDepsForVar() == null)
v2.setControlDepsForVar(new ArrayList<String>());
if(!v2.getControlDepsForVar().contains(n))
v2.getControlDepsForVar().add(n);
} | class class_name[name] begin[{]
method[addControlDependency, return_type[void], modifier[public], parameter[controlDependency]] begin[{]
local_variable[type[String], cdN]
local_variable[type[String], n]
local_variable[type[Variable], v]
if[binary_operation[call[v.getControlDeps, parameter[]], ==, literal[null]]] begin[{]
call[v.setControlDeps, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]]
else begin[{]
None
end[}]
if[call[v.getControlDeps, parameter[]]] begin[{]
call[v.getControlDeps, parameter[]]
else begin[{]
None
end[}]
local_variable[type[Variable], v2]
if[binary_operation[call[v2.getControlDepsForVar, parameter[]], ==, literal[null]]] begin[{]
call[v2.setControlDepsForVar, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]]
else begin[{]
None
end[}]
if[call[v2.getControlDepsForVar, parameter[]]] begin[{]
call[v2.getControlDepsForVar, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addControlDependency] operator[SEP] identifier[SDVariable] identifier[controlDependency] operator[SEP] {
identifier[String] identifier[cdN] operator[=] identifier[controlDependency] operator[SEP] identifier[getVarName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[n] operator[=] Keyword[this] operator[SEP] identifier[getVarName] operator[SEP] operator[SEP] operator[SEP] identifier[Variable] identifier[v] operator[=] identifier[sameDiff] operator[SEP] identifier[getVariables] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[SEP] identifier[getControlDeps] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[v] operator[SEP] identifier[setControlDeps] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[v] operator[SEP] identifier[getControlDeps] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[cdN] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[getControlDeps] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[cdN] operator[SEP] operator[SEP] identifier[Variable] identifier[v2] operator[=] identifier[sameDiff] operator[SEP] identifier[getVariables] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[cdN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v2] operator[SEP] identifier[getControlDepsForVar] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[v2] operator[SEP] identifier[setControlDepsForVar] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[v2] operator[SEP] identifier[getControlDepsForVar] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[n] operator[SEP] operator[SEP] identifier[v2] operator[SEP] identifier[getControlDepsForVar] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[n] operator[SEP] operator[SEP]
}
|
public static Print print(final String... _oid)
{
return (Print) org.efaps.eql2.EQL2.print(_oid);
} | class class_name[name] begin[{]
method[print, return_type[type[Print]], modifier[public static], parameter[_oid]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=_oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=org.efaps.eql2.EQL2, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Print, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Print] identifier[print] operator[SEP] Keyword[final] identifier[String] operator[...] identifier[_oid] operator[SEP] {
Keyword[return] operator[SEP] identifier[Print] operator[SEP] identifier[org] operator[SEP] identifier[efaps] operator[SEP] identifier[eql2] operator[SEP] identifier[EQL2] operator[SEP] identifier[print] operator[SEP] identifier[_oid] operator[SEP] operator[SEP]
}
|
@GET
@Path("/typedefs/headers")
@Produces(Servlets.JSON_MEDIA_TYPE)
public List<AtlasTypeDefHeader> getTypeDefHeaders(@Context HttpServletRequest httpServletRequest) throws AtlasBaseException {
SearchFilter searchFilter = getSearchFilter(httpServletRequest);
AtlasTypesDef searchTypesDef = typeDefStore.searchTypesDef(searchFilter);
return AtlasTypeUtil.toTypeDefHeader(searchTypesDef);
} | class class_name[name] begin[{]
method[getTypeDefHeaders, return_type[type[List]], modifier[public], parameter[httpServletRequest]] begin[{]
local_variable[type[SearchFilter], searchFilter]
local_variable[type[AtlasTypesDef], searchTypesDef]
return[call[AtlasTypeUtil.toTypeDefHeader, parameter[member[.searchTypesDef]]]]
end[}]
END[}] | annotation[@] identifier[GET] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Produces] operator[SEP] identifier[Servlets] operator[SEP] identifier[JSON_MEDIA_TYPE] operator[SEP] Keyword[public] identifier[List] operator[<] identifier[AtlasTypeDefHeader] operator[>] identifier[getTypeDefHeaders] operator[SEP] annotation[@] identifier[Context] identifier[HttpServletRequest] identifier[httpServletRequest] operator[SEP] Keyword[throws] identifier[AtlasBaseException] {
identifier[SearchFilter] identifier[searchFilter] operator[=] identifier[getSearchFilter] operator[SEP] identifier[httpServletRequest] operator[SEP] operator[SEP] identifier[AtlasTypesDef] identifier[searchTypesDef] operator[=] identifier[typeDefStore] operator[SEP] identifier[searchTypesDef] operator[SEP] identifier[searchFilter] operator[SEP] operator[SEP] Keyword[return] identifier[AtlasTypeUtil] operator[SEP] identifier[toTypeDefHeader] operator[SEP] identifier[searchTypesDef] operator[SEP] operator[SEP]
}
|
@BetaApi
public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck) {
GetHttpsHealthCheckHttpRequest request =
GetHttpsHealthCheckHttpRequest.newBuilder().setHttpsHealthCheck(httpsHealthCheck).build();
return getHttpsHealthCheck(request);
} | class class_name[name] begin[{]
method[getHttpsHealthCheck, return_type[type[HttpsHealthCheck2]], modifier[final public], parameter[httpsHealthCheck]] begin[{]
local_variable[type[GetHttpsHealthCheckHttpRequest], request]
return[call[.getHttpsHealthCheck, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[HttpsHealthCheck2] identifier[getHttpsHealthCheck] operator[SEP] identifier[String] identifier[httpsHealthCheck] operator[SEP] {
identifier[GetHttpsHealthCheckHttpRequest] identifier[request] operator[=] identifier[GetHttpsHealthCheckHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setHttpsHealthCheck] operator[SEP] identifier[httpsHealthCheck] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getHttpsHealthCheck] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void setSubjects(Set<String> subjects) {
Validate.notNull(subjects);
if (subjects.isEmpty()) {
return;
}
Validate.noNullElements(subjects);
setProperty(SOABaseProperty.SUBJECTS, ArrayUtils.toString(encapsulateValues(subjects)));
} | class class_name[name] begin[{]
method[setSubjects, return_type[void], modifier[public], parameter[subjects]] begin[{]
call[Validate.notNull, parameter[member[.subjects]]]
if[call[subjects.isEmpty, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[Validate.noNullElements, parameter[member[.subjects]]]
call[.setProperty, parameter[member[SOABaseProperty.SUBJECTS], call[ArrayUtils.toString, parameter[call[.encapsulateValues, parameter[member[.subjects]]]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSubjects] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[subjects] operator[SEP] {
identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[subjects] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[subjects] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[Validate] operator[SEP] identifier[noNullElements] operator[SEP] identifier[subjects] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[SOABaseProperty] operator[SEP] identifier[SUBJECTS] , identifier[ArrayUtils] operator[SEP] identifier[toString] operator[SEP] identifier[encapsulateValues] operator[SEP] identifier[subjects] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public ArrayList<String> getDiscreteRowValues(String row) throws Exception {
HashMap<String, String> hashMapValues = new HashMap<String, String>();
ArrayList<String> values = new ArrayList<String>();
for (String column : getColumns()) {
String value = getCell(row, column);
if (!hashMapValues.containsKey(value)) {
hashMapValues.put(value, value);
values.add(value);
}
}
return values;
} | class class_name[name] begin[{]
method[getDiscreteRowValues, return_type[type[ArrayList]], modifier[public], parameter[row]] begin[{]
local_variable[type[HashMap], hashMapValues]
local_variable[type[ArrayList], values]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=hashMapValues, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=hashMapValues, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.values]]
end[}]
END[}] | Keyword[public] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[getDiscreteRowValues] operator[SEP] identifier[String] identifier[row] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[hashMapValues] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[values] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[column] operator[:] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[getCell] operator[SEP] identifier[row] , identifier[column] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hashMapValues] operator[SEP] identifier[containsKey] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[hashMapValues] operator[SEP] identifier[put] operator[SEP] identifier[value] , identifier[value] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[values] operator[SEP]
}
|
protected void resetNextIndex(RaftMemberContext member, AppendResponse response) {
long nextIndex = response.lastLogIndex() + 1;
if (member.getLogReader().getNextIndex() != nextIndex) {
member.getLogReader().reset(nextIndex);
log.trace("Reset next index for {} to {}", member, nextIndex);
}
} | class class_name[name] begin[{]
method[resetNextIndex, return_type[void], modifier[protected], parameter[member, response]] begin[{]
local_variable[type[long], nextIndex]
if[binary_operation[call[member.getLogReader, parameter[]], !=, member[.nextIndex]]] begin[{]
call[member.getLogReader, parameter[]]
call[log.trace, parameter[literal["Reset next index for {} to {}"], member[.member], member[.nextIndex]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[resetNextIndex] operator[SEP] identifier[RaftMemberContext] identifier[member] , identifier[AppendResponse] identifier[response] operator[SEP] {
Keyword[long] identifier[nextIndex] operator[=] identifier[response] operator[SEP] identifier[lastLogIndex] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[member] operator[SEP] identifier[getLogReader] operator[SEP] operator[SEP] operator[SEP] identifier[getNextIndex] operator[SEP] operator[SEP] operator[!=] identifier[nextIndex] operator[SEP] {
identifier[member] operator[SEP] identifier[getLogReader] operator[SEP] operator[SEP] operator[SEP] identifier[reset] operator[SEP] identifier[nextIndex] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[member] , identifier[nextIndex] operator[SEP] operator[SEP]
}
}
|
public void readLocked (@Nonnull final Runnable aRunnable)
{
readLock ().lock ();
try
{
aRunnable.run ();
}
finally
{
readLock ().unlock ();
}
} | class class_name[name] begin[{]
method[readLocked, return_type[void], modifier[public], parameter[aRunnable]] begin[{]
call[.readLock, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=aRunnable, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[readLocked] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Runnable] identifier[aRunnable] operator[SEP] {
identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[aRunnable] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static String upperWord(CharSequence cs, char c) {
StringBuilder sb = new StringBuilder();
int len = cs.length();
for (int i = 0; i < len; i++) {
char ch = cs.charAt(i);
if (ch == c) {
do {
i++;
if (i >= len)
return sb.toString();
ch = cs.charAt(i);
} while (ch == c);
sb.append(Character.toUpperCase(ch));
} else {
sb.append(ch);
}
}
return sb.toString();
} | class class_name[name] begin[{]
method[upperWord, return_type[type[String]], modifier[public static], parameter[cs, c]] begin[{]
local_variable[type[StringBuilder], sb]
local_variable[type[int], len]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None), name=ch)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[DoStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[upperWord] operator[SEP] identifier[CharSequence] identifier[cs] , Keyword[char] identifier[c] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[cs] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[ch] operator[=] identifier[cs] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[==] identifier[c] operator[SEP] {
Keyword[do] {
identifier[i] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[>=] identifier[len] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[ch] operator[=] identifier[cs] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[ch] operator[==] identifier[c] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[ch] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void printClusterCenter(Writer stream) throws IOException {
stream.write(String.valueOf(this.numPoints));
for (int j = 0; j < this.sumPoints.length; j++) {
stream.write(' ');
stream.write(String.valueOf(this.sumPoints[j] / this.numPoints));
}
stream.write(System.getProperty("line.separator"));
} | class class_name[name] begin[{]
method[printClusterCenter, return_type[void], modifier[public], parameter[stream]] begin[{]
call[stream.write, parameter[call[String.valueOf, parameter[THIS[member[None.numPoints]]]]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=write, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sumPoints, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numPoints, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=/)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sumPoints, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[stream.write, parameter[call[System.getProperty, parameter[literal["line.separator"]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[printClusterCenter] operator[SEP] identifier[Writer] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[numPoints] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] Keyword[this] operator[SEP] identifier[sumPoints] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[stream] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[sumPoints] operator[SEP] identifier[j] operator[SEP] operator[/] Keyword[this] operator[SEP] identifier[numPoints] operator[SEP] operator[SEP] operator[SEP]
}
identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
|
public EClass getGSFLW() {
if (gsflwEClass == null) {
gsflwEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(475);
}
return gsflwEClass;
} | class class_name[name] begin[{]
method[getGSFLW, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.gsflwEClass], ==, literal[null]]] begin[{]
assign[member[.gsflwEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, 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=475)], 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[.gsflwEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getGSFLW] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[gsflwEClass] operator[==] Other[null] operator[SEP] {
identifier[gsflwEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[AfplibPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[475] operator[SEP] operator[SEP]
}
Keyword[return] identifier[gsflwEClass] operator[SEP]
}
|
public LiveReload register(final Path path, final String... includes) {
if (Files.exists(path)) {
paths.add(new Object[]{path, Arrays.asList(includes)});
}
return this;
} | class class_name[name] begin[{]
method[register, return_type[type[LiveReload]], modifier[public], parameter[path, includes]] begin[{]
if[call[Files.exists, parameter[member[.path]]]] begin[{]
call[paths.add, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=includes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[LiveReload] identifier[register] operator[SEP] Keyword[final] identifier[Path] identifier[path] , Keyword[final] identifier[String] operator[...] identifier[includes] operator[SEP] {
Keyword[if] operator[SEP] identifier[Files] operator[SEP] identifier[exists] operator[SEP] identifier[path] operator[SEP] operator[SEP] {
identifier[paths] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[path] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[includes] operator[SEP]
} operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public TreeBuilder<T> convert(ContentConverter<T> converter, PathSelector selector) {
return TreeBuilder.<T>builder(new ConverterTree<T>(build(), converter, selector));
} | class class_name[name] begin[{]
method[convert, return_type[type[TreeBuilder]], modifier[public], parameter[converter, selector]] begin[{]
return[call[.TreeBuilder, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selector, 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=ConverterTree, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[TreeBuilder] operator[<] identifier[T] operator[>] identifier[convert] operator[SEP] identifier[ContentConverter] operator[<] identifier[T] operator[>] identifier[converter] , identifier[PathSelector] identifier[selector] operator[SEP] {
Keyword[return] identifier[TreeBuilder] operator[SEP] operator[<] identifier[T] operator[>] identifier[builder] operator[SEP] Keyword[new] identifier[ConverterTree] operator[<] identifier[T] operator[>] operator[SEP] identifier[build] operator[SEP] operator[SEP] , identifier[converter] , identifier[selector] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public CommerceAddressRestriction fetchByC_C_First(long classNameId,
long classPK,
OrderByComparator<CommerceAddressRestriction> orderByComparator) {
List<CommerceAddressRestriction> list = findByC_C(classNameId, classPK,
0, 1, orderByComparator);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
} | class class_name[name] begin[{]
method[fetchByC_C_First, return_type[type[CommerceAddressRestriction]], modifier[public], parameter[classNameId, classPK, orderByComparator]] begin[{]
local_variable[type[List], list]
if[call[list.isEmpty, parameter[]]] begin[{]
return[call[list.get, parameter[literal[0]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CommerceAddressRestriction] identifier[fetchByC_C_First] operator[SEP] Keyword[long] identifier[classNameId] , Keyword[long] identifier[classPK] , identifier[OrderByComparator] operator[<] identifier[CommerceAddressRestriction] operator[>] identifier[orderByComparator] operator[SEP] {
identifier[List] operator[<] identifier[CommerceAddressRestriction] operator[>] identifier[list] operator[=] identifier[findByC_C] operator[SEP] identifier[classNameId] , identifier[classPK] , Other[0] , Other[1] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[list] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public Stream<PlainDate> stream(Duration<CalendarUnit> duration) {
if (this.isEmpty() && duration.isPositive()) {
return Stream.empty();
}
DateInterval interval = this.toCanonical();
PlainDate start = interval.getStartAsCalendarDate();
PlainDate end = interval.getEndAsCalendarDate();
if ((start == null) || (end == null)) {
throw new IllegalStateException("Streaming is not supported for infinite intervals.");
}
return DateInterval.stream(duration, start, end);
} | class class_name[name] begin[{]
method[stream, return_type[type[Stream]], modifier[public], parameter[duration]] begin[{]
if[binary_operation[THIS[call[None.isEmpty, parameter[]]], &&, call[duration.isPositive, parameter[]]]] begin[{]
return[call[Stream.empty, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[DateInterval], interval]
local_variable[type[PlainDate], start]
local_variable[type[PlainDate], end]
if[binary_operation[binary_operation[member[.start], ==, literal[null]], ||, binary_operation[member[.end], ==, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Streaming is not supported for infinite intervals.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[DateInterval.stream, parameter[member[.duration], member[.start], member[.end]]]]
end[}]
END[}] | Keyword[public] identifier[Stream] operator[<] identifier[PlainDate] operator[>] identifier[stream] operator[SEP] identifier[Duration] operator[<] identifier[CalendarUnit] operator[>] identifier[duration] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[duration] operator[SEP] identifier[isPositive] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Stream] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP]
}
identifier[DateInterval] identifier[interval] operator[=] Keyword[this] operator[SEP] identifier[toCanonical] operator[SEP] operator[SEP] operator[SEP] identifier[PlainDate] identifier[start] operator[=] identifier[interval] operator[SEP] identifier[getStartAsCalendarDate] operator[SEP] operator[SEP] operator[SEP] identifier[PlainDate] identifier[end] operator[=] identifier[interval] operator[SEP] identifier[getEndAsCalendarDate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[start] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[end] operator[==] Other[null] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[DateInterval] operator[SEP] identifier[stream] operator[SEP] identifier[duration] , identifier[start] , identifier[end] operator[SEP] operator[SEP]
}
|
@Override
public void commit(Xid xid, boolean onePhase) throws XAException {
if (tc.isEntryEnabled()) {
Tr.entry(this, tc, "commit");
}
/*
*
* if (this.xid != null && !xid.equals(this.xid)) {
* final XAException e = new XAException(XAException.XAER_NOTA);
* // What does this error really mean. Need to resolve
* if (tc.isEventEnabled())
* Tr.event(this, tc, "Error: Connection is already involved in different transaction.", e);
* throw e;
* }
*/
if (!onePhase) {
String xPath = null;
if (mcWrapper != null) {
xPath = mcWrapper.gConfigProps.getXpathId();
}
Tr.error(tc, "XA_OP_NOT_SUPPORTED_J2CA0016", "commit", xid, xPath);
XAException x = new XAException(XAException.XAER_PROTO);
if (tc.isEntryEnabled()) {
Tr.exit(this, tc, "commit", x);
}
throw x;
}
boolean exceptionCaught = false;
try {
localTransaction.commit();
} catch (Exception e) {
com.ibm.ws.ffdc.FFDCFilter.processException(
e,
"com.ibm.ejs.j2c.LocalTransactionWrapper.commit",
"164",
this);
if (!mcWrapper.shouldBeDestroyed()) {
mcWrapper.markTransactionError(); // Can't trust the connection since we don't know why it failed.
Tr.error(tc, "XA_END_EXCP_J2CA0024", "commit", xid, e, "XAException", mcWrapper.gConfigProps.getXpathId());
}
exceptionCaught = true;
XAException xae = new XAException(XAException.XA_HEURHAZ);
xae.initCause(e);
if (tc.isEntryEnabled())
Tr.exit(this, tc, "commit", xae);
throw xae;
} finally {
//this.xid = null;
try {
if (registeredForSync == false) {
// Since we didn't register for synchronization for unshared/LTC/res-control=Application.
// Instead of cleanup being done via after completion it will either happen at close or
// commit/rollback which ever happens last. This will allow the connection to be returned
// to the pool prior to the end of the LTC scope allowing better utilization of the connection.
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "commit: calling afterCompletionCode() for cleanup");
}
afterCompletion(0);
}
} catch (Exception e) {
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "commit: caught exception in finally block: ", e);
}
if (exceptionCaught == false) {
XAException xae = new XAException(XAException.XAER_RMFAIL);
xae.initCause(e);
if (tc.isEntryEnabled())
Tr.exit(this, tc, "commit", xae);
throw xae;
}
}
}
if (tc.isEntryEnabled())
Tr.exit(this, tc, "commit");
} | class class_name[name] begin[{]
method[commit, return_type[void], modifier[public], parameter[xid, onePhase]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.entry, parameter[THIS[], member[.tc], literal["commit"]]]
else begin[{]
None
end[}]
if[member[.onePhase]] begin[{]
local_variable[type[String], xPath]
if[binary_operation[member[.mcWrapper], !=, literal[null]]] begin[{]
assign[member[.xPath], call[mcWrapper.gConfigProps.getXpathId, parameter[]]]
else begin[{]
None
end[}]
call[Tr.error, parameter[member[.tc], literal["XA_OP_NOT_SUPPORTED_J2CA0016"], literal["commit"], member[.xid], member[.xPath]]]
local_variable[type[XAException], x]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[THIS[], member[.tc], literal["commit"], member[.x]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
local_variable[type[boolean], exceptionCaught]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=localTransaction, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ejs.j2c.LocalTransactionWrapper.commit"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="164"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=shouldBeDestroyed, postfix_operators=[], prefix_operators=['!'], qualifier=mcWrapper, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=markTransactionError, postfix_operators=[], prefix_operators=[], qualifier=mcWrapper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="XA_END_EXCP_J2CA0024"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="commit"), MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="XAException"), MethodInvocation(arguments=[], member=getXpathId, postfix_operators=[], prefix_operators=[], qualifier=mcWrapper.gConfigProps, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptionCaught, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=XA_HEURHAZ, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAException, sub_type=None)), name=xae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XAException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=xae, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="commit"), MemberReference(member=xae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=xae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=registeredForSync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="commit: calling afterCompletionCode() for cleanup")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=afterCompletion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="commit: caught exception in finally block: "), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=exceptionCaught, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=XAER_RMFAIL, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAException, sub_type=None)), name=xae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XAException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=xae, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="commit"), MemberReference(member=xae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=xae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)], label=None, resources=None)
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[THIS[], member[.tc], literal["commit"]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[commit] operator[SEP] identifier[Xid] identifier[xid] , Keyword[boolean] identifier[onePhase] operator[SEP] Keyword[throws] identifier[XAException] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[onePhase] operator[SEP] {
identifier[String] identifier[xPath] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[mcWrapper] operator[!=] Other[null] operator[SEP] {
identifier[xPath] operator[=] identifier[mcWrapper] operator[SEP] identifier[gConfigProps] operator[SEP] identifier[getXpathId] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , literal[String] , identifier[xid] , identifier[xPath] operator[SEP] operator[SEP] identifier[XAException] identifier[x] operator[=] Keyword[new] identifier[XAException] operator[SEP] identifier[XAException] operator[SEP] identifier[XAER_PROTO] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[x] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[x] operator[SEP]
}
Keyword[boolean] identifier[exceptionCaught] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[localTransaction] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mcWrapper] operator[SEP] identifier[shouldBeDestroyed] operator[SEP] operator[SEP] operator[SEP] {
identifier[mcWrapper] operator[SEP] identifier[markTransactionError] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , literal[String] , identifier[xid] , identifier[e] , literal[String] , identifier[mcWrapper] operator[SEP] identifier[gConfigProps] operator[SEP] identifier[getXpathId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[exceptionCaught] operator[=] literal[boolean] operator[SEP] identifier[XAException] identifier[xae] operator[=] Keyword[new] identifier[XAException] operator[SEP] identifier[XAException] operator[SEP] identifier[XA_HEURHAZ] operator[SEP] operator[SEP] identifier[xae] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[xae] operator[SEP] operator[SEP] Keyword[throw] identifier[xae] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[registeredForSync] operator[==] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
identifier[afterCompletion] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[exceptionCaught] operator[==] literal[boolean] operator[SEP] {
identifier[XAException] identifier[xae] operator[=] Keyword[new] identifier[XAException] operator[SEP] identifier[XAException] operator[SEP] identifier[XAER_RMFAIL] operator[SEP] operator[SEP] identifier[xae] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[xae] operator[SEP] operator[SEP] Keyword[throw] identifier[xae] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public JobDetail build() {
JobDetailImpl job = new JobDetailImpl();
job.setJobClass(jobClass);
job.setDescription(description);
if (key == null) {
key = UUID.randomUUID().toString();
}
job.setName(key);
job.setIsConcurrencyAllowed(isConcurrencyAllowed);
if (!jobDataMap.isEmpty()) {
job.setJobDataMap(jobDataMap);
}
return job;
} | class class_name[name] begin[{]
method[build, return_type[type[JobDetail]], modifier[public], parameter[]] begin[{]
local_variable[type[JobDetailImpl], job]
call[job.setJobClass, parameter[member[.jobClass]]]
call[job.setDescription, parameter[member[.description]]]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
assign[member[.key], call[UUID.randomUUID, parameter[]]]
else begin[{]
None
end[}]
call[job.setName, parameter[member[.key]]]
call[job.setIsConcurrencyAllowed, parameter[member[.isConcurrencyAllowed]]]
if[call[jobDataMap.isEmpty, parameter[]]] begin[{]
call[job.setJobDataMap, parameter[member[.jobDataMap]]]
else begin[{]
None
end[}]
return[member[.job]]
end[}]
END[}] | Keyword[public] identifier[JobDetail] identifier[build] operator[SEP] operator[SEP] {
identifier[JobDetailImpl] identifier[job] operator[=] Keyword[new] identifier[JobDetailImpl] operator[SEP] operator[SEP] operator[SEP] identifier[job] operator[SEP] identifier[setJobClass] operator[SEP] identifier[jobClass] operator[SEP] operator[SEP] identifier[job] operator[SEP] identifier[setDescription] operator[SEP] identifier[description] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
identifier[key] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[job] operator[SEP] identifier[setName] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[job] operator[SEP] identifier[setIsConcurrencyAllowed] operator[SEP] identifier[isConcurrencyAllowed] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[jobDataMap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[job] operator[SEP] identifier[setJobDataMap] operator[SEP] identifier[jobDataMap] operator[SEP] operator[SEP]
}
Keyword[return] identifier[job] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.