code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
public boolean add(Byte value) {
if (value == null) {
stateList.add(Type.NULL);
} else {
stateList.add(Type.LONG);
}
return super.add(value);
}
|
class class_name[name] begin[{]
method[add, return_type[type[boolean]], modifier[public], parameter[value]] begin[{]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
call[stateList.add, parameter[member[Type.NULL]]]
else begin[{]
call[stateList.add, parameter[member[Type.LONG]]]
end[}]
return[SuperMethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[add] operator[SEP] identifier[Byte] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
identifier[stateList] operator[SEP] identifier[add] operator[SEP] identifier[Type] operator[SEP] identifier[NULL] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[stateList] operator[SEP] identifier[add] operator[SEP] identifier[Type] operator[SEP] identifier[LONG] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
|
private static List<SslCipher> getCiphers(String token) {
List<SslCipher> ciphers;
SslCipher cipher = CIPHERS.get(token);
if (cipher != null) {
ciphers = new ArrayList<>(1);
ciphers.add(cipher);
return ciphers;
}
cipher = CIPHER_NICKNAMES.get(token);
if (cipher != null) {
ciphers = new ArrayList<>(1);
ciphers.add(cipher);
return ciphers;
}
ciphers = CIPHER_STRENGTHS.get(token);
if (ciphers != null) {
return ciphers;
}
ciphers = CIPHER_KEY_EXCHANGES.get(token);
if (ciphers != null) {
return ciphers;
}
ciphers = CIPHER_AUTHNS.get(token);
if (ciphers != null) {
return ciphers;
}
ciphers = CIPHER_ENCRYPTS.get(token);
if (ciphers != null) {
return ciphers;
}
ciphers = CIPHER_MACS.get(token);
if (ciphers != null) {
return ciphers;
}
ciphers = CIPHER_PROTOCOLS.get(token);
if (ciphers != null) {
return ciphers;
}
if (token.equals("FIPS")) {
return CIPHER_FIPS;
}
// If we reach this point, then we don't how to handle this
// token. Could be a custom ciphersuite name for some non-standard
// JSSE provider, so we leave it alone.
cipher = new OtherSslCipher(token);
ciphers = new ArrayList<>(1);
ciphers.add(cipher);
return ciphers;
}
|
class class_name[name] begin[{]
method[getCiphers, return_type[type[List]], modifier[private static], parameter[token]] begin[{]
local_variable[type[List], ciphers]
local_variable[type[SslCipher], cipher]
if[binary_operation[member[.cipher], !=, literal[null]]] begin[{]
assign[member[.ciphers], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
call[ciphers.add, parameter[member[.cipher]]]
return[member[.ciphers]]
else begin[{]
None
end[}]
assign[member[.cipher], call[CIPHER_NICKNAMES.get, parameter[member[.token]]]]
if[binary_operation[member[.cipher], !=, literal[null]]] begin[{]
assign[member[.ciphers], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
call[ciphers.add, parameter[member[.cipher]]]
return[member[.ciphers]]
else begin[{]
None
end[}]
assign[member[.ciphers], call[CIPHER_STRENGTHS.get, parameter[member[.token]]]]
if[binary_operation[member[.ciphers], !=, literal[null]]] begin[{]
return[member[.ciphers]]
else begin[{]
None
end[}]
assign[member[.ciphers], call[CIPHER_KEY_EXCHANGES.get, parameter[member[.token]]]]
if[binary_operation[member[.ciphers], !=, literal[null]]] begin[{]
return[member[.ciphers]]
else begin[{]
None
end[}]
assign[member[.ciphers], call[CIPHER_AUTHNS.get, parameter[member[.token]]]]
if[binary_operation[member[.ciphers], !=, literal[null]]] begin[{]
return[member[.ciphers]]
else begin[{]
None
end[}]
assign[member[.ciphers], call[CIPHER_ENCRYPTS.get, parameter[member[.token]]]]
if[binary_operation[member[.ciphers], !=, literal[null]]] begin[{]
return[member[.ciphers]]
else begin[{]
None
end[}]
assign[member[.ciphers], call[CIPHER_MACS.get, parameter[member[.token]]]]
if[binary_operation[member[.ciphers], !=, literal[null]]] begin[{]
return[member[.ciphers]]
else begin[{]
None
end[}]
assign[member[.ciphers], call[CIPHER_PROTOCOLS.get, parameter[member[.token]]]]
if[binary_operation[member[.ciphers], !=, literal[null]]] begin[{]
return[member[.ciphers]]
else begin[{]
None
end[}]
if[call[token.equals, parameter[literal["FIPS"]]]] begin[{]
return[member[.CIPHER_FIPS]]
else begin[{]
None
end[}]
assign[member[.cipher], ClassCreator(arguments=[MemberReference(member=token, 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=OtherSslCipher, sub_type=None))]
assign[member[.ciphers], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
call[ciphers.add, parameter[member[.cipher]]]
return[member[.ciphers]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[SslCipher] operator[>] identifier[getCiphers] operator[SEP] identifier[String] identifier[token] operator[SEP] {
identifier[List] operator[<] identifier[SslCipher] operator[>] identifier[ciphers] operator[SEP] identifier[SslCipher] identifier[cipher] operator[=] identifier[CIPHERS] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cipher] operator[!=] Other[null] operator[SEP] {
identifier[ciphers] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[ciphers] operator[SEP] identifier[add] operator[SEP] identifier[cipher] operator[SEP] operator[SEP] Keyword[return] identifier[ciphers] operator[SEP]
}
identifier[cipher] operator[=] identifier[CIPHER_NICKNAMES] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cipher] operator[!=] Other[null] operator[SEP] {
identifier[ciphers] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[ciphers] operator[SEP] identifier[add] operator[SEP] identifier[cipher] operator[SEP] operator[SEP] Keyword[return] identifier[ciphers] operator[SEP]
}
identifier[ciphers] operator[=] identifier[CIPHER_STRENGTHS] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ciphers] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[ciphers] operator[SEP]
}
identifier[ciphers] operator[=] identifier[CIPHER_KEY_EXCHANGES] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ciphers] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[ciphers] operator[SEP]
}
identifier[ciphers] operator[=] identifier[CIPHER_AUTHNS] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ciphers] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[ciphers] operator[SEP]
}
identifier[ciphers] operator[=] identifier[CIPHER_ENCRYPTS] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ciphers] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[ciphers] operator[SEP]
}
identifier[ciphers] operator[=] identifier[CIPHER_MACS] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ciphers] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[ciphers] operator[SEP]
}
identifier[ciphers] operator[=] identifier[CIPHER_PROTOCOLS] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ciphers] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[ciphers] operator[SEP]
}
Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[CIPHER_FIPS] operator[SEP]
}
identifier[cipher] operator[=] Keyword[new] identifier[OtherSslCipher] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[ciphers] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[ciphers] operator[SEP] identifier[add] operator[SEP] identifier[cipher] operator[SEP] operator[SEP] Keyword[return] identifier[ciphers] operator[SEP]
}
|
@Trivial
private void decrementWithheldConcurrency() {
int w;
while ((w = withheldConcurrency.get()) > 0 && !withheldConcurrency.compareAndSet(w, w - 1));
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "withheld concurrency " + w + " --> " + (w == 0 ? 0 : (w - 1)));
}
|
class class_name[name] begin[{]
method[decrementWithheldConcurrency, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[int], w]
while[binary_operation[binary_operation[assign[member[.w], call[withheldConcurrency.get, parameter[]]], >, literal[0]], &&, call[withheldConcurrency.compareAndSet, parameter[member[.w], binary_operation[member[.w], -, literal[1]]]]]] begin[{]
Statement(label=None)
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], binary_operation[binary_operation[binary_operation[literal["withheld concurrency "], +, member[.w]], +, literal[" --> "]], +, TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Trivial] Keyword[private] Keyword[void] identifier[decrementWithheldConcurrency] operator[SEP] operator[SEP] {
Keyword[int] identifier[w] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[w] operator[=] identifier[withheldConcurrency] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[!] identifier[withheldConcurrency] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[w] , identifier[w] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[w] operator[+] literal[String] operator[+] operator[SEP] identifier[w] operator[==] Other[0] operator[?] Other[0] operator[:] operator[SEP] identifier[w] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected void notifyMenu(int x, int y, int xAbs, int yAbs, boolean isKeyboardTrigger) {
super.notifyMenu(x, y, xAbs, yAbs, isKeyboardTrigger);
}
|
class class_name[name] begin[{]
method[notifyMenu, return_type[void], modifier[protected], parameter[x, y, xAbs, yAbs, isKeyboardTrigger]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xAbs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=yAbs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isKeyboardTrigger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=notifyMenu, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[notifyMenu] operator[SEP] Keyword[int] identifier[x] , Keyword[int] identifier[y] , Keyword[int] identifier[xAbs] , Keyword[int] identifier[yAbs] , Keyword[boolean] identifier[isKeyboardTrigger] operator[SEP] {
Keyword[super] operator[SEP] identifier[notifyMenu] operator[SEP] identifier[x] , identifier[y] , identifier[xAbs] , identifier[yAbs] , identifier[isKeyboardTrigger] operator[SEP] operator[SEP]
}
|
public static Bson lookup(final String from, final List<? extends Bson> pipeline, final String as) {
return lookup(from, null, pipeline, as);
}
|
class class_name[name] begin[{]
method[lookup, return_type[type[Bson]], modifier[public static], parameter[from, pipeline, as]] begin[{]
return[call[.lookup, parameter[member[.from], literal[null], member[.pipeline], member[.as]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Bson] identifier[lookup] operator[SEP] Keyword[final] identifier[String] identifier[from] , Keyword[final] identifier[List] operator[<] operator[?] Keyword[extends] identifier[Bson] operator[>] identifier[pipeline] , Keyword[final] identifier[String] identifier[as] operator[SEP] {
Keyword[return] identifier[lookup] operator[SEP] identifier[from] , Other[null] , identifier[pipeline] , identifier[as] operator[SEP] operator[SEP]
}
|
protected void handleInboundSoapHeaders(final org.springframework.ws.soap.SoapMessage soapMessage,
final SoapMessage message) {
try {
final SoapHeader soapHeader = soapMessage.getSoapHeader();
if (soapHeader != null) {
final Iterator<?> iter = soapHeader.examineAllHeaderElements();
while (iter.hasNext()) {
final SoapHeaderElement headerEntry = (SoapHeaderElement) iter.next();
MessageHeaderUtils.setHeader(message, headerEntry.getName().getLocalPart(), headerEntry.getText());
}
if (soapHeader.getSource() != null) {
final StringResult headerData = new StringResult();
final TransformerFactory transformerFactory = TransformerFactory.newInstance();
final Transformer transformer = transformerFactory.newTransformer();
transformer.transform(soapHeader.getSource(), headerData);
message.addHeaderData(headerData.toString());
}
}
if (StringUtils.hasText(soapMessage.getSoapAction())) {
if (soapMessage.getSoapAction().equals("\"\"")) {
message.setHeader(SoapMessageHeaders.SOAP_ACTION, "");
} else {
if (soapMessage.getSoapAction().startsWith("\"") && soapMessage.getSoapAction().endsWith("\"")) {
message.setHeader(SoapMessageHeaders.SOAP_ACTION,
soapMessage.getSoapAction().substring(1, soapMessage.getSoapAction().length() - 1));
} else {
message.setHeader(SoapMessageHeaders.SOAP_ACTION, soapMessage.getSoapAction());
}
}
}
} catch (final TransformerException e) {
throw new CitrusRuntimeException("Failed to read SOAP header source", e);
}
}
|
class class_name[name] begin[{]
method[handleInboundSoapHeaders, return_type[void], modifier[protected], parameter[soapMessage, message]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSoapHeader, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[], type_arguments=None), name=soapHeader)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SoapHeader, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=soapHeader, 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=examineAllHeaderElements, postfix_operators=[], prefix_operators=[], qualifier=soapHeader, selectors=[], type_arguments=None), name=iter)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SoapHeaderElement, sub_type=None)), name=headerEntry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SoapHeaderElement, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=headerEntry, selectors=[MethodInvocation(arguments=[], member=getLocalPart, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=headerEntry, selectors=[], type_arguments=None)], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=MessageHeaderUtils, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=soapHeader, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringResult, sub_type=None)), name=headerData)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringResult, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=TransformerFactory, selectors=[], type_arguments=None), name=transformerFactory)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TransformerFactory, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newTransformer, postfix_operators=[], prefix_operators=[], qualifier=transformerFactory, selectors=[], type_arguments=None), name=transformer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Transformer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=soapHeader, selectors=[], type_arguments=None), MemberReference(member=headerData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transform, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=headerData, selectors=[], type_arguments=None)], member=addHeaderData, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]))])), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSoapAction, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[], type_arguments=None)], member=hasText, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getSoapAction, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"\"")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSoapAction, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getSoapAction, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SOAP_ACTION, postfix_operators=[], prefix_operators=[], qualifier=SoapMessageHeaders, selectors=[]), MethodInvocation(arguments=[], member=getSoapAction, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[], type_arguments=None)], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SOAP_ACTION, postfix_operators=[], prefix_operators=[], qualifier=SoapMessageHeaders, selectors=[]), MethodInvocation(arguments=[], member=getSoapAction, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSoapAction, postfix_operators=[], prefix_operators=[], qualifier=soapMessage, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SOAP_ACTION, postfix_operators=[], prefix_operators=[], qualifier=SoapMessageHeaders, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to read SOAP header source"), 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=CitrusRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TransformerException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[handleInboundSoapHeaders] operator[SEP] Keyword[final] identifier[org] operator[SEP] identifier[springframework] operator[SEP] identifier[ws] operator[SEP] identifier[soap] operator[SEP] identifier[SoapMessage] identifier[soapMessage] , Keyword[final] identifier[SoapMessage] identifier[message] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[SoapHeader] identifier[soapHeader] operator[=] identifier[soapMessage] operator[SEP] identifier[getSoapHeader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[soapHeader] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[Iterator] operator[<] operator[?] operator[>] identifier[iter] operator[=] identifier[soapHeader] operator[SEP] identifier[examineAllHeaderElements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[SoapHeaderElement] identifier[headerEntry] operator[=] operator[SEP] identifier[SoapHeaderElement] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[MessageHeaderUtils] operator[SEP] identifier[setHeader] operator[SEP] identifier[message] , identifier[headerEntry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[getLocalPart] operator[SEP] operator[SEP] , identifier[headerEntry] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[soapHeader] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[StringResult] identifier[headerData] operator[=] Keyword[new] identifier[StringResult] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[TransformerFactory] identifier[transformerFactory] operator[=] identifier[TransformerFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Transformer] identifier[transformer] operator[=] identifier[transformerFactory] operator[SEP] identifier[newTransformer] operator[SEP] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[transform] operator[SEP] identifier[soapHeader] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] , identifier[headerData] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[addHeaderData] operator[SEP] identifier[headerData] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[soapMessage] operator[SEP] identifier[getSoapAction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[soapMessage] operator[SEP] identifier[getSoapAction] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[message] operator[SEP] identifier[setHeader] operator[SEP] identifier[SoapMessageHeaders] operator[SEP] identifier[SOAP_ACTION] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[soapMessage] operator[SEP] identifier[getSoapAction] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[soapMessage] operator[SEP] identifier[getSoapAction] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[message] operator[SEP] identifier[setHeader] operator[SEP] identifier[SoapMessageHeaders] operator[SEP] identifier[SOAP_ACTION] , identifier[soapMessage] operator[SEP] identifier[getSoapAction] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[soapMessage] operator[SEP] identifier[getSoapAction] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[message] operator[SEP] identifier[setHeader] operator[SEP] identifier[SoapMessageHeaders] operator[SEP] identifier[SOAP_ACTION] , identifier[soapMessage] operator[SEP] identifier[getSoapAction] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[TransformerException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CitrusRuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void addAllToProperties(Properties props) {
synchronized (this.confData) {
for (Map.Entry<String, Object> entry : this.confData.entrySet()) {
props.put(entry.getKey(), entry.getValue());
}
}
}
|
class class_name[name] begin[{]
method[addAllToProperties, return_type[void], modifier[public], parameter[props]] begin[{]
SYNCHRONIZED[THIS[member[None.confData]]] BEGIN[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=confData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
END[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addAllToProperties] operator[SEP] identifier[Properties] identifier[props] operator[SEP] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[confData] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] Keyword[this] operator[SEP] identifier[confData] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[props] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public Node previousNode() {
if (currentNode == null)
return null;
// get sibling
Node result = getPreviousSibling(currentNode);
if (result == null) {
result = getParentNode(currentNode);
if (result != null) {
currentNode = result;
return result;
}
return null;
}
// get the lastChild of result.
Node lastChild = getLastChild(result);
Node prev = lastChild;
while (lastChild != null) {
prev = lastChild;
lastChild = getLastChild(prev);
}
lastChild = prev;
// if there is a lastChild which passes filters return it.
if (lastChild != null) {
currentNode = lastChild;
return lastChild;
}
// otherwise return the previous sibling.
currentNode = result;
return result;
}
|
class class_name[name] begin[{]
method[previousNode, return_type[type[Node]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.currentNode], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[Node], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
assign[member[.result], call[.getParentNode, parameter[member[.currentNode]]]]
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
assign[member[.currentNode], member[.result]]
return[member[.result]]
else begin[{]
None
end[}]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[Node], lastChild]
local_variable[type[Node], prev]
while[binary_operation[member[.lastChild], !=, literal[null]]] begin[{]
assign[member[.prev], member[.lastChild]]
assign[member[.lastChild], call[.getLastChild, parameter[member[.prev]]]]
end[}]
assign[member[.lastChild], member[.prev]]
if[binary_operation[member[.lastChild], !=, literal[null]]] begin[{]
assign[member[.currentNode], member[.lastChild]]
return[member[.lastChild]]
else begin[{]
None
end[}]
assign[member[.currentNode], member[.result]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] identifier[Node] identifier[previousNode] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentNode] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[Node] identifier[result] operator[=] identifier[getPreviousSibling] operator[SEP] identifier[currentNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
identifier[result] operator[=] identifier[getParentNode] operator[SEP] identifier[currentNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
identifier[currentNode] operator[=] identifier[result] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
identifier[Node] identifier[lastChild] operator[=] identifier[getLastChild] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[Node] identifier[prev] operator[=] identifier[lastChild] operator[SEP] Keyword[while] operator[SEP] identifier[lastChild] operator[!=] Other[null] operator[SEP] {
identifier[prev] operator[=] identifier[lastChild] operator[SEP] identifier[lastChild] operator[=] identifier[getLastChild] operator[SEP] identifier[prev] operator[SEP] operator[SEP]
}
identifier[lastChild] operator[=] identifier[prev] operator[SEP] Keyword[if] operator[SEP] identifier[lastChild] operator[!=] Other[null] operator[SEP] {
identifier[currentNode] operator[=] identifier[lastChild] operator[SEP] Keyword[return] identifier[lastChild] operator[SEP]
}
identifier[currentNode] operator[=] identifier[result] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
private Boolean supportsMessageProtection(String url, Map<String, String> challengeMap) {
if (!"true".equals(challengeMap.get("supportspop"))) {
return false;
}
// Message protection is enabled only for subset of keys operations.
if (!url.toLowerCase().contains("/keys/")) {
return false;
}
String[] tokens = url.split("\\?")[0].split("/");
return supportedMethods.contains(tokens[tokens.length - 1]);
}
|
class class_name[name] begin[{]
method[supportsMessageProtection, return_type[type[Boolean]], modifier[private], parameter[url, challengeMap]] begin[{]
if[literal["true"]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[url.toLowerCase, parameter[]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[String], tokens]
return[call[supportedMethods.contains, parameter[member[.tokens]]]]
end[}]
END[}]
|
Keyword[private] identifier[Boolean] identifier[supportsMessageProtection] operator[SEP] identifier[String] identifier[url] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[challengeMap] operator[SEP] {
Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[challengeMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[url] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[tokens] operator[=] identifier[url] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[supportedMethods] operator[SEP] identifier[contains] operator[SEP] identifier[tokens] operator[SEP] identifier[tokens] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void end(String namespace, String name) throws Exception {
// Determine the target object for the method call: the parent object
Object parent = getDigester().peek(1);
Object child = getDigester().peek(0);
// Retrieve or construct the parameter values array
Object[] parameters = null;
if (m_paramCount > 0) {
parameters = getDigester().popParams();
if (LOG.isTraceEnabled()) {
for (int i = 0, size = parameters.length; i < size; i++) {
LOG.trace("[SetNextRuleWithParams](" + i + ")" + parameters[i]);
}
}
// In the case where the target method takes a single parameter
// and that parameter does not exist (the CallParamRule never
// executed or the CallParamRule was intended to set the parameter
// from an attribute but the attribute wasn't present etc) then
// skip the method call.
//
// This is useful when a class has a "default" value that should
// only be overridden if data is present in the XML. I don't
// know why this should only apply to methods taking *one*
// parameter, but it always has been so we can't change it now.
if ((m_paramCount == 1) && (parameters[0] == null)) {
return;
}
} else if (m_paramTypes.length != 0) {
// Having paramCount == 0 and paramTypes.length == 1 indicates
// that we have the special case where the target method has one
// parameter being the body text of the current element.
// There is no body text included in the source XML file,
// so skip the method call
if (m_bodyText == null) {
return;
}
parameters = new Object[1];
parameters[0] = m_bodyText;
if (m_paramTypes.length == 0) {
m_paramTypes = new Class[1];
m_paramTypes[0] = String.class;
}
} else {
// When paramCount is zero and paramTypes.length is zero it
// means that we truly are calling a method with no parameters.
// Nothing special needs to be done here.
parameters = new Object[0];
}
// Construct the parameter values array we will need
// We only do the conversion if the param value is a String and
// the specified paramType is not String.
Object[] paramValues = new Object[m_paramTypes.length];
Class<?> propertyClass = child.getClass();
for (int i = 0; i < m_paramTypes.length; i++) {
if (m_paramTypes[i] == propertyClass) {
// implant the original child to set if Class matches:
paramValues[i] = child;
} else if ((parameters[i] == null)
|| ((parameters[i] instanceof String) && !String.class.isAssignableFrom(m_paramTypes[i]))) {
// convert nulls and convert stringy parameters
// for non-stringy param types
if (parameters[i] == null) {
paramValues[i] = null;
} else {
paramValues[i] = ConvertUtils.convert((String)parameters[i], m_paramTypes[i]);
}
} else {
paramValues[i] = parameters[i];
}
}
if (parent == null) {
StringBuffer sb = new StringBuffer();
sb.append("[SetNextRuleWithParams]{");
sb.append(getDigester().getMatch());
sb.append("} Call target is null (");
sb.append("targetOffset=");
sb.append(m_targetOffset);
sb.append(",stackdepth=");
sb.append(getDigester().getCount());
sb.append(")");
throw new org.xml.sax.SAXException(sb.toString());
}
// Invoke the required method on the top object
if (LOG.isDebugEnabled()) {
StringBuffer sb = new StringBuffer("[SetNextRuleWithParams]{");
sb.append(getDigester().getMatch());
sb.append("} Call ");
sb.append(parent.getClass().getName());
sb.append(".");
sb.append(m_methodName);
sb.append("(");
for (int i = 0; i < paramValues.length; i++) {
if (i > 0) {
sb.append(",");
}
if (paramValues[i] == null) {
sb.append("null");
} else {
sb.append(paramValues[i].toString());
}
sb.append("/");
if (m_paramTypes[i] == null) {
sb.append("null");
} else {
sb.append(m_paramTypes[i].getName());
}
}
sb.append(")");
LOG.debug(sb.toString());
}
Object result = null;
if (m_useExactMatch) {
// invoke using exact match
result = MethodUtils.invokeExactMethod(parent, m_methodName, paramValues, m_paramTypes);
} else {
// invoke using fuzzier match
result = MethodUtils.invokeMethod(parent, m_methodName, paramValues, m_paramTypes);
}
processMethodCallResult(result);
}
|
class class_name[name] begin[{]
method[end, return_type[void], modifier[public], parameter[namespace, name]] begin[{]
local_variable[type[Object], parent]
local_variable[type[Object], child]
local_variable[type[Object], parameters]
if[binary_operation[member[.m_paramCount], >, literal[0]]] begin[{]
assign[member[.parameters], call[.getDigester, parameter[]]]
if[call[LOG.isTraceEnabled, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[SetNextRuleWithParams]("), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+), operandr=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[]), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.m_paramCount], ==, literal[1]], &&, binary_operation[member[.parameters], ==, literal[null]]]] begin[{]
return[None]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[m_paramTypes.length], !=, literal[0]]] begin[{]
if[binary_operation[member[.m_bodyText], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
assign[member[.parameters], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]
assign[member[.parameters], member[.m_bodyText]]
if[binary_operation[member[m_paramTypes.length], ==, literal[0]]] begin[{]
assign[member[.m_paramTypes], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))]
assign[member[.m_paramTypes], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
assign[member[.parameters], 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=Object, sub_type=None))]
end[}]
end[}]
local_variable[type[Object], paramValues]
local_variable[type[Class], propertyClass]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=propertyClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), operandr=ClassReference(postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=m_paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), operator=&&), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), MemberReference(member=m_paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=ConvertUtils, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=m_paramTypes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.parent], ==, literal[null]]] begin[{]
local_variable[type[StringBuffer], sb]
call[sb.append, parameter[literal["[SetNextRuleWithParams]{"]]]
call[sb.append, parameter[call[.getDigester, parameter[]]]]
call[sb.append, parameter[literal["} Call target is null ("]]]
call[sb.append, parameter[literal["targetOffset="]]]
call[sb.append, parameter[member[.m_targetOffset]]]
call[sb.append, parameter[literal[",stackdepth="]]]
call[sb.append, parameter[call[.getDigester, parameter[]]]]
call[sb.append, parameter[literal[")"]]]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=sax, sub_type=ReferenceType(arguments=None, dimensions=None, name=SAXException, sub_type=None))))), label=None)
else begin[{]
None
end[}]
if[call[LOG.isDebugEnabled, parameter[]]] begin[{]
local_variable[type[StringBuffer], sb]
call[sb.append, parameter[call[.getDigester, parameter[]]]]
call[sb.append, parameter[literal["} Call "]]]
call[sb.append, parameter[call[parent.getClass, parameter[]]]]
call[sb.append, parameter[literal["."]]]
call[sb.append, parameter[member[.m_methodName]]]
call[sb.append, parameter[literal["("]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, 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=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], 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=length, postfix_operators=[], prefix_operators=[], qualifier=paramValues, 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)
call[sb.append, parameter[literal[")"]]]
call[LOG.debug, parameter[call[sb.toString, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[Object], result]
if[member[.m_useExactMatch]] begin[{]
assign[member[.result], call[MethodUtils.invokeExactMethod, parameter[member[.parent], member[.m_methodName], member[.paramValues], member[.m_paramTypes]]]]
else begin[{]
assign[member[.result], call[MethodUtils.invokeMethod, parameter[member[.parent], member[.m_methodName], member[.paramValues], member[.m_paramTypes]]]]
end[}]
call[.processMethodCallResult, parameter[member[.result]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[end] operator[SEP] identifier[String] identifier[namespace] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[Object] identifier[parent] operator[=] identifier[getDigester] operator[SEP] operator[SEP] operator[SEP] identifier[peek] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[Object] identifier[child] operator[=] identifier[getDigester] operator[SEP] operator[SEP] operator[SEP] identifier[peek] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[parameters] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[m_paramCount] operator[>] Other[0] operator[SEP] {
identifier[parameters] operator[=] identifier[getDigester] operator[SEP] operator[SEP] operator[SEP] identifier[popParams] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[size] operator[=] identifier[parameters] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[i] operator[+] literal[String] operator[+] identifier[parameters] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[m_paramCount] operator[==] Other[1] operator[SEP] operator[&&] operator[SEP] identifier[parameters] operator[SEP] Other[0] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[m_paramTypes] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_bodyText] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[parameters] operator[=] Keyword[new] identifier[Object] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] Other[0] operator[SEP] operator[=] identifier[m_bodyText] operator[SEP] Keyword[if] operator[SEP] identifier[m_paramTypes] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[m_paramTypes] operator[=] Keyword[new] identifier[Class] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[m_paramTypes] operator[SEP] Other[0] operator[SEP] operator[=] identifier[String] operator[SEP] Keyword[class] operator[SEP]
}
}
Keyword[else] {
identifier[parameters] operator[=] Keyword[new] identifier[Object] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[Object] operator[SEP] operator[SEP] identifier[paramValues] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[m_paramTypes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[propertyClass] operator[=] identifier[child] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[m_paramTypes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_paramTypes] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[propertyClass] operator[SEP] {
identifier[paramValues] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[child] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[String] operator[SEP] operator[&&] operator[!] identifier[String] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[m_paramTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[paramValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
identifier[paramValues] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[ConvertUtils] operator[SEP] identifier[convert] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] , identifier[m_paramTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[paramValues] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[parameters] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] {
identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[getDigester] operator[SEP] operator[SEP] operator[SEP] identifier[getMatch] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[m_targetOffset] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[getDigester] operator[SEP] operator[SEP] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[org] operator[SEP] identifier[xml] operator[SEP] identifier[sax] operator[SEP] identifier[SAXException] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[getDigester] operator[SEP] operator[SEP] operator[SEP] identifier[getMatch] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[parent] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[m_methodName] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[paramValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[paramValues] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[paramValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_paramTypes] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[m_paramTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[m_useExactMatch] operator[SEP] {
identifier[result] operator[=] identifier[MethodUtils] operator[SEP] identifier[invokeExactMethod] operator[SEP] identifier[parent] , identifier[m_methodName] , identifier[paramValues] , identifier[m_paramTypes] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[result] operator[=] identifier[MethodUtils] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[parent] , identifier[m_methodName] , identifier[paramValues] , identifier[m_paramTypes] operator[SEP] operator[SEP]
}
identifier[processMethodCallResult] operator[SEP] identifier[result] operator[SEP] operator[SEP]
}
|
public int getDecoderMemoryUsage() {
// Round the dictionary size up to the next 2^n or 2^n + 2^(n-1).
int d = dictSize - 1;
d |= d >>> 2;
d |= d >>> 3;
d |= d >>> 4;
d |= d >>> 8;
d |= d >>> 16;
return LZMA2InputStream.getMemoryUsage(d + 1);
}
|
class class_name[name] begin[{]
method[getDecoderMemoryUsage, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], d]
assign[member[.d], binary_operation[member[.d], >>>, literal[2]]]
assign[member[.d], binary_operation[member[.d], >>>, literal[3]]]
assign[member[.d], binary_operation[member[.d], >>>, literal[4]]]
assign[member[.d], binary_operation[member[.d], >>>, literal[8]]]
assign[member[.d], binary_operation[member[.d], >>>, literal[16]]]
return[call[LZMA2InputStream.getMemoryUsage, parameter[binary_operation[member[.d], +, literal[1]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[int] identifier[getDecoderMemoryUsage] operator[SEP] operator[SEP] {
Keyword[int] identifier[d] operator[=] identifier[dictSize] operator[-] Other[1] operator[SEP] identifier[d] operator[|=] identifier[d] operator[>] operator[>] operator[>] Other[2] operator[SEP] identifier[d] operator[|=] identifier[d] operator[>] operator[>] operator[>] Other[3] operator[SEP] identifier[d] operator[|=] identifier[d] operator[>] operator[>] operator[>] Other[4] operator[SEP] identifier[d] operator[|=] identifier[d] operator[>] operator[>] operator[>] Other[8] operator[SEP] identifier[d] operator[|=] identifier[d] operator[>] operator[>] operator[>] Other[16] operator[SEP] Keyword[return] identifier[LZMA2InputStream] operator[SEP] identifier[getMemoryUsage] operator[SEP] identifier[d] operator[+] Other[1] operator[SEP] operator[SEP]
}
|
public boolean setExpire(long seconds) {
if(seconds <= 0)return true;
try {
if(!isBinary)return getJedisCommands(groupName).expire(key, (int)seconds) == 1;
if(isCluster(groupName)){
return getBinaryJedisClusterCommands(groupName).expire(keyBytes, (int)seconds) == 1;
}
return getBinaryJedisCommands(groupName).expire(keyBytes, (int)seconds) == 1;
} finally {
getJedisProvider(groupName).release();
}
}
|
class class_name[name] begin[{]
method[setExpire, return_type[type[boolean]], modifier[public], parameter[seconds]] begin[{]
if[binary_operation[member[.seconds], <=, literal[0]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=MemberReference(member=isBinary, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJedisCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=seconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], member=expire, 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===), label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isCluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBinaryJedisClusterCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=keyBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=seconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], member=expire, 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===), label=None)])), ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBinaryJedisCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=keyBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=seconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], member=expire, 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===), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJedisProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=release, 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[boolean] identifier[setExpire] operator[SEP] Keyword[long] identifier[seconds] operator[SEP] {
Keyword[if] operator[SEP] identifier[seconds] operator[<=] Other[0] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] operator[!] identifier[isBinary] operator[SEP] Keyword[return] identifier[getJedisCommands] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[expire] operator[SEP] identifier[key] , operator[SEP] Keyword[int] operator[SEP] identifier[seconds] operator[SEP] operator[==] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[isCluster] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] {
Keyword[return] identifier[getBinaryJedisClusterCommands] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[expire] operator[SEP] identifier[keyBytes] , operator[SEP] Keyword[int] operator[SEP] identifier[seconds] operator[SEP] operator[==] Other[1] operator[SEP]
}
Keyword[return] identifier[getBinaryJedisCommands] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[expire] operator[SEP] identifier[keyBytes] , operator[SEP] Keyword[int] operator[SEP] identifier[seconds] operator[SEP] operator[==] Other[1] operator[SEP]
}
Keyword[finally] {
identifier[getJedisProvider] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP]
}
}
|
static <T extends ChronoEntity<T>> ElementRule<T, Integer> elementRule(Class<T> type) {
return new ERule<>();
}
|
class class_name[name] begin[{]
method[elementRule, return_type[type[ElementRule]], modifier[static], parameter[type]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ERule, sub_type=None))]
end[}]
END[}]
|
Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ChronoEntity] operator[<] identifier[T] operator[>] operator[>] identifier[ElementRule] operator[<] identifier[T] , identifier[Integer] operator[>] identifier[elementRule] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] {
Keyword[return] Keyword[new] identifier[ERule] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
|
public static MozuUrl getProductInventoryUrl(String locationCodes, String productCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/products/{productCode}/locationinventory?locationCodes={locationCodes}&responseFields={responseFields}");
formatter.formatUrl("locationCodes", locationCodes);
formatter.formatUrl("productCode", productCode);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
}
|
class class_name[name] begin[{]
method[getProductInventoryUrl, return_type[type[MozuUrl]], modifier[public static], parameter[locationCodes, productCode, responseFields]] begin[{]
local_variable[type[UrlFormatter], formatter]
call[formatter.formatUrl, parameter[literal["locationCodes"], member[.locationCodes]]]
call[formatter.formatUrl, parameter[literal["productCode"], member[.productCode]]]
call[formatter.formatUrl, parameter[literal["responseFields"], member[.responseFields]]]
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[getProductInventoryUrl] operator[SEP] identifier[String] identifier[locationCodes] , identifier[String] identifier[productCode] , identifier[String] identifier[responseFields] 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[locationCodes] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[productCode] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[responseFields] 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 Content valueTagOutput(VariableElement field, String constantVal, boolean includeLink) {
return includeLink ?
htmlWriter.getDocLink(LinkInfoImpl.Kind.VALUE_TAG, field,
constantVal, false) : new RawHtml(constantVal);
}
|
class class_name[name] begin[{]
method[valueTagOutput, return_type[type[Content]], modifier[public], parameter[field, constantVal, includeLink]] begin[{]
return[TernaryExpression(condition=MemberReference(member=includeLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=ClassCreator(arguments=[MemberReference(member=constantVal, 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=RawHtml, sub_type=None)), if_true=MethodInvocation(arguments=[MemberReference(member=VALUE_TAG, postfix_operators=[], prefix_operators=[], qualifier=LinkInfoImpl.Kind, selectors=[]), MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=constantVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getDocLink, postfix_operators=[], prefix_operators=[], qualifier=htmlWriter, selectors=[], type_arguments=None))]
end[}]
END[}]
|
Keyword[public] identifier[Content] identifier[valueTagOutput] operator[SEP] identifier[VariableElement] identifier[field] , identifier[String] identifier[constantVal] , Keyword[boolean] identifier[includeLink] operator[SEP] {
Keyword[return] identifier[includeLink] operator[?] identifier[htmlWriter] operator[SEP] identifier[getDocLink] operator[SEP] identifier[LinkInfoImpl] operator[SEP] identifier[Kind] operator[SEP] identifier[VALUE_TAG] , identifier[field] , identifier[constantVal] , literal[boolean] operator[SEP] operator[:] Keyword[new] identifier[RawHtml] operator[SEP] identifier[constantVal] operator[SEP] operator[SEP]
}
|
@Override
public EClass getIfcElementComponent() {
if (ifcElementComponentEClass == null) {
ifcElementComponentEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(224);
}
return ifcElementComponentEClass;
}
|
class class_name[name] begin[{]
method[getIfcElementComponent, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcElementComponentEClass], ==, literal[null]]] begin[{]
assign[member[.ifcElementComponentEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=224)], 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[.ifcElementComponentEClass]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcElementComponent] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcElementComponentEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcElementComponentEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[224] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcElementComponentEClass] operator[SEP]
}
|
protected void manageExceptionReconnection(final Connection deviceProxy, final int retries,
final int i, final Exception e, final String origin) throws DevFailed {
ApiUtilDAODefaultImpl.removePendingRepliesOfDevice(deviceProxy);
if (i==0
&& (e.toString().contains("org.omg.CORBA.TRANSIENT") ||
e.toString().contains("org.omg.CORBA.OBJECT_NOT_EXIST") ||
e.toString().contains("org.omg.CORBA.COMM_FAILURE"))) {
deviceProxy.device = null;
deviceProxy.device_2 = null;
deviceProxy.device_3 = null;
deviceProxy.device_4 = null;
deviceProxy.device_5 = null;
deviceProxy.ior = null;
build_connection(deviceProxy);
if (i == retries - 1) {
throw_dev_failed(deviceProxy, e, origin, false);
}
} else {
throw_dev_failed(deviceProxy, e, origin, false);
}
}
|
class class_name[name] begin[{]
method[manageExceptionReconnection, return_type[void], modifier[protected], parameter[deviceProxy, retries, i, e, origin]] begin[{]
call[ApiUtilDAODefaultImpl.removePendingRepliesOfDevice, parameter[member[.deviceProxy]]]
if[binary_operation[binary_operation[member[.i], ==, literal[0]], &&, binary_operation[binary_operation[call[e.toString, parameter[]], ||, call[e.toString, parameter[]]], ||, call[e.toString, parameter[]]]]] begin[{]
assign[member[deviceProxy.device], literal[null]]
assign[member[deviceProxy.device_2], literal[null]]
assign[member[deviceProxy.device_3], literal[null]]
assign[member[deviceProxy.device_4], literal[null]]
assign[member[deviceProxy.device_5], literal[null]]
assign[member[deviceProxy.ior], literal[null]]
call[.build_connection, parameter[member[.deviceProxy]]]
if[binary_operation[member[.i], ==, binary_operation[member[.retries], -, literal[1]]]] begin[{]
call[.throw_dev_failed, parameter[member[.deviceProxy], member[.e], member[.origin], literal[false]]]
else begin[{]
None
end[}]
else begin[{]
call[.throw_dev_failed, parameter[member[.deviceProxy], member[.e], member[.origin], literal[false]]]
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[manageExceptionReconnection] operator[SEP] Keyword[final] identifier[Connection] identifier[deviceProxy] , Keyword[final] Keyword[int] identifier[retries] , Keyword[final] Keyword[int] identifier[i] , Keyword[final] identifier[Exception] identifier[e] , Keyword[final] identifier[String] identifier[origin] operator[SEP] Keyword[throws] identifier[DevFailed] {
identifier[ApiUtilDAODefaultImpl] operator[SEP] identifier[removePendingRepliesOfDevice] operator[SEP] identifier[deviceProxy] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] Other[0] operator[&&] operator[SEP] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] {
identifier[deviceProxy] operator[SEP] identifier[device] operator[=] Other[null] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_2] operator[=] Other[null] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_3] operator[=] Other[null] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_4] operator[=] Other[null] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_5] operator[=] Other[null] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[ior] operator[=] Other[null] operator[SEP] identifier[build_connection] operator[SEP] identifier[deviceProxy] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] identifier[retries] operator[-] Other[1] operator[SEP] {
identifier[throw_dev_failed] operator[SEP] identifier[deviceProxy] , identifier[e] , identifier[origin] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[throw_dev_failed] operator[SEP] identifier[deviceProxy] , identifier[e] , identifier[origin] , literal[boolean] operator[SEP] operator[SEP]
}
}
|
public static BufferedImage twistImage(BufferedImage srcBmp, int width, int height, boolean bXDir) {
double dMultValue = getRandomDouble(1, 3);
double dPhase = getRandomDouble(0, PI2);
if (width > srcBmp.getWidth())
width = srcBmp.getWidth();
if (height > srcBmp.getHeight())
height = srcBmp.getHeight();
BufferedImage destBmp = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = destBmp.getGraphics();
// 设定背景色
g.setColor(Color.white);
g.fillRect(0, 0, width, height);
// 画边框
g.setColor(Color.black);
g.drawRect(0, 0, width - 1, height - 1);
g.dispose();
double dBaseAxisLen = bXDir ? (double) height : (double) width;
for (int i = 1; i < width - 1; i++) {
for (int j = 1; j < height - 1; j++) {
double dx = 0;
dx = bXDir ? (PI2 * (double) j) / dBaseAxisLen : (PI2 * (double) i) / dBaseAxisLen;
dx += dPhase;
double dy = Math.sin(dx);
// 取得当前点的颜色
int nOldX = 0, nOldY = 0;
nOldX = bXDir ? i + (int) (dy * dMultValue) : i;
nOldY = bXDir ? j : j + (int) (dy * dMultValue);
int color = srcBmp.getRGB(i, j);
if (nOldX >= 1 && nOldX < width - 1 && nOldY >= 1 && nOldY < height - 1) {
destBmp.setRGB(nOldX, nOldY, color);
}
}
}
return destBmp;
}
|
class class_name[name] begin[{]
method[twistImage, return_type[type[BufferedImage]], modifier[public static], parameter[srcBmp, width, height, bXDir]] begin[{]
local_variable[type[double], dMultValue]
local_variable[type[double], dPhase]
if[binary_operation[member[.width], >, call[srcBmp.getWidth, parameter[]]]] begin[{]
assign[member[.width], call[srcBmp.getWidth, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[member[.height], >, call[srcBmp.getHeight, parameter[]]]] begin[{]
assign[member[.height], call[srcBmp.getHeight, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[BufferedImage], destBmp]
local_variable[type[Graphics], g]
call[g.setColor, parameter[member[Color.white]]]
call[g.fillRect, parameter[literal[0], literal[0], member[.width], member[.height]]]
call[g.setColor, parameter[member[Color.black]]]
call[g.drawRect, parameter[literal[0], literal[0], binary_operation[member[.width], -, literal[1]], binary_operation[member[.height], -, literal[1]]]]
call[g.dispose, parameter[]]
local_variable[type[double], dBaseAxisLen]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=dx)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=bXDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PI2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), operator=*), operandr=MemberReference(member=dBaseAxisLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), if_true=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PI2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), operator=*), operandr=MemberReference(member=dBaseAxisLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=dPhase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sin, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=dy)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=nOldX), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=nOldY)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nOldX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=bXDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=BinaryOperation(operandl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dMultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int)), operator=+))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nOldY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=bXDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=BinaryOperation(operandl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dMultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int)), operator=+), if_true=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRGB, postfix_operators=[], prefix_operators=[], qualifier=srcBmp, selectors=[], type_arguments=None), name=color)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nOldX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=nOldX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=nOldY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=nOldY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nOldX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nOldY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRGB, postfix_operators=[], prefix_operators=[], qualifier=destBmp, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.destBmp]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[BufferedImage] identifier[twistImage] operator[SEP] identifier[BufferedImage] identifier[srcBmp] , Keyword[int] identifier[width] , Keyword[int] identifier[height] , Keyword[boolean] identifier[bXDir] operator[SEP] {
Keyword[double] identifier[dMultValue] operator[=] identifier[getRandomDouble] operator[SEP] Other[1] , Other[3] operator[SEP] operator[SEP] Keyword[double] identifier[dPhase] operator[=] identifier[getRandomDouble] operator[SEP] Other[0] , identifier[PI2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[width] operator[>] identifier[srcBmp] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] identifier[width] operator[=] identifier[srcBmp] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[height] operator[>] identifier[srcBmp] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] identifier[height] operator[=] identifier[srcBmp] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[destBmp] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[width] , identifier[height] , identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_RGB] operator[SEP] operator[SEP] identifier[Graphics] identifier[g] operator[=] identifier[destBmp] operator[SEP] identifier[getGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[Color] operator[SEP] identifier[white] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[fillRect] operator[SEP] Other[0] , Other[0] , identifier[width] , identifier[height] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[Color] operator[SEP] identifier[black] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawRect] operator[SEP] Other[0] , Other[0] , identifier[width] operator[-] Other[1] , identifier[height] operator[-] Other[1] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[dBaseAxisLen] operator[=] identifier[bXDir] operator[?] operator[SEP] Keyword[double] operator[SEP] identifier[height] operator[:] operator[SEP] Keyword[double] operator[SEP] identifier[width] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[width] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[1] operator[SEP] identifier[j] operator[<] identifier[height] operator[-] Other[1] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[double] identifier[dx] operator[=] Other[0] operator[SEP] identifier[dx] operator[=] identifier[bXDir] operator[?] operator[SEP] identifier[PI2] operator[*] operator[SEP] Keyword[double] operator[SEP] identifier[j] operator[SEP] operator[/] identifier[dBaseAxisLen] operator[:] operator[SEP] identifier[PI2] operator[*] operator[SEP] Keyword[double] operator[SEP] identifier[i] operator[SEP] operator[/] identifier[dBaseAxisLen] operator[SEP] identifier[dx] operator[+=] identifier[dPhase] operator[SEP] Keyword[double] identifier[dy] operator[=] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[dx] operator[SEP] operator[SEP] Keyword[int] identifier[nOldX] operator[=] Other[0] , identifier[nOldY] operator[=] Other[0] operator[SEP] identifier[nOldX] operator[=] identifier[bXDir] operator[?] identifier[i] operator[+] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[dy] operator[*] identifier[dMultValue] operator[SEP] operator[:] identifier[i] operator[SEP] identifier[nOldY] operator[=] identifier[bXDir] operator[?] identifier[j] operator[:] identifier[j] operator[+] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[dy] operator[*] identifier[dMultValue] operator[SEP] operator[SEP] Keyword[int] identifier[color] operator[=] identifier[srcBmp] operator[SEP] identifier[getRGB] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nOldX] operator[>=] Other[1] operator[&&] identifier[nOldX] operator[<] identifier[width] operator[-] Other[1] operator[&&] identifier[nOldY] operator[>=] Other[1] operator[&&] identifier[nOldY] operator[<] identifier[height] operator[-] Other[1] operator[SEP] {
identifier[destBmp] operator[SEP] identifier[setRGB] operator[SEP] identifier[nOldX] , identifier[nOldY] , identifier[color] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[destBmp] operator[SEP]
}
|
public static boolean valueMatchesRegularExpression(String val, String regexp) {
Pattern p = cache.get(regexp);
if(p == null) {
p = Pattern.compile(regexp);
cache.put(regexp, p);
}
return valueMatchesRegularExpression(val, p);
}
|
class class_name[name] begin[{]
method[valueMatchesRegularExpression, return_type[type[boolean]], modifier[public static], parameter[val, regexp]] begin[{]
local_variable[type[Pattern], p]
if[binary_operation[member[.p], ==, literal[null]]] begin[{]
assign[member[.p], call[Pattern.compile, parameter[member[.regexp]]]]
call[cache.put, parameter[member[.regexp], member[.p]]]
else begin[{]
None
end[}]
return[call[.valueMatchesRegularExpression, parameter[member[.val], member[.p]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[valueMatchesRegularExpression] operator[SEP] identifier[String] identifier[val] , identifier[String] identifier[regexp] operator[SEP] {
identifier[Pattern] identifier[p] operator[=] identifier[cache] operator[SEP] identifier[get] operator[SEP] identifier[regexp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[p] operator[==] Other[null] operator[SEP] {
identifier[p] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[regexp] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[regexp] , identifier[p] operator[SEP] operator[SEP]
}
Keyword[return] identifier[valueMatchesRegularExpression] operator[SEP] identifier[val] , identifier[p] operator[SEP] operator[SEP]
}
|
public void addDirection(double extrp, Direction direction)
{
addDirection(extrp, direction.getDirectionHorizontal(), direction.getDirectionVertical());
}
|
class class_name[name] begin[{]
method[addDirection, return_type[void], modifier[public], parameter[extrp, direction]] begin[{]
call[.addDirection, parameter[member[.extrp], call[direction.getDirectionHorizontal, parameter[]], call[direction.getDirectionVertical, parameter[]]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addDirection] operator[SEP] Keyword[double] identifier[extrp] , identifier[Direction] identifier[direction] operator[SEP] {
identifier[addDirection] operator[SEP] identifier[extrp] , identifier[direction] operator[SEP] identifier[getDirectionHorizontal] operator[SEP] operator[SEP] , identifier[direction] operator[SEP] identifier[getDirectionVertical] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings({ "rawtypes", "unchecked" })
@NonNull
public static <T> SingleObserver<? super T> onSubscribe(@NonNull Single<T> source, @NonNull SingleObserver<? super T> observer) {
BiFunction<? super Single, ? super SingleObserver, ? extends SingleObserver> f = onSingleSubscribe;
if (f != null) {
return apply(f, source, observer);
}
return observer;
}
|
class class_name[name] begin[{]
method[onSubscribe, return_type[type[SingleObserver]], modifier[public static], parameter[source, observer]] begin[{]
local_variable[type[BiFunction], f]
if[binary_operation[member[.f], !=, literal[null]]] begin[{]
return[call[.apply, parameter[member[.f], member[.source], member[.observer]]]]
else begin[{]
None
end[}]
return[member[.observer]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] annotation[@] identifier[NonNull] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[SingleObserver] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[onSubscribe] operator[SEP] annotation[@] identifier[NonNull] identifier[Single] operator[<] identifier[T] operator[>] identifier[source] , annotation[@] identifier[NonNull] identifier[SingleObserver] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[observer] operator[SEP] {
identifier[BiFunction] operator[<] operator[?] Keyword[super] identifier[Single] , operator[?] Keyword[super] identifier[SingleObserver] , operator[?] Keyword[extends] identifier[SingleObserver] operator[>] identifier[f] operator[=] identifier[onSingleSubscribe] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[apply] operator[SEP] identifier[f] , identifier[source] , identifier[observer] operator[SEP] operator[SEP]
}
Keyword[return] identifier[observer] operator[SEP]
}
|
@DELETE
@Path("/guid/{guid}/classification/{classificationName}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public void deleteClassification(@PathParam("guid") String guid,
@PathParam("classificationName") final String classificationName) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.deleteClassification(" + guid + "," + classificationName + ")");
}
if (StringUtils.isEmpty(guid)) {
throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid);
}
ensureClassificationType(classificationName);
entitiesStore.deleteClassifications(guid, new ArrayList<String>() {{ add(classificationName);}} );
} finally {
AtlasPerfTracer.log(perf);
}
}
|
class class_name[name] begin[{]
method[deleteClassification, return_type[void], modifier[public], parameter[guid, classificationName]] begin[{]
local_variable[type[AtlasPerfTracer], perf]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=PERF_LOG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPerfTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=AtlasPerfTracer, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=perf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=PERF_LOG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EntityREST.deleteClassification("), operandr=MemberReference(member=guid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=classificationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=getPerfTracer, postfix_operators=[], prefix_operators=[], qualifier=AtlasPerfTracer, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=guid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INSTANCE_GUID_NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=AtlasErrorCode, selectors=[]), MemberReference(member=guid, 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=AtlasBaseException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=classificationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ensureClassificationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=guid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=classificationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=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))], member=deleteClassifications, postfix_operators=[], prefix_operators=[], qualifier=entitiesStore, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=perf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=AtlasPerfTracer, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[DELETE] 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] Keyword[void] identifier[deleteClassification] operator[SEP] annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[guid] , annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[classificationName] operator[SEP] Keyword[throws] identifier[AtlasBaseException] {
identifier[AtlasPerfTracer] identifier[perf] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[AtlasPerfTracer] operator[SEP] identifier[isPerfTraceEnabled] operator[SEP] identifier[PERF_LOG] operator[SEP] operator[SEP] {
identifier[perf] operator[=] identifier[AtlasPerfTracer] operator[SEP] identifier[getPerfTracer] operator[SEP] identifier[PERF_LOG] , literal[String] operator[+] identifier[guid] operator[+] literal[String] operator[+] identifier[classificationName] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[guid] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AtlasBaseException] operator[SEP] identifier[AtlasErrorCode] operator[SEP] identifier[INSTANCE_GUID_NOT_FOUND] , identifier[guid] operator[SEP] operator[SEP]
}
identifier[ensureClassificationType] operator[SEP] identifier[classificationName] operator[SEP] operator[SEP] identifier[entitiesStore] operator[SEP] identifier[deleteClassifications] operator[SEP] identifier[guid] , Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] {
{
identifier[add] operator[SEP] identifier[classificationName] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[AtlasPerfTracer] operator[SEP] identifier[log] operator[SEP] identifier[perf] operator[SEP] operator[SEP]
}
}
|
public int makeFCD(CharSequence s, int src, int limit, ReorderingBuffer buffer) {
// Note: In this function we use buffer->appendZeroCC() because we track
// the lead and trail combining classes here, rather than leaving it to
// the ReorderingBuffer.
// The exception is the call to decomposeShort() which uses the buffer
// in the normal way.
// Tracks the last FCD-safe boundary, before lccc=0 or after properly-ordered tccc<=1.
// Similar to the prevBoundary in the compose() implementation.
int prevBoundary=src;
int prevSrc;
int c=0;
int prevFCD16=0;
int fcd16=0;
for(;;) {
// count code units with lccc==0
for(prevSrc=src; src!=limit;) {
if((c=s.charAt(src))<MIN_CCC_LCCC_CP) {
prevFCD16=~c;
++src;
} else if(!singleLeadMightHaveNonZeroFCD16(c)) {
prevFCD16=0;
++src;
} else {
if(UTF16.isSurrogate((char)c)) {
char c2;
if(UTF16Plus.isSurrogateLead(c)) {
if((src+1)!=limit && Character.isLowSurrogate(c2=s.charAt(src+1))) {
c=Character.toCodePoint((char)c, c2);
}
} else /* trail surrogate */ {
if(prevSrc<src && Character.isHighSurrogate(c2=s.charAt(src-1))) {
--src;
c=Character.toCodePoint(c2, (char)c);
}
}
}
if((fcd16=getFCD16FromNormData(c))<=0xff) {
prevFCD16=fcd16;
src+=Character.charCount(c);
} else {
break;
}
}
}
// copy these code units all at once
if(src!=prevSrc) {
if(src==limit) {
if(buffer!=null) {
buffer.flushAndAppendZeroCC(s, prevSrc, src);
}
break;
}
prevBoundary=src;
// We know that the previous character's lccc==0.
if(prevFCD16<0) {
// Fetching the fcd16 value was deferred for this below-U+0300 code point.
int prev=~prevFCD16;
prevFCD16= prev<0x180 ? tccc180[prev] : getFCD16FromNormData(prev);
if(prevFCD16>1) {
--prevBoundary;
}
} else {
int p=src-1;
if( Character.isLowSurrogate(s.charAt(p)) && prevSrc<p &&
Character.isHighSurrogate(s.charAt(p-1))
) {
--p;
// Need to fetch the previous character's FCD value because
// prevFCD16 was just for the trail surrogate code point.
prevFCD16=getFCD16FromNormData(Character.toCodePoint(s.charAt(p), s.charAt(p+1)));
// Still known to have lccc==0 because its lead surrogate unit had lccc==0.
}
if(prevFCD16>1) {
prevBoundary=p;
}
}
if(buffer!=null) {
// The last lccc==0 character is excluded from the
// flush-and-append call in case it needs to be modified.
buffer.flushAndAppendZeroCC(s, prevSrc, prevBoundary);
buffer.append(s, prevBoundary, src);
}
// The start of the current character (c).
prevSrc=src;
} else if(src==limit) {
break;
}
src+=Character.charCount(c);
// The current character (c) at [prevSrc..src[ has a non-zero lead combining class.
// Check for proper order, and decompose locally if necessary.
if((prevFCD16&0xff)<=(fcd16>>8)) {
// proper order: prev tccc <= current lccc
if((fcd16&0xff)<=1) {
prevBoundary=src;
}
if(buffer!=null) {
buffer.appendZeroCC(c);
}
prevFCD16=fcd16;
continue;
} else if(buffer==null) {
return prevBoundary; // quick check "no"
} else {
/*
* Back out the part of the source that we copied or appended
* already but is now going to be decomposed.
* prevSrc is set to after what was copied/appended.
*/
buffer.removeSuffix(prevSrc-prevBoundary);
/*
* Find the part of the source that needs to be decomposed,
* up to the next safe boundary.
*/
src=findNextFCDBoundary(s, src, limit);
/*
* The source text does not fulfill the conditions for FCD.
* Decompose and reorder a limited piece of the text.
*/
decomposeShort(s, prevBoundary, src, buffer);
prevBoundary=src;
prevFCD16=0;
}
}
return src;
}
|
class class_name[name] begin[{]
method[makeFCD, return_type[type[int]], modifier[public], parameter[s, src, limit, buffer]] begin[{]
local_variable[type[int], prevBoundary]
local_variable[type[int], prevSrc]
local_variable[type[int], c]
local_variable[type[int], prevFCD16]
local_variable[type[int], fcd16]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), operandr=MemberReference(member=MIN_CCC_LCCC_CP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singleLeadMightHaveNonZeroFCD16, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=isSurrogate, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=c2)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSurrogateLead, postfix_operators=[], prefix_operators=[], qualifier=UTF16Plus, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=MethodInvocation(arguments=[Assignment(expressionl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None))], member=isHighSurrogate, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=src, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=toCodePoint, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=MethodInvocation(arguments=[Assignment(expressionl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None))], member=isLowSurrogate, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char)), MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toCodePoint, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None)]))]))])), IfStatement(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFCD16FromNormData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=<=), else_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charCount, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=MemberReference(member=src, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=c, postfix_operators=[], prefix_operators=['~'], qualifier=, selectors=[])), label=None), StatementExpression(expression=MemberReference(member=src, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), init=[Assignment(expressionl=MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=flushAndAppendZeroCC, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=p)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=isLowSurrogate, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=isHighSurrogate, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=p, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=toCodePoint, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)], member=getFCD16FromNormData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=['~'], qualifier=, selectors=[]), name=prev)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x180), operator=<), if_false=MethodInvocation(arguments=[MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFCD16FromNormData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MemberReference(member=tccc180, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=flushAndAppendZeroCC, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charCount, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operator=<=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=prevSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=removeSuffix, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findNextFCDBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decomposeShort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendZeroCC, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevFCD16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ContinueStatement(goto=None, label=None)]))]), control=ForControl(condition=None, init=None, update=None), label=None)
return[member[.src]]
end[}]
END[}]
|
Keyword[public] Keyword[int] identifier[makeFCD] operator[SEP] identifier[CharSequence] identifier[s] , Keyword[int] identifier[src] , Keyword[int] identifier[limit] , identifier[ReorderingBuffer] identifier[buffer] operator[SEP] {
Keyword[int] identifier[prevBoundary] operator[=] identifier[src] operator[SEP] Keyword[int] identifier[prevSrc] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] Keyword[int] identifier[prevFCD16] operator[=] Other[0] operator[SEP] Keyword[int] identifier[fcd16] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[prevSrc] operator[=] identifier[src] operator[SEP] identifier[src] operator[!=] identifier[limit] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[src] operator[SEP] operator[SEP] operator[<] identifier[MIN_CCC_LCCC_CP] operator[SEP] {
identifier[prevFCD16] operator[=] operator[~] identifier[c] operator[SEP] operator[++] identifier[src] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[singleLeadMightHaveNonZeroFCD16] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
identifier[prevFCD16] operator[=] Other[0] operator[SEP] operator[++] identifier[src] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[UTF16] operator[SEP] identifier[isSurrogate] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
Keyword[char] identifier[c2] operator[SEP] Keyword[if] operator[SEP] identifier[UTF16Plus] operator[SEP] identifier[isSurrogateLead] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[src] operator[+] Other[1] operator[SEP] operator[!=] identifier[limit] operator[&&] identifier[Character] operator[SEP] identifier[isLowSurrogate] operator[SEP] identifier[c2] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[src] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] {
identifier[c] operator[=] identifier[Character] operator[SEP] identifier[toCodePoint] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[c] , identifier[c2] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[prevSrc] operator[<] identifier[src] operator[&&] identifier[Character] operator[SEP] identifier[isHighSurrogate] operator[SEP] identifier[c2] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[src] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] {
operator[--] identifier[src] operator[SEP] identifier[c] operator[=] identifier[Character] operator[SEP] identifier[toCodePoint] operator[SEP] identifier[c2] , operator[SEP] Keyword[char] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[fcd16] operator[=] identifier[getFCD16FromNormData] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[<=] literal[Integer] operator[SEP] {
identifier[prevFCD16] operator[=] identifier[fcd16] operator[SEP] identifier[src] operator[+=] identifier[Character] operator[SEP] identifier[charCount] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[break] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[src] operator[!=] identifier[prevSrc] operator[SEP] {
Keyword[if] operator[SEP] identifier[src] operator[==] identifier[limit] operator[SEP] {
Keyword[if] operator[SEP] identifier[buffer] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[flushAndAppendZeroCC] operator[SEP] identifier[s] , identifier[prevSrc] , identifier[src] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
identifier[prevBoundary] operator[=] identifier[src] operator[SEP] Keyword[if] operator[SEP] identifier[prevFCD16] operator[<] Other[0] operator[SEP] {
Keyword[int] identifier[prev] operator[=] operator[~] identifier[prevFCD16] operator[SEP] identifier[prevFCD16] operator[=] identifier[prev] operator[<] literal[Integer] operator[?] identifier[tccc180] operator[SEP] identifier[prev] operator[SEP] operator[:] identifier[getFCD16FromNormData] operator[SEP] identifier[prev] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prevFCD16] operator[>] Other[1] operator[SEP] {
operator[--] identifier[prevBoundary] operator[SEP]
}
}
Keyword[else] {
Keyword[int] identifier[p] operator[=] identifier[src] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isLowSurrogate] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[p] operator[SEP] operator[SEP] operator[&&] identifier[prevSrc] operator[<] identifier[p] operator[&&] identifier[Character] operator[SEP] identifier[isHighSurrogate] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[p] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] {
operator[--] identifier[p] operator[SEP] identifier[prevFCD16] operator[=] identifier[getFCD16FromNormData] operator[SEP] identifier[Character] operator[SEP] identifier[toCodePoint] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[p] operator[SEP] , identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[p] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[prevFCD16] operator[>] Other[1] operator[SEP] {
identifier[prevBoundary] operator[=] identifier[p] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[buffer] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[flushAndAppendZeroCC] operator[SEP] identifier[s] , identifier[prevSrc] , identifier[prevBoundary] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[s] , identifier[prevBoundary] , identifier[src] operator[SEP] operator[SEP]
}
identifier[prevSrc] operator[=] identifier[src] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[src] operator[==] identifier[limit] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[src] operator[+=] identifier[Character] operator[SEP] identifier[charCount] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[prevFCD16] operator[&] literal[Integer] operator[SEP] operator[<=] operator[SEP] identifier[fcd16] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[fcd16] operator[&] literal[Integer] operator[SEP] operator[<=] Other[1] operator[SEP] {
identifier[prevBoundary] operator[=] identifier[src] operator[SEP]
}
Keyword[if] operator[SEP] identifier[buffer] operator[!=] Other[null] operator[SEP] {
identifier[buffer] operator[SEP] identifier[appendZeroCC] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
identifier[prevFCD16] operator[=] identifier[fcd16] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[buffer] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[prevBoundary] operator[SEP]
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[removeSuffix] operator[SEP] identifier[prevSrc] operator[-] identifier[prevBoundary] operator[SEP] operator[SEP] identifier[src] operator[=] identifier[findNextFCDBoundary] operator[SEP] identifier[s] , identifier[src] , identifier[limit] operator[SEP] operator[SEP] identifier[decomposeShort] operator[SEP] identifier[s] , identifier[prevBoundary] , identifier[src] , identifier[buffer] operator[SEP] operator[SEP] identifier[prevBoundary] operator[=] identifier[src] operator[SEP] identifier[prevFCD16] operator[=] Other[0] operator[SEP]
}
}
Keyword[return] identifier[src] operator[SEP]
}
|
public Instance getInstance(String src, int j) {
return (Instance)((ArrayList)sourceLists.get(src)).get(j);
}
|
class class_name[name] begin[{]
method[getInstance, return_type[type[Instance]], modifier[public], parameter[src, j]] begin[{]
return[Cast(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=sourceLists, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ArrayList, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Instance, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[Instance] identifier[getInstance] operator[SEP] identifier[String] identifier[src] , Keyword[int] identifier[j] operator[SEP] {
Keyword[return] operator[SEP] identifier[Instance] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[SEP] identifier[sourceLists] operator[SEP] identifier[get] operator[SEP] identifier[src] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP]
}
|
public Created setCreated(Date created) {
Created prop = (created == null) ? null : new Created(created);
setCreated(prop);
return prop;
}
|
class class_name[name] begin[{]
method[setCreated, return_type[type[Created]], modifier[public], parameter[created]] begin[{]
local_variable[type[Created], prop]
call[.setCreated, parameter[member[.prop]]]
return[member[.prop]]
end[}]
END[}]
|
Keyword[public] identifier[Created] identifier[setCreated] operator[SEP] identifier[Date] identifier[created] operator[SEP] {
identifier[Created] identifier[prop] operator[=] operator[SEP] identifier[created] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[Created] operator[SEP] identifier[created] operator[SEP] operator[SEP] identifier[setCreated] operator[SEP] identifier[prop] operator[SEP] operator[SEP] Keyword[return] identifier[prop] operator[SEP]
}
|
@Override
public T addAsManifestResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException {
Validate.notNull(resourcePackage, "ResourcePackage must be specified");
Validate.notNullAndNoNullValues(resourceNames,
"ResourceNames must be specified and can not container null values");
for (String resourceName : resourceNames) {
addAsManifestResource(resourcePackage, resourceName);
}
return covarientReturn();
}
|
class class_name[name] begin[{]
method[addAsManifestResources, return_type[type[T]], modifier[public], parameter[resourcePackage, resourceNames]] begin[{]
call[Validate.notNull, parameter[member[.resourcePackage], literal["ResourcePackage must be specified"]]]
call[Validate.notNullAndNoNullValues, parameter[member[.resourceNames], literal["ResourceNames must be specified and can not container null values"]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourcePackage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAsManifestResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resourceNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resourceName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[call[.covarientReturn, parameter[]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[addAsManifestResources] operator[SEP] identifier[Package] identifier[resourcePackage] , identifier[String] operator[...] identifier[resourceNames] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[resourcePackage] , literal[String] operator[SEP] operator[SEP] identifier[Validate] operator[SEP] identifier[notNullAndNoNullValues] operator[SEP] identifier[resourceNames] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[resourceName] operator[:] identifier[resourceNames] operator[SEP] {
identifier[addAsManifestResource] operator[SEP] identifier[resourcePackage] , identifier[resourceName] operator[SEP] operator[SEP]
}
Keyword[return] identifier[covarientReturn] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <E> List<Class<? extends E>>
filterSkipped(InvocationContext context, List<Class<? extends E>> components) {
Method request = context.getRequest();
if(!request.isAnnotationPresent(Skip.class)) {
return components;
}
List<Class<?>> skippedComponents = Arrays.asList(request.getAnnotation(Skip.class).value());
List<Class<? extends E>> filteredComponents = new ArrayList<Class<? extends E>>();
for (Class<? extends E> component : components) {
if(!skippedComponents.contains(component)) {
filteredComponents.add(component);
}
}
return filteredComponents;
}
|
class class_name[name] begin[{]
method[filterSkipped, return_type[type[List]], modifier[public static], parameter[context, components]] begin[{]
local_variable[type[Method], request]
if[call[request.isAnnotationPresent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Skip, sub_type=None))]]] begin[{]
return[member[.components]]
else begin[{]
None
end[}]
local_variable[type[List], skippedComponents]
local_variable[type[List], filteredComponents]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=skippedComponents, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=filteredComponents, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=components, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=component)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None)
return[member[.filteredComponents]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[List] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] operator[>] identifier[filterSkipped] operator[SEP] identifier[InvocationContext] identifier[context] , identifier[List] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] operator[>] identifier[components] operator[SEP] {
identifier[Method] identifier[request] operator[=] identifier[context] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[request] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Skip] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] identifier[components] operator[SEP]
}
identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[skippedComponents] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[request] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Skip] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] operator[>] identifier[filteredComponents] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] identifier[component] operator[:] identifier[components] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[skippedComponents] operator[SEP] identifier[contains] operator[SEP] identifier[component] operator[SEP] operator[SEP] {
identifier[filteredComponents] operator[SEP] identifier[add] operator[SEP] identifier[component] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[filteredComponents] operator[SEP]
}
|
public Locale getMainLocale(String rootPath) {
CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(rootPath);
if (site == null) {
return null;
}
return site.getMainTranslationLocale(null);
}
|
class class_name[name] begin[{]
method[getMainLocale, return_type[type[Locale]], modifier[public], parameter[rootPath]] begin[{]
local_variable[type[CmsSite], site]
if[binary_operation[member[.site], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[site.getMainTranslationLocale, parameter[literal[null]]]]
end[}]
END[}]
|
Keyword[public] identifier[Locale] identifier[getMainLocale] operator[SEP] identifier[String] identifier[rootPath] operator[SEP] {
identifier[CmsSite] identifier[site] operator[=] identifier[OpenCms] operator[SEP] identifier[getSiteManager] operator[SEP] operator[SEP] operator[SEP] identifier[getSiteForRootPath] operator[SEP] identifier[rootPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[site] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] identifier[site] operator[SEP] identifier[getMainTranslationLocale] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
|
public void setFontAwesomeIcon(@FontAwesome.Icon CharSequence iconCode) {
setBootstrapText(new BootstrapText.Builder(getContext(), isInEditMode()).addFontAwesomeIcon(iconCode).build());
}
|
class class_name[name] begin[{]
method[setFontAwesomeIcon, return_type[void], modifier[public], parameter[iconCode]] begin[{]
call[.setBootstrapText, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isInEditMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=iconCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFontAwesomeIcon, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BootstrapText, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setFontAwesomeIcon] operator[SEP] annotation[@] identifier[FontAwesome] operator[SEP] identifier[Icon] identifier[CharSequence] identifier[iconCode] operator[SEP] {
identifier[setBootstrapText] operator[SEP] Keyword[new] identifier[BootstrapText] operator[SEP] identifier[Builder] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[isInEditMode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addFontAwesomeIcon] operator[SEP] identifier[iconCode] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("rawtypes")
public void unsetReplicationClassLoader(Fqn regionFqn, ClassLoader classLoader) {
if (!isLocalMode()) {
final Region region = jBossCache.getRegion(regionFqn, true);
if (region != null) {
if (region.isActive()) {
region.deactivate();
}
region.unregisterContextClassLoader();
jBossCache.removeRegion(regionFqn);
}
}
}
|
class class_name[name] begin[{]
method[unsetReplicationClassLoader, return_type[void], modifier[public], parameter[regionFqn, classLoader]] begin[{]
if[call[.isLocalMode, parameter[]]] begin[{]
local_variable[type[Region], region]
if[binary_operation[member[.region], !=, literal[null]]] begin[{]
if[call[region.isActive, parameter[]]] begin[{]
call[region.deactivate, parameter[]]
else begin[{]
None
end[}]
call[region.unregisterContextClassLoader, parameter[]]
call[jBossCache.removeRegion, parameter[member[.regionFqn]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[unsetReplicationClassLoader] operator[SEP] identifier[Fqn] identifier[regionFqn] , identifier[ClassLoader] identifier[classLoader] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isLocalMode] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[Region] identifier[region] operator[=] identifier[jBossCache] operator[SEP] identifier[getRegion] operator[SEP] identifier[regionFqn] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[region] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[region] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] {
identifier[region] operator[SEP] identifier[deactivate] operator[SEP] operator[SEP] operator[SEP]
}
identifier[region] operator[SEP] identifier[unregisterContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[jBossCache] operator[SEP] identifier[removeRegion] operator[SEP] identifier[regionFqn] operator[SEP] operator[SEP]
}
}
}
|
private static String generateTempServerName() {
String serverName = TEMP_SERVER_NAME;
while (InstallUtils.serverExists(serverName)) {
int randomNumber = random.nextInt();
while (randomNumber == Integer.MIN_VALUE) {
randomNumber = random.nextInt();
}
serverName = TEMP_SERVER_NAME + "_" + Integer.toString(Math.abs(randomNumber));
}
return serverName;
}
|
class class_name[name] begin[{]
method[generateTempServerName, return_type[type[String]], modifier[private static], parameter[]] begin[{]
local_variable[type[String], serverName]
while[call[InstallUtils.serverExists, parameter[member[.serverName]]]] begin[{]
local_variable[type[int], randomNumber]
while[binary_operation[member[.randomNumber], ==, member[Integer.MIN_VALUE]]] begin[{]
assign[member[.randomNumber], call[random.nextInt, parameter[]]]
end[}]
assign[member[.serverName], binary_operation[binary_operation[member[.TEMP_SERVER_NAME], +, literal["_"]], +, call[Integer.toString, parameter[call[Math.abs, parameter[member[.randomNumber]]]]]]]
end[}]
return[member[.serverName]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[String] identifier[generateTempServerName] operator[SEP] operator[SEP] {
identifier[String] identifier[serverName] operator[=] identifier[TEMP_SERVER_NAME] operator[SEP] Keyword[while] operator[SEP] identifier[InstallUtils] operator[SEP] identifier[serverExists] operator[SEP] identifier[serverName] operator[SEP] operator[SEP] {
Keyword[int] identifier[randomNumber] operator[=] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[randomNumber] operator[==] identifier[Integer] operator[SEP] identifier[MIN_VALUE] operator[SEP] {
identifier[randomNumber] operator[=] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP]
}
identifier[serverName] operator[=] identifier[TEMP_SERVER_NAME] operator[+] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[randomNumber] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[serverName] operator[SEP]
}
|
public boolean isEquivalent(final Plugin testPlugin) {
return (repository == testPlugin.getLoggerRepository())
&& ((this.name == null && testPlugin.getName() == null)
|| (this.name != null
&& name.equals(testPlugin.getName())))
&& this.getClass().equals(testPlugin.getClass());
}
|
class class_name[name] begin[{]
method[isEquivalent, return_type[type[boolean]], modifier[public], parameter[testPlugin]] begin[{]
return[binary_operation[binary_operation[binary_operation[member[.repository], ==, call[testPlugin.getLoggerRepository, parameter[]]], &&, binary_operation[binary_operation[binary_operation[THIS[member[None.name]], ==, literal[null]], &&, binary_operation[call[testPlugin.getName, parameter[]], ==, literal[null]]], ||, binary_operation[binary_operation[THIS[member[None.name]], !=, literal[null]], &&, call[name.equals, parameter[call[testPlugin.getName, parameter[]]]]]]], &&, THIS[call[None.getClass, parameter[]]call[None.equals, parameter[call[testPlugin.getClass, parameter[]]]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[isEquivalent] operator[SEP] Keyword[final] identifier[Plugin] identifier[testPlugin] operator[SEP] {
Keyword[return] operator[SEP] identifier[repository] operator[==] identifier[testPlugin] operator[SEP] identifier[getLoggerRepository] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[name] operator[==] Other[null] operator[&&] identifier[testPlugin] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] Keyword[this] operator[SEP] identifier[name] operator[!=] Other[null] operator[&&] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[testPlugin] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[&&] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[testPlugin] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized void moveCursor(Entry newEntry)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveCursor", new Object[] { newEntry });
checkEntryParent();
//if the entry is the same as the current one
//then we don't need to bother doing anything
if(newEntry != current)
{
//make sure we can find the new entry in this list
if(newEntry != null && newEntry.parentList == parentList)
{
LinkedList list = parentList;
synchronized(list)
{
//remove the cursor from it's current postion
forceRemove();
//insert this cursor before the first on for the new entry
next = newEntry.firstCursor;
if(next != null) next.previous = this;
newEntry.firstCursor = this;
previous = null;
parentList = list;
current = newEntry;
}
}
else //if the new entry is not in this list, throw a runtime exception
{
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
"1:457:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor",
"1:463:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor", e);
throw e;
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor");
}
|
class class_name[name] begin[{]
method[moveCursor, return_type[void], modifier[synchronized public], parameter[newEntry]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["moveCursor"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=newEntry, 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[}]
call[.checkEntryParent, parameter[]]
if[binary_operation[member[.newEntry], !=, member[.current]]] begin[{]
if[binary_operation[binary_operation[member[.newEntry], !=, literal[null]], &&, binary_operation[member[newEntry.parentList], ==, member[.parentList]]]] begin[{]
local_variable[type[LinkedList], list]
SYNCHRONIZED[member[.list]] BEGIN[{]
call[.forceRemove, parameter[]]
assign[member[.next], member[newEntry.firstCursor]]
if[binary_operation[member[.next], !=, literal[null]]] begin[{]
assign[member[next.previous], THIS[]]
else begin[{]
None
end[}]
assign[member[newEntry.firstCursor], THIS[]]
assign[member[.previous], literal[null]]
assign[member[.parentList], member[.list]]
assign[member[.current], member[.newEntry]]
END[}]
else begin[{]
local_variable[type[SIErrorException], e]
call[FFDCFilter.processException, parameter[member[.e], literal["com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor"], literal["1:463:1.15"], THIS[]]]
call[SibTr.exception, parameter[member[.tc], member[.e]]]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["moveCursor"], member[.e]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
else begin[{]
None
end[}]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["moveCursor"]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[synchronized] Keyword[void] identifier[moveCursor] operator[SEP] identifier[Entry] identifier[newEntry] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[newEntry]
} operator[SEP] operator[SEP] identifier[checkEntryParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newEntry] operator[!=] identifier[current] operator[SEP] {
Keyword[if] operator[SEP] identifier[newEntry] operator[!=] Other[null] operator[&&] identifier[newEntry] operator[SEP] identifier[parentList] operator[==] identifier[parentList] operator[SEP] {
identifier[LinkedList] identifier[list] operator[=] identifier[parentList] operator[SEP] Keyword[synchronized] operator[SEP] identifier[list] operator[SEP] {
identifier[forceRemove] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[=] identifier[newEntry] operator[SEP] identifier[firstCursor] operator[SEP] Keyword[if] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] identifier[next] operator[SEP] identifier[previous] operator[=] Keyword[this] operator[SEP] identifier[newEntry] operator[SEP] identifier[firstCursor] operator[=] Keyword[this] operator[SEP] identifier[previous] operator[=] Other[null] operator[SEP] identifier[parentList] operator[=] identifier[list] operator[SEP] identifier[current] operator[=] identifier[newEntry] operator[SEP]
}
}
Keyword[else] {
identifier[SIErrorException] identifier[e] operator[=] 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]
} , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
@Override
public void cacheResult(CPRule cpRule) {
entityCache.putResult(CPRuleModelImpl.ENTITY_CACHE_ENABLED,
CPRuleImpl.class, cpRule.getPrimaryKey(), cpRule);
cpRule.resetOriginalValues();
}
|
class class_name[name] begin[{]
method[cacheResult, return_type[void], modifier[public], parameter[cpRule]] begin[{]
call[entityCache.putResult, parameter[member[CPRuleModelImpl.ENTITY_CACHE_ENABLED], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CPRuleImpl, sub_type=None)), call[cpRule.getPrimaryKey, parameter[]], member[.cpRule]]]
call[cpRule.resetOriginalValues, parameter[]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[cacheResult] operator[SEP] identifier[CPRule] identifier[cpRule] operator[SEP] {
identifier[entityCache] operator[SEP] identifier[putResult] operator[SEP] identifier[CPRuleModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CPRuleImpl] operator[SEP] Keyword[class] , identifier[cpRule] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] , identifier[cpRule] operator[SEP] operator[SEP] identifier[cpRule] operator[SEP] identifier[resetOriginalValues] operator[SEP] operator[SEP] operator[SEP]
}
|
public PublicationsHandlerBuilder setPublicationsFilePkiTrustStore(File file, String password) throws KSIException {
this.trustStore = Util.loadKeyStore(file, password);
return this;
}
|
class class_name[name] begin[{]
method[setPublicationsFilePkiTrustStore, return_type[type[PublicationsHandlerBuilder]], modifier[public], parameter[file, password]] begin[{]
assign[THIS[member[None.trustStore]], call[Util.loadKeyStore, parameter[member[.file], member[.password]]]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[PublicationsHandlerBuilder] identifier[setPublicationsFilePkiTrustStore] operator[SEP] identifier[File] identifier[file] , identifier[String] identifier[password] operator[SEP] Keyword[throws] identifier[KSIException] {
Keyword[this] operator[SEP] identifier[trustStore] operator[=] identifier[Util] operator[SEP] identifier[loadKeyStore] operator[SEP] identifier[file] , identifier[password] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public Set<CurrencyUnit> getCurrencies(String... providers) {
return getCurrencies(CurrencyQueryBuilder.of().setProviderNames(providers).build());
}
|
class class_name[name] begin[{]
method[getCurrencies, return_type[type[Set]], modifier[public], parameter[providers]] begin[{]
return[call[.getCurrencies, parameter[call[CurrencyQueryBuilder.of, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] identifier[Set] operator[<] identifier[CurrencyUnit] operator[>] identifier[getCurrencies] operator[SEP] identifier[String] operator[...] identifier[providers] operator[SEP] {
Keyword[return] identifier[getCurrencies] operator[SEP] identifier[CurrencyQueryBuilder] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] identifier[setProviderNames] operator[SEP] identifier[providers] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static boolean isValidKillSessionsToken(String token) {
if (token == null || token.isEmpty()) {
return false;
}
for (String validToken:VALID_TOKENS) {
if (token.equals (validToken)) {
return true;
}
}
return false;
}
|
class class_name[name] begin[{]
method[isValidKillSessionsToken, return_type[type[boolean]], modifier[public static], parameter[token]] begin[{]
if[binary_operation[binary_operation[member[.token], ==, literal[null]], ||, call[token.isEmpty, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=validToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=VALID_TOKENS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=validToken)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[false]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[isValidKillSessionsToken] operator[SEP] identifier[String] identifier[token] operator[SEP] {
Keyword[if] operator[SEP] identifier[token] operator[==] Other[null] operator[||] identifier[token] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[validToken] operator[:] identifier[VALID_TOKENS] operator[SEP] {
Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[equals] operator[SEP] identifier[validToken] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static IFileCompareResultBean simpleCompareFiles(final File sourceFile,
final File fileToCompare)
{
return compareFiles(sourceFile, fileToCompare, true, false, false, true, false);
}
|
class class_name[name] begin[{]
method[simpleCompareFiles, return_type[type[IFileCompareResultBean]], modifier[public static], parameter[sourceFile, fileToCompare]] begin[{]
return[call[.compareFiles, parameter[member[.sourceFile], member[.fileToCompare], literal[true], literal[false], literal[false], literal[true], literal[false]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[IFileCompareResultBean] identifier[simpleCompareFiles] operator[SEP] Keyword[final] identifier[File] identifier[sourceFile] , Keyword[final] identifier[File] identifier[fileToCompare] operator[SEP] {
Keyword[return] identifier[compareFiles] operator[SEP] identifier[sourceFile] , identifier[fileToCompare] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
|
static Class getMostDerivedInterface(Class controlIntf)
{
while (controlIntf.isAnnotationPresent(ControlExtension.class))
{
Class [] intfs = controlIntf.getInterfaces();
boolean found = false;
for (int i = 0; i < intfs.length; i++)
{
if (intfs[i].isAnnotationPresent(ControlExtension.class) ||
intfs[i].isAnnotationPresent(ControlInterface.class))
{
controlIntf = intfs[i];
found = true;
break;
}
}
if (!found)
{
throw new ControlException("Can't find base control interface for " + controlIntf);
}
}
return controlIntf;
}
|
class class_name[name] begin[{]
method[getMostDerivedInterface, return_type[type[Class]], modifier[static], parameter[controlIntf]] begin[{]
while[call[controlIntf.isAnnotationPresent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ControlExtension, sub_type=None))]]] begin[{]
local_variable[type[Class], intfs]
local_variable[type[boolean], found]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=intfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ControlExtension, sub_type=None))], member=isAnnotationPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MemberReference(member=intfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ControlInterface, sub_type=None))], member=isAnnotationPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=controlIntf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=intfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=intfs, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[.found]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't find base control interface for "), operandr=MemberReference(member=controlIntf, 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=ControlException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
return[member[.controlIntf]]
end[}]
END[}]
|
Keyword[static] identifier[Class] identifier[getMostDerivedInterface] operator[SEP] identifier[Class] identifier[controlIntf] operator[SEP] {
Keyword[while] operator[SEP] identifier[controlIntf] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[ControlExtension] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[Class] operator[SEP] operator[SEP] identifier[intfs] operator[=] identifier[controlIntf] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[intfs] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[intfs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[ControlExtension] operator[SEP] Keyword[class] operator[SEP] operator[||] identifier[intfs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[ControlInterface] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[controlIntf] operator[=] identifier[intfs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ControlException] operator[SEP] literal[String] operator[+] identifier[controlIntf] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[controlIntf] operator[SEP]
}
|
private Variable getVariableAtNode(int index, CallStack callstack) throws UtilEvalError {
Node nameNode = null;
if (jjtGetChild(index).jjtGetNumChildren() > 0
&& (nameNode = jjtGetChild(index).jjtGetChild(0))
instanceof BSHAmbiguousName)
return callstack.top().getVariableImpl(
((BSHAmbiguousName) nameNode).text, true);
return null;
}
|
class class_name[name] begin[{]
method[getVariableAtNode, return_type[type[Variable]], modifier[private], parameter[index, callstack]] begin[{]
local_variable[type[Node], nameNode]
if[binary_operation[binary_operation[call[.jjtGetChild, parameter[member[.index]]], >, literal[0]], &&, binary_operation[assign[member[.nameNode], call[.jjtGetChild, parameter[member[.index]]]], instanceof, type[BSHAmbiguousName]]]] begin[{]
return[call[callstack.top, parameter[]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[private] identifier[Variable] identifier[getVariableAtNode] operator[SEP] Keyword[int] identifier[index] , identifier[CallStack] identifier[callstack] operator[SEP] Keyword[throws] identifier[UtilEvalError] {
identifier[Node] identifier[nameNode] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[jjtGetChild] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[jjtGetNumChildren] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[SEP] identifier[nameNode] operator[=] identifier[jjtGetChild] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[jjtGetChild] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[instanceof] identifier[BSHAmbiguousName] operator[SEP] Keyword[return] identifier[callstack] operator[SEP] identifier[top] operator[SEP] operator[SEP] operator[SEP] identifier[getVariableImpl] operator[SEP] operator[SEP] operator[SEP] identifier[BSHAmbiguousName] operator[SEP] identifier[nameNode] operator[SEP] operator[SEP] identifier[text] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static JSONObject parseObject(InputStream is, String csName) throws IOException {
return (JSONObject)parse(is, csName);
}
|
class class_name[name] begin[{]
method[parseObject, return_type[type[JSONObject]], modifier[public static], parameter[is, csName]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=csName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[JSONObject] identifier[parseObject] operator[SEP] identifier[InputStream] identifier[is] , identifier[String] identifier[csName] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] operator[SEP] identifier[JSONObject] operator[SEP] identifier[parse] operator[SEP] identifier[is] , identifier[csName] operator[SEP] operator[SEP]
}
|
public void addCluster() {
System.out.printf("%nAdding cluster: %s to instance: %s%n", CLUSTER, instanceId);
// [START bigtable_create_cluster]
try {
adminClient.createCluster(
CreateClusterRequest.of(instanceId, CLUSTER)
.setZone("us-central1-c")
.setServeNodes(3)
.setStorageType(StorageType.SSD));
System.out.printf("Cluster: %s created successfully%n", CLUSTER);
} catch (AlreadyExistsException e) {
System.err.println("Failed to add cluster, already exists: " + e.getMessage());
}
// [END bigtable_create_cluster]
}
|
class class_name[name] begin[{]
method[addCluster, return_type[void], modifier[public], parameter[]] begin[{]
call[System.out.printf, parameter[literal["%nAdding cluster: %s to instance: %s%n"], member[.CLUSTER], member[.instanceId]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=instanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CLUSTER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=CreateClusterRequest, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="us-central1-c")], member=setZone, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=setServeNodes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=SSD, postfix_operators=[], prefix_operators=[], qualifier=StorageType, selectors=[])], member=setStorageType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=createCluster, postfix_operators=[], prefix_operators=[], qualifier=adminClient, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cluster: %s created successfully%n"), MemberReference(member=CLUSTER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to add cluster, already exists: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AlreadyExistsException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addCluster] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[CLUSTER] , identifier[instanceId] operator[SEP] operator[SEP] Keyword[try] {
identifier[adminClient] operator[SEP] identifier[createCluster] operator[SEP] identifier[CreateClusterRequest] operator[SEP] identifier[of] operator[SEP] identifier[instanceId] , identifier[CLUSTER] operator[SEP] operator[SEP] identifier[setZone] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[setServeNodes] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[setStorageType] operator[SEP] identifier[StorageType] operator[SEP] identifier[SSD] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[CLUSTER] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[AlreadyExistsException] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void getField(String[] names) throws Exception {
final CodeEmitter e = begin_method(Constants.ACC_PUBLIC, PROVIDER_GET, null);
e.load_this();
e.load_arg(0);
EmitUtils.string_switch(e, names, Constants.SWITCH_STYLE_HASH, new ObjectSwitchCallback() {
public void processCase(Object key, Label end) {
Type type = (Type)fields.get(key);
e.getfield((String)key);
e.box(type);
e.return_value();
}
public void processDefault() {
e.throw_exception(ILLEGAL_ARGUMENT_EXCEPTION, "Unknown field name");
}
});
e.end_method();
}
|
class class_name[name] begin[{]
method[getField, return_type[void], modifier[private], parameter[names]] begin[{]
local_variable[type[CodeEmitter], e]
call[e.load_this, parameter[]]
call[e.load_arg, parameter[literal[0]]]
call[EmitUtils.string_switch, parameter[member[.e], member[.names], member[Constants.SWITCH_STYLE_HASH], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=getfield, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=box, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=return_value, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=processCase, parameters=[FormalParameter(annotations=[], modifiers=set(), name=key, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=end, type=ReferenceType(arguments=None, dimensions=[], name=Label, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ILLEGAL_ARGUMENT_EXCEPTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown field name")], member=throw_exception, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=processDefault, 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=ObjectSwitchCallback, sub_type=None))]]
call[e.end_method, parameter[]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[getField] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[names] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[final] identifier[CodeEmitter] identifier[e] operator[=] identifier[begin_method] operator[SEP] identifier[Constants] operator[SEP] identifier[ACC_PUBLIC] , identifier[PROVIDER_GET] , Other[null] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[load_this] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[load_arg] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[EmitUtils] operator[SEP] identifier[string_switch] operator[SEP] identifier[e] , identifier[names] , identifier[Constants] operator[SEP] identifier[SWITCH_STYLE_HASH] , Keyword[new] identifier[ObjectSwitchCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[processCase] operator[SEP] identifier[Object] identifier[key] , identifier[Label] identifier[end] operator[SEP] {
identifier[Type] identifier[type] operator[=] operator[SEP] identifier[Type] operator[SEP] identifier[fields] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[getfield] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[box] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[return_value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[processDefault] operator[SEP] operator[SEP] {
identifier[e] operator[SEP] identifier[throw_exception] operator[SEP] identifier[ILLEGAL_ARGUMENT_EXCEPTION] , literal[String] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[end_method] operator[SEP] operator[SEP] operator[SEP]
}
|
public ListEnabledProductsForImportResult withProductSubscriptions(String... productSubscriptions) {
if (this.productSubscriptions == null) {
setProductSubscriptions(new java.util.ArrayList<String>(productSubscriptions.length));
}
for (String ele : productSubscriptions) {
this.productSubscriptions.add(ele);
}
return this;
}
|
class class_name[name] begin[{]
method[withProductSubscriptions, return_type[type[ListEnabledProductsForImportResult]], modifier[public], parameter[productSubscriptions]] begin[{]
if[binary_operation[THIS[member[None.productSubscriptions]], ==, literal[null]]] begin[{]
call[.setProductSubscriptions, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=productSubscriptions, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=productSubscriptions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=productSubscriptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[ListEnabledProductsForImportResult] identifier[withProductSubscriptions] operator[SEP] identifier[String] operator[...] identifier[productSubscriptions] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[productSubscriptions] operator[==] Other[null] operator[SEP] {
identifier[setProductSubscriptions] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[productSubscriptions] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[productSubscriptions] operator[SEP] {
Keyword[this] operator[SEP] identifier[productSubscriptions] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private void generatePostamble(Node.Nodes page) {
out.popIndent();
out.printil("} catch (Throwable t) {");
out.pushIndent();
out.printil(
"if (!(t instanceof SkipPageException)){");
out.pushIndent();
out.printil("out = _jspx_out;");
out.printil("if (out != null && out.getBufferSize() != 0)");
out.pushIndent();
out.printil("out.clearBuffer();");
out.popIndent();
out.printil(
"if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);");
out.printil("else throw new ServletException(t);");
out.popIndent();
out.printil("}");
out.popIndent();
out.printil("} finally {");
out.pushIndent();
out.printil(
"_jspxFactory.releasePageContext(_jspx_page_context);");
out.popIndent();
out.printil("}");
// Close the service method
out.popIndent();
out.printil("}");
// Generated methods, helper classes, etc.
genCommonPostamble();
}
|
class class_name[name] begin[{]
method[generatePostamble, return_type[void], modifier[private], parameter[page]] begin[{]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["} catch (Throwable t) {"]]]
call[out.pushIndent, parameter[]]
call[out.printil, parameter[literal["if (!(t instanceof SkipPageException)){"]]]
call[out.pushIndent, parameter[]]
call[out.printil, parameter[literal["out = _jspx_out;"]]]
call[out.printil, parameter[literal["if (out != null && out.getBufferSize() != 0)"]]]
call[out.pushIndent, parameter[]]
call[out.printil, parameter[literal["out.clearBuffer();"]]]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);"]]]
call[out.printil, parameter[literal["else throw new ServletException(t);"]]]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["}"]]]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["} finally {"]]]
call[out.pushIndent, parameter[]]
call[out.printil, parameter[literal["_jspxFactory.releasePageContext(_jspx_page_context);"]]]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["}"]]]
call[out.popIndent, parameter[]]
call[out.printil, parameter[literal["}"]]]
call[.genCommonPostamble, parameter[]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[generatePostamble] operator[SEP] identifier[Node] operator[SEP] identifier[Nodes] identifier[page] operator[SEP] {
identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[pushIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[pushIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[pushIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[pushIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[popIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[printil] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[genCommonPostamble] operator[SEP] operator[SEP] operator[SEP]
}
|
public Observable<ServiceResponse<String>> beginGeneratevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (virtualNetworkGatewayName == null) {
throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
final String apiVersion = "2018-06-01";
return service.beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<String>>>() {
@Override
public Observable<ServiceResponse<String>> call(Response<ResponseBody> response) {
try {
ServiceResponse<String> clientResponse = beginGeneratevpnclientpackageDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
|
class class_name[name] begin[{]
method[beginGeneratevpnclientpackageWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, virtualNetworkGatewayName, parameters]] begin[{]
if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.virtualNetworkGatewayName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter virtualNetworkGatewayName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.parameters], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[Validator.validate, parameter[member[.parameters]]]
local_variable[type[String], apiVersion]
return[call[service.beginGeneratevpnclientpackage, parameter[member[.resourceGroupName], member[.virtualNetworkGatewayName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.parameters], member[.apiVersion], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[String] operator[>] operator[>] identifier[beginGeneratevpnclientpackageWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[virtualNetworkGatewayName] , identifier[VpnClientParameters] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[virtualNetworkGatewayName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[apiVersion] operator[=] literal[String] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[beginGeneratevpnclientpackage] operator[SEP] identifier[resourceGroupName] , identifier[virtualNetworkGatewayName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[parameters] , identifier[apiVersion] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[String] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[String] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] {
Keyword[try] {
identifier[ServiceResponse] operator[<] identifier[String] operator[>] identifier[clientResponse] operator[=] identifier[beginGeneratevpnclientpackageDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
static public TypedPropertyDescriptor buildScriptablePropertyDescriptor(
String propertyName, Class beanClass, String getterName, String setterName )
{
TypedPropertyDescriptor pd = _buildPropertyDescriptor( propertyName, beanClass, getterName, setterName );
makeScriptable( pd );
return pd;
}
|
class class_name[name] begin[{]
method[buildScriptablePropertyDescriptor, return_type[type[TypedPropertyDescriptor]], modifier[public static], parameter[propertyName, beanClass, getterName, setterName]] begin[{]
local_variable[type[TypedPropertyDescriptor], pd]
call[.makeScriptable, parameter[member[.pd]]]
return[member[.pd]]
end[}]
END[}]
|
Keyword[static] Keyword[public] identifier[TypedPropertyDescriptor] identifier[buildScriptablePropertyDescriptor] operator[SEP] identifier[String] identifier[propertyName] , identifier[Class] identifier[beanClass] , identifier[String] identifier[getterName] , identifier[String] identifier[setterName] operator[SEP] {
identifier[TypedPropertyDescriptor] identifier[pd] operator[=] identifier[_buildPropertyDescriptor] operator[SEP] identifier[propertyName] , identifier[beanClass] , identifier[getterName] , identifier[setterName] operator[SEP] operator[SEP] identifier[makeScriptable] operator[SEP] identifier[pd] operator[SEP] operator[SEP] Keyword[return] identifier[pd] operator[SEP]
}
|
public String forProcessInstance(String alias, long processInstanceId) {
return registry.getContainerId(alias, new ByProcessInstanceIdContainerLocator(processInstanceId));
}
|
class class_name[name] begin[{]
method[forProcessInstance, return_type[type[String]], modifier[public], parameter[alias, processInstanceId]] begin[{]
return[call[registry.getContainerId, parameter[member[.alias], ClassCreator(arguments=[MemberReference(member=processInstanceId, 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=ByProcessInstanceIdContainerLocator, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[forProcessInstance] operator[SEP] identifier[String] identifier[alias] , Keyword[long] identifier[processInstanceId] operator[SEP] {
Keyword[return] identifier[registry] operator[SEP] identifier[getContainerId] operator[SEP] identifier[alias] , Keyword[new] identifier[ByProcessInstanceIdContainerLocator] operator[SEP] identifier[processInstanceId] operator[SEP] operator[SEP] operator[SEP]
}
|
public static float optionalFloatAttribute(
final XMLStreamReader reader,
final String localName,
final float defaultValue) {
return optionalFloatAttribute(reader, null, localName, defaultValue);
}
|
class class_name[name] begin[{]
method[optionalFloatAttribute, return_type[type[float]], modifier[public static], parameter[reader, localName, defaultValue]] begin[{]
return[call[.optionalFloatAttribute, parameter[member[.reader], literal[null], member[.localName], member[.defaultValue]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[float] identifier[optionalFloatAttribute] operator[SEP] Keyword[final] identifier[XMLStreamReader] identifier[reader] , Keyword[final] identifier[String] identifier[localName] , Keyword[final] Keyword[float] identifier[defaultValue] operator[SEP] {
Keyword[return] identifier[optionalFloatAttribute] operator[SEP] identifier[reader] , Other[null] , identifier[localName] , identifier[defaultValue] operator[SEP] operator[SEP]
}
|
@Override
public boolean getFlag(int flagType) {
logger.debug("Setting flag: ", flagType + "=" + super.getFlag(flagType));
return super.getFlag(flagType);
}
|
class class_name[name] begin[{]
method[getFlag, return_type[type[boolean]], modifier[public], parameter[flagType]] begin[{]
call[logger.debug, parameter[literal["Setting flag: "], binary_operation[binary_operation[member[.flagType], +, literal["="]], +, SuperMethodInvocation(arguments=[MemberReference(member=flagType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]]]
return[SuperMethodInvocation(arguments=[MemberReference(member=flagType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[getFlag] operator[SEP] Keyword[int] identifier[flagType] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[flagType] operator[+] literal[String] operator[+] Keyword[super] operator[SEP] identifier[getFlag] operator[SEP] identifier[flagType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[super] operator[SEP] identifier[getFlag] operator[SEP] identifier[flagType] operator[SEP] operator[SEP]
}
|
public void setVideoDecoderConfiguration(IRTMPEvent decoderConfig) {
if (decoderConfig instanceof IStreamData) {
IoBuffer data = ((IStreamData<?>) decoderConfig).getData().asReadOnlyBuffer();
videoConfigurationTag = ImmutableTag.build(decoderConfig.getDataType(), 0, data, 0);
}
}
|
class class_name[name] begin[{]
method[setVideoDecoderConfiguration, return_type[void], modifier[public], parameter[decoderConfig]] begin[{]
if[binary_operation[member[.decoderConfig], instanceof, type[IStreamData]]] begin[{]
local_variable[type[IoBuffer], data]
assign[member[.videoConfigurationTag], call[ImmutableTag.build, parameter[call[decoderConfig.getDataType, parameter[]], literal[0], member[.data], literal[0]]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setVideoDecoderConfiguration] operator[SEP] identifier[IRTMPEvent] identifier[decoderConfig] operator[SEP] {
Keyword[if] operator[SEP] identifier[decoderConfig] Keyword[instanceof] identifier[IStreamData] operator[SEP] {
identifier[IoBuffer] identifier[data] operator[=] operator[SEP] operator[SEP] identifier[IStreamData] operator[<] operator[?] operator[>] operator[SEP] identifier[decoderConfig] operator[SEP] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[asReadOnlyBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[videoConfigurationTag] operator[=] identifier[ImmutableTag] operator[SEP] identifier[build] operator[SEP] identifier[decoderConfig] operator[SEP] identifier[getDataType] operator[SEP] operator[SEP] , Other[0] , identifier[data] , Other[0] operator[SEP] operator[SEP]
}
}
|
private synchronized void initialize()
{
if (!_initialized)
{
FacesContext context = FacesContext.getCurrentInstance();
if (isFacelets2Enabled(context))
{
logWarningIfLegacyFaceletViewHandlerIsPresent(context);
if (MyfacesConfig.getCurrentInstance(
context.getExternalContext()).isSupportJSPAndFacesEL())
{
_supportedLanguages = new ViewDeclarationLanguageStrategy[2];
_supportedLanguages[0] = new FaceletViewDeclarationLanguageStrategy();
_supportedLanguages[1] = new JspViewDeclarationLanguageStrategy();
}
else
{
_supportedLanguages = new ViewDeclarationLanguageStrategy[1];
_supportedLanguages[0] = new FaceletViewDeclarationLanguageStrategy();
}
}
else
{
// Support JSP only
_supportedLanguages = new ViewDeclarationLanguageStrategy[1];
_supportedLanguages[0] = new JspViewDeclarationLanguageStrategy();
}
_initialized = true;
}
}
|
class class_name[name] begin[{]
method[initialize, return_type[void], modifier[synchronized private], parameter[]] begin[{]
if[member[._initialized]] begin[{]
local_variable[type[FacesContext], context]
if[call[.isFacelets2Enabled, parameter[member[.context]]]] begin[{]
call[.logWarningIfLegacyFaceletViewHandlerIsPresent, parameter[member[.context]]]
if[call[MyfacesConfig.getCurrentInstance, parameter[call[context.getExternalContext, parameter[]]]]] begin[{]
assign[member[._supportedLanguages], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ViewDeclarationLanguageStrategy, sub_type=None))]
assign[member[._supportedLanguages], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FaceletViewDeclarationLanguageStrategy, sub_type=None))]
assign[member[._supportedLanguages], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JspViewDeclarationLanguageStrategy, sub_type=None))]
else begin[{]
assign[member[._supportedLanguages], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ViewDeclarationLanguageStrategy, sub_type=None))]
assign[member[._supportedLanguages], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FaceletViewDeclarationLanguageStrategy, sub_type=None))]
end[}]
else begin[{]
assign[member[._supportedLanguages], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ViewDeclarationLanguageStrategy, sub_type=None))]
assign[member[._supportedLanguages], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JspViewDeclarationLanguageStrategy, sub_type=None))]
end[}]
assign[member[._initialized], literal[true]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[synchronized] Keyword[void] identifier[initialize] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[_initialized] operator[SEP] {
identifier[FacesContext] identifier[context] operator[=] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isFacelets2Enabled] operator[SEP] identifier[context] operator[SEP] operator[SEP] {
identifier[logWarningIfLegacyFaceletViewHandlerIsPresent] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[MyfacesConfig] operator[SEP] identifier[getCurrentInstance] operator[SEP] identifier[context] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isSupportJSPAndFacesEL] operator[SEP] operator[SEP] operator[SEP] {
identifier[_supportedLanguages] operator[=] Keyword[new] identifier[ViewDeclarationLanguageStrategy] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[_supportedLanguages] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[FaceletViewDeclarationLanguageStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[_supportedLanguages] operator[SEP] Other[1] operator[SEP] operator[=] Keyword[new] identifier[JspViewDeclarationLanguageStrategy] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_supportedLanguages] operator[=] Keyword[new] identifier[ViewDeclarationLanguageStrategy] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[_supportedLanguages] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[FaceletViewDeclarationLanguageStrategy] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[_supportedLanguages] operator[=] Keyword[new] identifier[ViewDeclarationLanguageStrategy] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[_supportedLanguages] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[JspViewDeclarationLanguageStrategy] operator[SEP] operator[SEP] operator[SEP]
}
identifier[_initialized] operator[=] literal[boolean] operator[SEP]
}
}
|
@Override
public void onTimer(String timerName) {
if (timerName.equals(IDLE_SESSION_TIMER_NAME)) {
checkIdleAppSession();
}
else if (timerName.equals(TIMER_NAME_TS)) {
if (context != null) {
try {
context.sessionTimeoutElapses(ServerRfSessionImpl.this);
}
catch (InternalException e) {
logger.debug("Failure on processing expired Ts", e);
}
}
setState(IDLE);
}
else {
logger.warn("Received an unknown timer '{}' for Session-ID '{}'", timerName, getSessionId());
}
}
|
class class_name[name] begin[{]
method[onTimer, return_type[void], modifier[public], parameter[timerName]] begin[{]
if[call[timerName.equals, parameter[member[.IDLE_SESSION_TIMER_NAME]]]] begin[{]
call[.checkIdleAppSession, parameter[]]
else begin[{]
if[call[timerName.equals, parameter[member[.TIMER_NAME_TS]]]] begin[{]
if[binary_operation[member[.context], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=ServerRfSessionImpl, selectors=[])], member=sessionTimeoutElapses, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure on processing expired Ts"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InternalException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
call[.setState, parameter[member[.IDLE]]]
else begin[{]
call[logger.warn, parameter[literal["Received an unknown timer '{}' for Session-ID '{}'"], member[.timerName], call[.getSessionId, parameter[]]]]
end[}]
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onTimer] operator[SEP] identifier[String] identifier[timerName] operator[SEP] {
Keyword[if] operator[SEP] identifier[timerName] operator[SEP] identifier[equals] operator[SEP] identifier[IDLE_SESSION_TIMER_NAME] operator[SEP] operator[SEP] {
identifier[checkIdleAppSession] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[timerName] operator[SEP] identifier[equals] operator[SEP] identifier[TIMER_NAME_TS] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[context] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[context] operator[SEP] identifier[sessionTimeoutElapses] operator[SEP] identifier[ServerRfSessionImpl] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InternalException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[setState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[timerName] , identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public com.google.api.ads.adwords.axis.v201809.cm.Media getMedia() {
return media;
}
|
class class_name[name] begin[{]
method[getMedia, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.media]]
end[}]
END[}]
|
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[cm] operator[SEP] identifier[Media] identifier[getMedia] operator[SEP] operator[SEP] {
Keyword[return] identifier[media] operator[SEP]
}
|
@TargetApi(Build.VERSION_CODES.FROYO)
public static boolean hasWifiFeature(Context context) {
return hasWifiFeature(context.getPackageManager());
}
|
class class_name[name] begin[{]
method[hasWifiFeature, return_type[type[boolean]], modifier[public static], parameter[context]] begin[{]
return[call[.hasWifiFeature, parameter[call[context.getPackageManager, parameter[]]]]]
end[}]
END[}]
|
annotation[@] identifier[TargetApi] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[FROYO] operator[SEP] Keyword[public] Keyword[static] Keyword[boolean] identifier[hasWifiFeature] operator[SEP] identifier[Context] identifier[context] operator[SEP] {
Keyword[return] identifier[hasWifiFeature] operator[SEP] identifier[context] operator[SEP] identifier[getPackageManager] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T> T get(String className, Object... params) {
final Class<T> clazz = ClassUtil.loadClass(className);
return get(clazz, params);
}
|
class class_name[name] begin[{]
method[get, return_type[type[T]], modifier[public static], parameter[className, params]] begin[{]
local_variable[type[Class], clazz]
return[call[.get, parameter[member[.clazz], member[.params]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[get] operator[SEP] identifier[String] identifier[className] , identifier[Object] operator[...] identifier[params] operator[SEP] {
Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[=] identifier[ClassUtil] operator[SEP] identifier[loadClass] operator[SEP] identifier[className] operator[SEP] operator[SEP] Keyword[return] identifier[get] operator[SEP] identifier[clazz] , identifier[params] operator[SEP] operator[SEP]
}
|
@Override
public boolean add(IAtomContainer atomContainer) {
if (this.atomContainer == null) {
this.atomContainer = atomContainer;
title = (String) atomContainer.getTitle();
}
if (title == null) {
throw new IllegalArgumentException("At least one of the input molecules does not have a title");
}
if (!title.equals(atomContainer.getTitle()))
throw new IllegalArgumentException("The input molecules does not have the same title ('" + title
+ "') as the other conformers ('" + atomContainer.getTitle() + "')");
if (atomContainer.getAtomCount() != this.atomContainer.getAtomCount())
throw new IllegalArgumentException("Doesn't have the same number of atoms as the rest of the conformers");
coordinates.add(getCoordinateList(atomContainer));
return true;
}
|
class class_name[name] begin[{]
method[add, return_type[type[boolean]], modifier[public], parameter[atomContainer]] begin[{]
if[binary_operation[THIS[member[None.atomContainer]], ==, literal[null]]] begin[{]
assign[THIS[member[None.atomContainer]], member[.atomContainer]]
assign[member[.title], Cast(expression=MethodInvocation(arguments=[], member=getTitle, postfix_operators=[], prefix_operators=[], qualifier=atomContainer, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.title], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="At least one of the input molecules does not have a title")], 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[call[title.equals, parameter[call[atomContainer.getTitle, parameter[]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The input molecules does not have the same title ('"), operandr=MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="') as the other conformers ('"), operator=+), operandr=MethodInvocation(arguments=[], member=getTitle, postfix_operators=[], prefix_operators=[], qualifier=atomContainer, 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[}]
if[binary_operation[call[atomContainer.getAtomCount, parameter[]], !=, THIS[member[None.atomContainer]call[None.getAtomCount, parameter[]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Doesn't have the same number of atoms as the rest of the conformers")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[coordinates.add, parameter[call[.getCoordinateList, parameter[member[.atomContainer]]]]]
return[literal[true]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[add] operator[SEP] identifier[IAtomContainer] identifier[atomContainer] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[atomContainer] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[atomContainer] operator[=] identifier[atomContainer] operator[SEP] identifier[title] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[atomContainer] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[title] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[title] operator[SEP] identifier[equals] operator[SEP] identifier[atomContainer] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[title] operator[+] literal[String] operator[+] identifier[atomContainer] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[atomContainer] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[!=] Keyword[this] operator[SEP] identifier[atomContainer] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[coordinates] operator[SEP] identifier[add] operator[SEP] identifier[getCoordinateList] operator[SEP] identifier[atomContainer] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public EClass getIfcRelAssignsTasks() {
if (ifcRelAssignsTasksEClass == null) {
ifcRelAssignsTasksEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(439);
}
return ifcRelAssignsTasksEClass;
}
|
class class_name[name] begin[{]
method[getIfcRelAssignsTasks, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcRelAssignsTasksEClass], ==, literal[null]]] begin[{]
assign[member[.ifcRelAssignsTasksEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=439)], 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[.ifcRelAssignsTasksEClass]]
end[}]
END[}]
|
Keyword[public] identifier[EClass] identifier[getIfcRelAssignsTasks] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcRelAssignsTasksEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcRelAssignsTasksEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[439] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcRelAssignsTasksEClass] operator[SEP]
}
|
protected <TYPE extends MoleculerComponent> TYPE start(TYPE component) throws Exception {
if (component == null) {
return null;
}
component.started(this);
logger.info(nameOf(component, true) + " started.");
return component;
}
|
class class_name[name] begin[{]
method[start, return_type[type[TYPE]], modifier[protected], parameter[component]] begin[{]
if[binary_operation[member[.component], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
call[component.started, parameter[THIS[]]]
call[logger.info, parameter[binary_operation[call[.nameOf, parameter[member[.component], literal[true]]], +, literal[" started."]]]]
return[member[.component]]
end[}]
END[}]
|
Keyword[protected] operator[<] identifier[TYPE] Keyword[extends] identifier[MoleculerComponent] operator[>] identifier[TYPE] identifier[start] operator[SEP] identifier[TYPE] identifier[component] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[component] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[component] operator[SEP] identifier[started] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[nameOf] operator[SEP] identifier[component] , literal[boolean] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[component] operator[SEP]
}
|
private static void appendDescriptor(final StringBuilder stringBuilder, final Class<?> clazz) {
Class<?> currentClass = clazz;
while (currentClass.isArray()) {
stringBuilder.append('[');
currentClass = currentClass.getComponentType();
}
if (currentClass.isPrimitive()) {
char descriptor;
if (currentClass == Integer.TYPE) {
descriptor = 'I';
} else if (currentClass == Void.TYPE) {
descriptor = 'V';
} else if (currentClass == Boolean.TYPE) {
descriptor = 'Z';
} else if (currentClass == Byte.TYPE) {
descriptor = 'B';
} else if (currentClass == Character.TYPE) {
descriptor = 'C';
} else if (currentClass == Short.TYPE) {
descriptor = 'S';
} else if (currentClass == Double.TYPE) {
descriptor = 'D';
} else if (currentClass == Float.TYPE) {
descriptor = 'F';
} else if (currentClass == Long.TYPE) {
descriptor = 'J';
} else {
throw new AssertionError();
}
stringBuilder.append(descriptor);
} else {
stringBuilder.append('L');
String name = currentClass.getName();
int nameLength = name.length();
for (int i = 0; i < nameLength; ++i) {
char car = name.charAt(i);
stringBuilder.append(car == '.' ? '/' : car);
}
stringBuilder.append(';');
}
}
|
class class_name[name] begin[{]
method[appendDescriptor, return_type[void], modifier[private static], parameter[stringBuilder, clazz]] begin[{]
local_variable[type[Class], currentClass]
while[call[currentClass.isArray, parameter[]]] begin[{]
call[stringBuilder.append, parameter[literal['[']]]
assign[member[.currentClass], call[currentClass.getComponentType, parameter[]]]
end[}]
if[call[currentClass.isPrimitive, parameter[]]] begin[{]
local_variable[type[char], descriptor]
if[binary_operation[member[.currentClass], ==, member[Integer.TYPE]]] begin[{]
assign[member[.descriptor], literal['I']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Void.TYPE]]] begin[{]
assign[member[.descriptor], literal['V']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Boolean.TYPE]]] begin[{]
assign[member[.descriptor], literal['Z']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Byte.TYPE]]] begin[{]
assign[member[.descriptor], literal['B']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Character.TYPE]]] begin[{]
assign[member[.descriptor], literal['C']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Short.TYPE]]] begin[{]
assign[member[.descriptor], literal['S']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Double.TYPE]]] begin[{]
assign[member[.descriptor], literal['D']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Float.TYPE]]] begin[{]
assign[member[.descriptor], literal['F']]
else begin[{]
if[binary_operation[member[.currentClass], ==, member[Long.TYPE]]] begin[{]
assign[member[.descriptor], literal['J']]
else 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=AssertionError, sub_type=None)), label=None)
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
call[stringBuilder.append, parameter[member[.descriptor]]]
else begin[{]
call[stringBuilder.append, parameter[literal['L']]]
local_variable[type[String], name]
local_variable[type[int], nameLength]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), name=car)], modifiers=set(), type=BasicType(dimensions=[], name=char)), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=car, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator===), if_false=MemberReference(member=car, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'))], member=append, postfix_operators=[], prefix_operators=[], qualifier=stringBuilder, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nameLength, 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)
call[stringBuilder.append, parameter[literal[';']]]
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[void] identifier[appendDescriptor] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[stringBuilder] , Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[currentClass] operator[=] identifier[clazz] operator[SEP] Keyword[while] operator[SEP] identifier[currentClass] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] {
identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[currentClass] operator[=] identifier[currentClass] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[currentClass] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] {
Keyword[char] identifier[descriptor] operator[SEP] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Integer] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Void] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Boolean] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Byte] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Character] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Short] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Double] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Float] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[currentClass] operator[==] identifier[Long] operator[SEP] identifier[TYPE] operator[SEP] {
identifier[descriptor] operator[=] literal[String] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] operator[SEP] operator[SEP]
}
identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[currentClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[nameLength] operator[=] identifier[name] 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[nameLength] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[char] identifier[car] operator[=] identifier[name] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[car] operator[==] literal[String] operator[?] literal[String] operator[:] identifier[car] operator[SEP] operator[SEP]
}
identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
private CmsResource findXmlPage(CmsObject cms, String resourcename) {
// get the full folder path of the resource to start from
String path = cms.getRequestContext().removeSiteRoot(resourcename);
// the path without the trailing slash
// for example: .../xmlpage.xml/ -> .../xmlpagepage.xml
String reducedPath = CmsFileUtil.removeTrailingSeparator(path);
do {
// check if a resource without the trailing shalsh exists
boolean existResource = cms.existsResource(reducedPath);
// check if the current folder exists
if (cms.existsResource(path) || existResource) {
// prove if a resource without the trailing slash does exist
if (existResource) {
// a resource without the trailing slash does exist, so take the path without the trailing slash
path = reducedPath;
}
try {
CmsResource res = cms.readResource(path);
I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(res.getTypeId());
if (resType instanceof CmsResourceTypeXmlPage) {
return res;
} else {
break;
}
} catch (CmsException ex) {
break;
}
} else {
// folder does not exist, go up one folder
path = CmsResource.getParentFolder(path);
if (path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
}
}
if (CmsStringUtil.isEmpty(path)) {
// site root or root folder reached and no folder found
break;
}
} while (true);
return null;
}
|
class class_name[name] begin[{]
method[findXmlPage, return_type[type[CmsResource]], modifier[private], parameter[cms, resourcename]] begin[{]
local_variable[type[String], path]
local_variable[type[String], reducedPath]
do[literal[true]] begin[{]
local_variable[type[boolean], existResource]
if[binary_operation[call[cms.existsResource, parameter[member[.path]]], ||, member[.existResource]]] begin[{]
if[member[.existResource]] begin[{]
assign[member[.path], member[.reducedPath]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readResource, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), name=res)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResourceManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeId, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None)], member=getResourceType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=resType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsResourceType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=resType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=CmsResourceTypeXmlPage, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[BreakStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CmsException']))], finally_block=None, label=None, resources=None)
else begin[{]
assign[member[.path], call[CmsResource.getParentFolder, parameter[member[.path]]]]
if[call[path.endsWith, parameter[literal["/"]]]] begin[{]
assign[member[.path], call[path.substring, parameter[literal[0], binary_operation[call[path.length, parameter[]], -, literal[1]]]]]
else begin[{]
None
end[}]
end[}]
if[call[CmsStringUtil.isEmpty, parameter[member[.path]]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[private] identifier[CmsResource] identifier[findXmlPage] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[String] identifier[resourcename] operator[SEP] {
identifier[String] identifier[path] operator[=] identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[removeSiteRoot] operator[SEP] identifier[resourcename] operator[SEP] operator[SEP] identifier[String] identifier[reducedPath] operator[=] identifier[CmsFileUtil] operator[SEP] identifier[removeTrailingSeparator] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[do] {
Keyword[boolean] identifier[existResource] operator[=] identifier[cms] operator[SEP] identifier[existsResource] operator[SEP] identifier[reducedPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cms] operator[SEP] identifier[existsResource] operator[SEP] identifier[path] operator[SEP] operator[||] identifier[existResource] operator[SEP] {
Keyword[if] operator[SEP] identifier[existResource] operator[SEP] {
identifier[path] operator[=] identifier[reducedPath] operator[SEP]
}
Keyword[try] {
identifier[CmsResource] identifier[res] operator[=] identifier[cms] operator[SEP] identifier[readResource] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[I_CmsResourceType] identifier[resType] operator[=] identifier[OpenCms] operator[SEP] identifier[getResourceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceType] operator[SEP] identifier[res] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resType] Keyword[instanceof] identifier[CmsResourceTypeXmlPage] operator[SEP] {
Keyword[return] identifier[res] operator[SEP]
}
Keyword[else] {
Keyword[break] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[ex] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[else] {
identifier[path] operator[=] identifier[CmsResource] operator[SEP] identifier[getParentFolder] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[path] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[path] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
static NormalVersion parseVersionCore(String versionCore) {
VersionParser parser = new VersionParser(versionCore);
return parser.parseVersionCore();
}
|
class class_name[name] begin[{]
method[parseVersionCore, return_type[type[NormalVersion]], modifier[static], parameter[versionCore]] begin[{]
local_variable[type[VersionParser], parser]
return[call[parser.parseVersionCore, parameter[]]]
end[}]
END[}]
|
Keyword[static] identifier[NormalVersion] identifier[parseVersionCore] operator[SEP] identifier[String] identifier[versionCore] operator[SEP] {
identifier[VersionParser] identifier[parser] operator[=] Keyword[new] identifier[VersionParser] operator[SEP] identifier[versionCore] operator[SEP] operator[SEP] Keyword[return] identifier[parser] operator[SEP] identifier[parseVersionCore] operator[SEP] operator[SEP] operator[SEP]
}
|
public void getAllTraitID(Callback<List<Integer>> callback) throws NullPointerException {
gw2API.getAllTraitIDs().enqueue(callback);
}
|
class class_name[name] begin[{]
method[getAllTraitID, return_type[void], modifier[public], parameter[callback]] begin[{]
call[gw2API.getAllTraitIDs, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[getAllTraitID] operator[SEP] identifier[Callback] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[callback] operator[SEP] Keyword[throws] identifier[NullPointerException] {
identifier[gw2API] operator[SEP] identifier[getAllTraitIDs] operator[SEP] operator[SEP] operator[SEP] identifier[enqueue] operator[SEP] identifier[callback] operator[SEP] operator[SEP]
}
|
public boolean containsAll(final Collection<?> coll)
{
for (final Object t : coll)
{
if (!contains(t))
{
return false;
}
}
return true;
}
|
class class_name[name] begin[{]
method[containsAll, return_type[type[boolean]], modifier[public], parameter[coll]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=coll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[containsAll] operator[SEP] Keyword[final] identifier[Collection] operator[<] operator[?] operator[>] identifier[coll] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[Object] identifier[t] operator[:] identifier[coll] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[contains] operator[SEP] identifier[t] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private static void zipFile(final File srcFile, final String destPath, final ZipOutputStream out) throws IOException {
final byte[] buf = new byte[1024];
try (final InputStream in = new BufferedInputStream(new FileInputStream(srcFile))) {
final ZipEntry zipEntry = new ZipEntry(concatPathAndFilename(destPath, srcFile.getName(), File.separator));
zipEntry.setTime(srcFile.lastModified());
out.putNextEntry(zipEntry);
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.closeEntry();
}
}
|
class class_name[name] begin[{]
method[zipFile, return_type[void], modifier[private static], parameter[srcFile, destPath, out]] begin[{]
local_variable[type[byte], buf]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=destPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=srcFile, selectors=[], type_arguments=None), MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[])], member=concatPathAndFilename, 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=ZipEntry, sub_type=None)), name=zipEntry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ZipEntry, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=lastModified, postfix_operators=[], prefix_operators=[], qualifier=srcFile, selectors=[], type_arguments=None)], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=zipEntry, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zipEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putNextEntry, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=closeEntry, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=in, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=srcFile, 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=FileInputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None)))])
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[void] identifier[zipFile] operator[SEP] Keyword[final] identifier[File] identifier[srcFile] , Keyword[final] identifier[String] identifier[destPath] , Keyword[final] identifier[ZipOutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[1024] operator[SEP] operator[SEP] Keyword[try] operator[SEP] Keyword[final] identifier[InputStream] identifier[in] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[srcFile] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[ZipEntry] identifier[zipEntry] operator[=] Keyword[new] identifier[ZipEntry] operator[SEP] identifier[concatPathAndFilename] operator[SEP] identifier[destPath] , identifier[srcFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[File] operator[SEP] identifier[separator] operator[SEP] operator[SEP] operator[SEP] identifier[zipEntry] operator[SEP] identifier[setTime] operator[SEP] identifier[srcFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[putNextEntry] operator[SEP] identifier[zipEntry] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[buf] , Other[0] , identifier[len] operator[SEP] operator[SEP]
}
identifier[out] operator[SEP] identifier[closeEntry] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void setSize(DBIDRef id, int size) {
if(csize == null) {
csize = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
}
csize.putInt(id, size);
}
|
class class_name[name] begin[{]
method[setSize, return_type[void], modifier[public], parameter[id, size]] begin[{]
if[binary_operation[member[.csize], ==, literal[null]]] begin[{]
assign[member[.csize], call[DataStoreUtil.makeIntegerStorage, parameter[member[.ids], binary_operation[member[DataStoreFactory.HINT_HOT], |, member[DataStoreFactory.HINT_TEMP]], literal[1]]]]
else begin[{]
None
end[}]
call[csize.putInt, parameter[member[.id], member[.size]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setSize] operator[SEP] identifier[DBIDRef] identifier[id] , Keyword[int] identifier[size] operator[SEP] {
Keyword[if] operator[SEP] identifier[csize] operator[==] Other[null] operator[SEP] {
identifier[csize] operator[=] identifier[DataStoreUtil] operator[SEP] identifier[makeIntegerStorage] operator[SEP] identifier[ids] , identifier[DataStoreFactory] operator[SEP] identifier[HINT_HOT] operator[|] identifier[DataStoreFactory] operator[SEP] identifier[HINT_TEMP] , Other[1] operator[SEP] operator[SEP]
}
identifier[csize] operator[SEP] identifier[putInt] operator[SEP] identifier[id] , identifier[size] operator[SEP] operator[SEP]
}
|
private MilestoneManager getKilometerManager() {
final float backgroundRadius = 20;
final Paint backgroundPaint1 = getFillPaint(COLOR_BACKGROUND);
final Paint backgroundPaint2 = getFillPaint(COLOR_POLYLINE_ANIMATED);
final Paint textPaint1 = getTextPaint(COLOR_POLYLINE_STATIC);
final Paint textPaint2 = getTextPaint(COLOR_BACKGROUND);
final Paint borderPaint = getStrokePaint(COLOR_BACKGROUND, 2);
return new MilestoneManager(
new MilestoneMeterDistanceLister(1000),
new MilestoneDisplayer(0, false) {
@Override
protected void draw(final Canvas pCanvas, final Object pParameter) {
final double meters = (double)pParameter;
final int kilometers = (int)Math.round(meters / 1000);
final boolean checked = meters < mAnimatedMetersSoFar || (kilometers == 10 && mAnimationEnded);
final Paint textPaint = checked ? textPaint2 : textPaint1;
final Paint backgroundPaint = checked ? backgroundPaint2 : backgroundPaint1;
final String text = "" + kilometers + "K";
final Rect rect = new Rect();
textPaint1.getTextBounds(text, 0, text.length(), rect);
pCanvas.drawCircle(0, 0, backgroundRadius, backgroundPaint);
pCanvas.drawText(text, -rect.left - rect.width() / 2, rect.height() / 2 - rect.bottom, textPaint);
pCanvas.drawCircle(0, 0, backgroundRadius + 1, borderPaint);
}
}
);
}
|
class class_name[name] begin[{]
method[getKilometerManager, return_type[type[MilestoneManager]], modifier[private], parameter[]] begin[{]
local_variable[type[float], backgroundRadius]
local_variable[type[Paint], backgroundPaint1]
local_variable[type[Paint], backgroundPaint2]
local_variable[type[Paint], textPaint1]
local_variable[type[Paint], textPaint2]
local_variable[type[Paint], borderPaint]
return[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MilestoneMeterDistanceLister, sub_type=None)), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=pParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), name=meters)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=meters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=/)], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), name=kilometers)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=meters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mAnimatedMetersSoFar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=kilometers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator===), operandr=MemberReference(member=mAnimationEnded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), operator=||), name=checked)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MemberReference(member=checked, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=textPaint1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=textPaint2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), name=textPaint)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Paint, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MemberReference(member=checked, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=backgroundPaint1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=backgroundPaint2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), name=backgroundPaint)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Paint, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=kilometers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="K"), operator=+), name=text)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, 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=Rect, sub_type=None)), name=rect)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Rect, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), MemberReference(member=rect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTextBounds, postfix_operators=[], prefix_operators=[], qualifier=textPaint1, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=backgroundRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=backgroundPaint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=drawCircle, postfix_operators=[], prefix_operators=[], qualifier=pCanvas, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=left, postfix_operators=[], prefix_operators=['-'], qualifier=rect, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=width, postfix_operators=[], prefix_operators=[], qualifier=rect, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operator=-), BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=height, postfix_operators=[], prefix_operators=[], qualifier=rect, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=MemberReference(member=bottom, postfix_operators=[], prefix_operators=[], qualifier=rect, selectors=[]), operator=-), MemberReference(member=textPaint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=drawText, postfix_operators=[], prefix_operators=[], qualifier=pCanvas, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MemberReference(member=backgroundRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=borderPaint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=drawCircle, postfix_operators=[], prefix_operators=[], qualifier=pCanvas, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=draw, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=pCanvas, type=ReferenceType(arguments=None, dimensions=[], name=Canvas, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=pParameter, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MilestoneDisplayer, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MilestoneManager, sub_type=None))]
end[}]
END[}]
|
Keyword[private] identifier[MilestoneManager] identifier[getKilometerManager] operator[SEP] operator[SEP] {
Keyword[final] Keyword[float] identifier[backgroundRadius] operator[=] Other[20] operator[SEP] Keyword[final] identifier[Paint] identifier[backgroundPaint1] operator[=] identifier[getFillPaint] operator[SEP] identifier[COLOR_BACKGROUND] operator[SEP] operator[SEP] Keyword[final] identifier[Paint] identifier[backgroundPaint2] operator[=] identifier[getFillPaint] operator[SEP] identifier[COLOR_POLYLINE_ANIMATED] operator[SEP] operator[SEP] Keyword[final] identifier[Paint] identifier[textPaint1] operator[=] identifier[getTextPaint] operator[SEP] identifier[COLOR_POLYLINE_STATIC] operator[SEP] operator[SEP] Keyword[final] identifier[Paint] identifier[textPaint2] operator[=] identifier[getTextPaint] operator[SEP] identifier[COLOR_BACKGROUND] operator[SEP] operator[SEP] Keyword[final] identifier[Paint] identifier[borderPaint] operator[=] identifier[getStrokePaint] operator[SEP] identifier[COLOR_BACKGROUND] , Other[2] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[MilestoneManager] operator[SEP] Keyword[new] identifier[MilestoneMeterDistanceLister] operator[SEP] Other[1000] operator[SEP] , Keyword[new] identifier[MilestoneDisplayer] operator[SEP] Other[0] , literal[boolean] operator[SEP] {
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[draw] operator[SEP] Keyword[final] identifier[Canvas] identifier[pCanvas] , Keyword[final] identifier[Object] identifier[pParameter] operator[SEP] {
Keyword[final] Keyword[double] identifier[meters] operator[=] operator[SEP] Keyword[double] operator[SEP] identifier[pParameter] operator[SEP] Keyword[final] Keyword[int] identifier[kilometers] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[meters] operator[/] Other[1000] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[checked] operator[=] identifier[meters] operator[<] identifier[mAnimatedMetersSoFar] operator[||] operator[SEP] identifier[kilometers] operator[==] Other[10] operator[&&] identifier[mAnimationEnded] operator[SEP] operator[SEP] Keyword[final] identifier[Paint] identifier[textPaint] operator[=] identifier[checked] operator[?] identifier[textPaint2] operator[:] identifier[textPaint1] operator[SEP] Keyword[final] identifier[Paint] identifier[backgroundPaint] operator[=] identifier[checked] operator[?] identifier[backgroundPaint2] operator[:] identifier[backgroundPaint1] operator[SEP] Keyword[final] identifier[String] identifier[text] operator[=] literal[String] operator[+] identifier[kilometers] operator[+] literal[String] operator[SEP] Keyword[final] identifier[Rect] identifier[rect] operator[=] Keyword[new] identifier[Rect] operator[SEP] operator[SEP] operator[SEP] identifier[textPaint1] operator[SEP] identifier[getTextBounds] operator[SEP] identifier[text] , Other[0] , identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[rect] operator[SEP] operator[SEP] identifier[pCanvas] operator[SEP] identifier[drawCircle] operator[SEP] Other[0] , Other[0] , identifier[backgroundRadius] , identifier[backgroundPaint] operator[SEP] operator[SEP] identifier[pCanvas] operator[SEP] identifier[drawText] operator[SEP] identifier[text] , operator[-] identifier[rect] operator[SEP] identifier[left] operator[-] identifier[rect] operator[SEP] identifier[width] operator[SEP] operator[SEP] operator[/] Other[2] , identifier[rect] operator[SEP] identifier[height] operator[SEP] operator[SEP] operator[/] Other[2] operator[-] identifier[rect] operator[SEP] identifier[bottom] , identifier[textPaint] operator[SEP] operator[SEP] identifier[pCanvas] operator[SEP] identifier[drawCircle] operator[SEP] Other[0] , Other[0] , identifier[backgroundRadius] operator[+] Other[1] , identifier[borderPaint] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
private void updateForeignKeys(EntityMetadata metadata, Object id, List<RelationHolder> relationHolders)
{
for (RelationHolder rh : relationHolders)
{
String linkName = rh.getRelationName();
Object linkValue = rh.getRelationValue();
if (linkName != null && linkValue != null)
{
// String fieldName = metadata.getFieldName(linkName);
String clause = getFromClause(metadata.getSchema(), metadata.getTableName());
// String updateSql = "Update " +
// metadata.getEntityClazz().getSimpleName() + " SET " +
// fieldName + "= '" + linkValue + "' WHERE "
// + ((AbstractAttribute) metadata.getIdAttribute()).getName() +
// " = '" + id + "'";
String updateSql = "Update " + clause + " SET " + linkName + "= '" + linkValue + "' WHERE "
+ ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName() + " = '" + id + "'";
onNativeUpdate(updateSql, null);
}
}
}
|
class class_name[name] begin[{]
method[updateForeignKeys, return_type[void], modifier[private], parameter[metadata, id, relationHolders]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRelationName, postfix_operators=[], prefix_operators=[], qualifier=rh, selectors=[], type_arguments=None), name=linkName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRelationValue, postfix_operators=[], prefix_operators=[], qualifier=rh, selectors=[], type_arguments=None), name=linkValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=linkName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=linkValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSchema, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getTableName, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None)], member=getFromClause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=clause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Update "), operandr=MemberReference(member=clause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" SET "), operator=+), operandr=MemberReference(member=linkName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="= '"), operator=+), operandr=MemberReference(member=linkValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' WHERE "), operator=+), operandr=Cast(expression=MethodInvocation(arguments=[], member=getIdAttribute, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = '"), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+), name=updateSql)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=updateSql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=onNativeUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=relationHolders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rh)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RelationHolder, sub_type=None))), label=None)
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[updateForeignKeys] operator[SEP] identifier[EntityMetadata] identifier[metadata] , identifier[Object] identifier[id] , identifier[List] operator[<] identifier[RelationHolder] operator[>] identifier[relationHolders] operator[SEP] {
Keyword[for] operator[SEP] identifier[RelationHolder] identifier[rh] operator[:] identifier[relationHolders] operator[SEP] {
identifier[String] identifier[linkName] operator[=] identifier[rh] operator[SEP] identifier[getRelationName] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[linkValue] operator[=] identifier[rh] operator[SEP] identifier[getRelationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[linkName] operator[!=] Other[null] operator[&&] identifier[linkValue] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[clause] operator[=] identifier[getFromClause] operator[SEP] identifier[metadata] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] , identifier[metadata] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[updateSql] operator[=] literal[String] operator[+] identifier[clause] operator[+] literal[String] operator[+] identifier[linkName] operator[+] literal[String] operator[+] identifier[linkValue] operator[+] literal[String] operator[+] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[metadata] operator[SEP] identifier[getIdAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[SEP] identifier[onNativeUpdate] operator[SEP] identifier[updateSql] , Other[null] operator[SEP] operator[SEP]
}
}
}
|
public static void startup(final String _classDBType,
final String _classDSFactory,
final String _propConnection,
final String _classTM,
final String _classTSR,
final String _eFapsProps)
throws StartupException
{
StartupDatabaseConnection.startup(_classDBType,
_classDSFactory,
StartupDatabaseConnection.convertToMap(_propConnection),
_classTM,
_classTSR,
StartupDatabaseConnection.convertToMap(_eFapsProps));
}
|
class class_name[name] begin[{]
method[startup, return_type[void], modifier[public static], parameter[_classDBType, _classDSFactory, _propConnection, _classTM, _classTSR, _eFapsProps]] begin[{]
call[StartupDatabaseConnection.startup, parameter[member[._classDBType], member[._classDSFactory], call[StartupDatabaseConnection.convertToMap, parameter[member[._propConnection]]], member[._classTM], member[._classTSR], call[StartupDatabaseConnection.convertToMap, parameter[member[._eFapsProps]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[startup] operator[SEP] Keyword[final] identifier[String] identifier[_classDBType] , Keyword[final] identifier[String] identifier[_classDSFactory] , Keyword[final] identifier[String] identifier[_propConnection] , Keyword[final] identifier[String] identifier[_classTM] , Keyword[final] identifier[String] identifier[_classTSR] , Keyword[final] identifier[String] identifier[_eFapsProps] operator[SEP] Keyword[throws] identifier[StartupException] {
identifier[StartupDatabaseConnection] operator[SEP] identifier[startup] operator[SEP] identifier[_classDBType] , identifier[_classDSFactory] , identifier[StartupDatabaseConnection] operator[SEP] identifier[convertToMap] operator[SEP] identifier[_propConnection] operator[SEP] , identifier[_classTM] , identifier[_classTSR] , identifier[StartupDatabaseConnection] operator[SEP] identifier[convertToMap] operator[SEP] identifier[_eFapsProps] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean contains(float xp, float yp) {
checkPoints();
if (xp <= getX()) {
return false;
}
if (yp <= getY()) {
return false;
}
if (xp >= maxX) {
return false;
}
if (yp >= maxY) {
return false;
}
return true;
}
|
class class_name[name] begin[{]
method[contains, return_type[type[boolean]], modifier[public], parameter[xp, yp]] begin[{]
call[.checkPoints, parameter[]]
if[binary_operation[member[.xp], <=, call[.getX, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[member[.yp], <=, call[.getY, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[member[.xp], >=, member[.maxX]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[member[.yp], >=, member[.maxY]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[contains] operator[SEP] Keyword[float] identifier[xp] , Keyword[float] identifier[yp] operator[SEP] {
identifier[checkPoints] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xp] operator[<=] identifier[getX] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[yp] operator[<=] identifier[getY] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[xp] operator[>=] identifier[maxX] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[yp] operator[>=] identifier[maxY] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void addUnitWrappers(TypeSpec.Builder type, NumberData data) {
MethodSpec.Builder method = MethodSpec.methodBuilder("wrapUnits")
.addModifiers(PROTECTED)
.addParameter(PluralCategory.class, "category")
.addParameter(DigitBuffer.class, "dbuf")
.addParameter(String.class, "unit")
.addParameter(StringBuilder.class, "dest");
List<String> patterns = new ArrayList<>(new HashSet<>(data.currencyUnitPattern.values()));
if (patterns.size() == 1) {
// Short cut if all patterns are the same.
List<Node> nodes = WRAPPER_PARSER.parseWrapper(patterns.get(0));
for (Node node : nodes) {
if (node instanceof Field) {
Field field = (Field)node;
if (field.ch() == '0') {
method.addStatement("dbuf.appendTo(dest)");
} else {
method.addStatement("dest.append(unit)");
}
} else if (node instanceof Text) {
method.addStatement("dest.append($S)", ((Text)node).text());
}
}
} else {
method.beginControlFlow("switch (category)");
for (Map.Entry<String, String> entry : data.currencyUnitPattern.entrySet()) {
String[] parts = entry.getKey().split("-");
PluralCategory category = PluralCategory.fromString(parts[2]);
String pattern = entry.getValue();
List<Node> nodes = WRAPPER_PARSER.parseWrapper(pattern);
if (category != PluralCategory.OTHER) {
method.beginControlFlow("case $L:", category);
} else {
method.beginControlFlow("case $L:\ndefault:", category);
}
for (Node node : nodes) {
if (node instanceof Field) {
Field field = (Field)node;
if (field.ch() == '0') {
method.addStatement("dbuf.appendTo(dest)");
} else {
method.addStatement("dest.append(unit)");
}
} else if (node instanceof Text) {
method.addStatement("dest.append($S)", ((Text)node).text());
}
}
method.addStatement("break");
method.endControlFlow();
}
method.endControlFlow();
}
type.addMethod(method.build());
}
|
class class_name[name] begin[{]
method[addUnitWrappers, return_type[void], modifier[private], parameter[type, data]] begin[{]
local_variable[type[MethodSpec], method]
local_variable[type[List], patterns]
if[binary_operation[call[patterns.size, parameter[]], ==, literal[1]]] begin[{]
local_variable[type[List], nodes]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Text, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dest.append($S)"), Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Text, sub_type=None))], member=addStatement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=ch, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dest.append(unit)")], member=addStatement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dbuf.appendTo(dest)")], member=addStatement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None)
else begin[{]
call[method.beginControlFlow, parameter[literal["switch (category)"]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=parts)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))])], member=fromString, postfix_operators=[], prefix_operators=[], qualifier=PluralCategory, selectors=[], type_arguments=None), name=category)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PluralCategory, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=pattern)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseWrapper, postfix_operators=[], prefix_operators=[], qualifier=WRAPPER_PARSER, selectors=[], type_arguments=None), name=nodes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=category, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OTHER, postfix_operators=[], prefix_operators=[], qualifier=PluralCategory, selectors=[]), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="case $L:\ndefault:"), MemberReference(member=category, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=beginControlFlow, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="case $L:"), MemberReference(member=category, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=beginControlFlow, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Text, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dest.append($S)"), Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Text, sub_type=None))], member=addStatement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=ch, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dest.append(unit)")], member=addStatement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dbuf.appendTo(dest)")], member=addStatement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="break")], member=addStatement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=endControlFlow, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=data.currencyUnitPattern, selectors=[], 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
call[method.endControlFlow, parameter[]]
end[}]
call[type.addMethod, parameter[call[method.build, parameter[]]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[addUnitWrappers] operator[SEP] identifier[TypeSpec] operator[SEP] identifier[Builder] identifier[type] , identifier[NumberData] identifier[data] operator[SEP] {
identifier[MethodSpec] operator[SEP] identifier[Builder] identifier[method] operator[=] identifier[MethodSpec] operator[SEP] identifier[methodBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[addModifiers] operator[SEP] identifier[PROTECTED] operator[SEP] operator[SEP] identifier[addParameter] operator[SEP] identifier[PluralCategory] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[addParameter] operator[SEP] identifier[DigitBuffer] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[addParameter] operator[SEP] identifier[String] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[addParameter] operator[SEP] identifier[StringBuilder] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[patterns] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[data] operator[SEP] identifier[currencyUnitPattern] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[patterns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[List] operator[<] identifier[Node] operator[>] identifier[nodes] operator[=] identifier[WRAPPER_PARSER] operator[SEP] identifier[parseWrapper] operator[SEP] identifier[patterns] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[nodes] operator[SEP] {
Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[Field] operator[SEP] {
identifier[Field] identifier[field] operator[=] operator[SEP] identifier[Field] operator[SEP] identifier[node] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[ch] operator[SEP] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[method] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[method] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[Text] operator[SEP] {
identifier[method] operator[SEP] identifier[addStatement] operator[SEP] literal[String] , operator[SEP] operator[SEP] identifier[Text] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[text] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[method] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[data] operator[SEP] identifier[currencyUnitPattern] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PluralCategory] identifier[category] operator[=] identifier[PluralCategory] operator[SEP] identifier[fromString] operator[SEP] identifier[parts] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pattern] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Node] operator[>] identifier[nodes] operator[=] identifier[WRAPPER_PARSER] operator[SEP] identifier[parseWrapper] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[category] operator[!=] identifier[PluralCategory] operator[SEP] identifier[OTHER] operator[SEP] {
identifier[method] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] , identifier[category] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[method] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] , identifier[category] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[nodes] operator[SEP] {
Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[Field] operator[SEP] {
identifier[Field] identifier[field] operator[=] operator[SEP] identifier[Field] operator[SEP] identifier[node] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[ch] operator[SEP] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[method] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[method] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[Text] operator[SEP] {
identifier[method] operator[SEP] identifier[addStatement] operator[SEP] literal[String] , operator[SEP] operator[SEP] identifier[Text] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[text] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[method] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[endControlFlow] operator[SEP] operator[SEP] operator[SEP]
}
identifier[method] operator[SEP] identifier[endControlFlow] operator[SEP] operator[SEP] operator[SEP]
}
identifier[type] operator[SEP] identifier[addMethod] operator[SEP] identifier[method] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void printStream(final ByteArrayOutputStream stream, final String hostName, final String printerName, final String documentName)
throws IOException {
String controlFile = "";
byte buffer[] = new byte[1000];
String s;
String strJobNumber;
strJobNumber = "" + jobNumber;
while (strJobNumber.length() < 3)
strJobNumber = "0" + strJobNumber;
String userName = System.getProperty("user.name");
if (userName == null)
userName = "Unknown";
socketLpr.setSoTimeout(30000);
final OutputStream sOut = socketLpr.getOutputStream();
final InputStream sIn = socketLpr.getInputStream();
//Open printer
s = "\002" + printerName + "\n";
sOut.write(s.getBytes());
sOut.flush();
acknowledge(sIn, "Failed to open printer");
//Send control file
controlFile += "H" + hostName + "\n";
controlFile += "P" + userName + "\n";
controlFile += (printRaw ? "o" : "p") + "dfA" + strJobNumber + hostName + "\n";
controlFile += "UdfA" + strJobNumber + hostName + "\n";
controlFile += "N" + documentName + "\n";
s = "\002" + controlFile.length() + " cfA" + strJobNumber + hostName + "\n";
sOut.write(s.getBytes());
acknowledge(sIn, "Failed to send control header");
buffer = controlFile.getBytes();
sOut.write(buffer);
buffer[0] = 0;
sOut.write(buffer, 0, 1);
sOut.flush();
acknowledge(sIn, "Failed to send control file");
s = "\003" + stream.size() + " dfA" + strJobNumber + hostName + "\n";
sOut.write(s.getBytes());
sOut.flush();
acknowledge(sIn, "Failed to send print file command");
stream.writeTo(sOut);
sOut.flush();
buffer[0] = 0;
sOut.write(buffer, 0, 1);
sOut.flush();
acknowledge(sIn, "Failed to send print file");
socketLpr.close();
}
|
class class_name[name] begin[{]
method[printStream, return_type[void], modifier[public], parameter[stream, hostName, printerName, documentName]] begin[{]
local_variable[type[String], controlFile]
local_variable[type[byte], buffer]
local_variable[type[String], s]
local_variable[type[String], strJobNumber]
assign[member[.strJobNumber], binary_operation[literal[""], +, member[.jobNumber]]]
while[binary_operation[call[strJobNumber.length, parameter[]], <, literal[3]]] begin[{]
assign[member[.strJobNumber], binary_operation[literal["0"], +, member[.strJobNumber]]]
end[}]
local_variable[type[String], userName]
if[binary_operation[member[.userName], ==, literal[null]]] begin[{]
assign[member[.userName], literal["Unknown"]]
else begin[{]
None
end[}]
call[socketLpr.setSoTimeout, parameter[literal[30000]]]
local_variable[type[OutputStream], sOut]
local_variable[type[InputStream], sIn]
assign[member[.s], binary_operation[binary_operation[literal["\002"], +, member[.printerName]], +, literal["\n"]]]
call[sOut.write, parameter[call[s.getBytes, parameter[]]]]
call[sOut.flush, parameter[]]
call[.acknowledge, parameter[member[.sIn], literal["Failed to open printer"]]]
assign[member[.controlFile], binary_operation[binary_operation[literal["H"], +, member[.hostName]], +, literal["\n"]]]
assign[member[.controlFile], binary_operation[binary_operation[literal["P"], +, member[.userName]], +, literal["\n"]]]
assign[member[.controlFile], binary_operation[binary_operation[binary_operation[binary_operation[TernaryExpression(condition=MemberReference(member=printRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="p"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="o")), +, literal["dfA"]], +, member[.strJobNumber]], +, member[.hostName]], +, literal["\n"]]]
assign[member[.controlFile], binary_operation[binary_operation[binary_operation[literal["UdfA"], +, member[.strJobNumber]], +, member[.hostName]], +, literal["\n"]]]
assign[member[.controlFile], binary_operation[binary_operation[literal["N"], +, member[.documentName]], +, literal["\n"]]]
assign[member[.s], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["\002"], +, call[controlFile.length, parameter[]]], +, literal[" cfA"]], +, member[.strJobNumber]], +, member[.hostName]], +, literal["\n"]]]
call[sOut.write, parameter[call[s.getBytes, parameter[]]]]
call[.acknowledge, parameter[member[.sIn], literal["Failed to send control header"]]]
assign[member[.buffer], call[controlFile.getBytes, parameter[]]]
call[sOut.write, parameter[member[.buffer]]]
assign[member[.buffer], literal[0]]
call[sOut.write, parameter[member[.buffer], literal[0], literal[1]]]
call[sOut.flush, parameter[]]
call[.acknowledge, parameter[member[.sIn], literal["Failed to send control file"]]]
assign[member[.s], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["\003"], +, call[stream.size, parameter[]]], +, literal[" dfA"]], +, member[.strJobNumber]], +, member[.hostName]], +, literal["\n"]]]
call[sOut.write, parameter[call[s.getBytes, parameter[]]]]
call[sOut.flush, parameter[]]
call[.acknowledge, parameter[member[.sIn], literal["Failed to send print file command"]]]
call[stream.writeTo, parameter[member[.sOut]]]
call[sOut.flush, parameter[]]
assign[member[.buffer], literal[0]]
call[sOut.write, parameter[member[.buffer], literal[0], literal[1]]]
call[sOut.flush, parameter[]]
call[.acknowledge, parameter[member[.sIn], literal["Failed to send print file"]]]
call[socketLpr.close, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[printStream] operator[SEP] Keyword[final] identifier[ByteArrayOutputStream] identifier[stream] , Keyword[final] identifier[String] identifier[hostName] , Keyword[final] identifier[String] identifier[printerName] , Keyword[final] identifier[String] identifier[documentName] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[controlFile] operator[=] literal[String] operator[SEP] Keyword[byte] identifier[buffer] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[1000] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[SEP] identifier[String] identifier[strJobNumber] operator[SEP] identifier[strJobNumber] operator[=] literal[String] operator[+] identifier[jobNumber] operator[SEP] Keyword[while] operator[SEP] identifier[strJobNumber] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] Other[3] operator[SEP] identifier[strJobNumber] operator[=] literal[String] operator[+] identifier[strJobNumber] operator[SEP] identifier[String] identifier[userName] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userName] operator[==] Other[null] operator[SEP] identifier[userName] operator[=] literal[String] operator[SEP] identifier[socketLpr] operator[SEP] identifier[setSoTimeout] operator[SEP] Other[30000] operator[SEP] operator[SEP] Keyword[final] identifier[OutputStream] identifier[sOut] operator[=] identifier[socketLpr] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[InputStream] identifier[sIn] operator[=] identifier[socketLpr] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[=] literal[String] operator[+] identifier[printerName] operator[+] literal[String] operator[SEP] identifier[sOut] operator[SEP] identifier[write] operator[SEP] identifier[s] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sOut] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[acknowledge] operator[SEP] identifier[sIn] , literal[String] operator[SEP] operator[SEP] identifier[controlFile] operator[+=] literal[String] operator[+] identifier[hostName] operator[+] literal[String] operator[SEP] identifier[controlFile] operator[+=] literal[String] operator[+] identifier[userName] operator[+] literal[String] operator[SEP] identifier[controlFile] operator[+=] operator[SEP] identifier[printRaw] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[strJobNumber] operator[+] identifier[hostName] operator[+] literal[String] operator[SEP] identifier[controlFile] operator[+=] literal[String] operator[+] identifier[strJobNumber] operator[+] identifier[hostName] operator[+] literal[String] operator[SEP] identifier[controlFile] operator[+=] literal[String] operator[+] identifier[documentName] operator[+] literal[String] operator[SEP] identifier[s] operator[=] literal[String] operator[+] identifier[controlFile] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[strJobNumber] operator[+] identifier[hostName] operator[+] literal[String] operator[SEP] identifier[sOut] operator[SEP] identifier[write] operator[SEP] identifier[s] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[acknowledge] operator[SEP] identifier[sIn] , literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[=] identifier[controlFile] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] identifier[sOut] operator[SEP] identifier[write] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] Other[0] operator[SEP] operator[=] Other[0] operator[SEP] identifier[sOut] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , Other[0] , Other[1] operator[SEP] operator[SEP] identifier[sOut] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[acknowledge] operator[SEP] identifier[sIn] , literal[String] operator[SEP] operator[SEP] identifier[s] operator[=] literal[String] operator[+] identifier[stream] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[strJobNumber] operator[+] identifier[hostName] operator[+] literal[String] operator[SEP] identifier[sOut] operator[SEP] identifier[write] operator[SEP] identifier[s] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sOut] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[acknowledge] operator[SEP] identifier[sIn] , literal[String] operator[SEP] operator[SEP] identifier[stream] operator[SEP] identifier[writeTo] operator[SEP] identifier[sOut] operator[SEP] operator[SEP] identifier[sOut] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] Other[0] operator[SEP] operator[=] Other[0] operator[SEP] identifier[sOut] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , Other[0] , Other[1] operator[SEP] operator[SEP] identifier[sOut] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[acknowledge] operator[SEP] identifier[sIn] , literal[String] operator[SEP] operator[SEP] identifier[socketLpr] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Accidental convertToAccidental(String accidental) throws IllegalArgumentException
{
if (accidental==null) return NONE;
else if (accidental.equals("^")
|| accidental.equals("#")
|| accidental.equals("\u266F")) return SHARP;
else if (accidental.equals("_")
|| accidental.equals("b")
|| accidental.equals("\u266D")) return FLAT;
else if (accidental.equals("=")
|| accidental.equals("\u266E")) return NATURAL;
else if (accidental.equals("^^")
|| accidental.equals("##")
|| accidental.equals("\u266F\u266F")) return DOUBLE_SHARP;
else if (accidental.equals("__")
|| accidental.equals("bb")
|| accidental.equals("\u266D\u266D")) return DOUBLE_FLAT;
else if (accidental.equals("^/")) return HALF_SHARP;
else if (accidental.equals("_/")) return HALF_FLAT;
else if (accidental.equals("^3/")
|| accidental.equals("^3/2")) return SHARP_AND_A_HALF;
else if (accidental.equals("_3/")
|| accidental.equals("_3/2")) return FLAT_AND_A_HALF;
else throw new IllegalArgumentException(accidental + " is not a valid accidental");
}
|
class class_name[name] begin[{]
method[convertToAccidental, return_type[type[Accidental]], modifier[public static], parameter[accidental]] begin[{]
if[binary_operation[member[.accidental], ==, literal[null]]] begin[{]
return[member[.NONE]]
else begin[{]
if[binary_operation[binary_operation[call[accidental.equals, parameter[literal["^"]]], ||, call[accidental.equals, parameter[literal["#"]]]], ||, call[accidental.equals, parameter[literal["♯"]]]]] begin[{]
return[member[.SHARP]]
else begin[{]
if[binary_operation[binary_operation[call[accidental.equals, parameter[literal["_"]]], ||, call[accidental.equals, parameter[literal["b"]]]], ||, call[accidental.equals, parameter[literal["♭"]]]]] begin[{]
return[member[.FLAT]]
else begin[{]
if[binary_operation[call[accidental.equals, parameter[literal["="]]], ||, call[accidental.equals, parameter[literal["♮"]]]]] begin[{]
return[member[.NATURAL]]
else begin[{]
if[binary_operation[binary_operation[call[accidental.equals, parameter[literal["^^"]]], ||, call[accidental.equals, parameter[literal["##"]]]], ||, call[accidental.equals, parameter[literal["♯♯"]]]]] begin[{]
return[member[.DOUBLE_SHARP]]
else begin[{]
if[binary_operation[binary_operation[call[accidental.equals, parameter[literal["__"]]], ||, call[accidental.equals, parameter[literal["bb"]]]], ||, call[accidental.equals, parameter[literal["♭♭"]]]]] begin[{]
return[member[.DOUBLE_FLAT]]
else begin[{]
if[call[accidental.equals, parameter[literal["^/"]]]] begin[{]
return[member[.HALF_SHARP]]
else begin[{]
if[call[accidental.equals, parameter[literal["_/"]]]] begin[{]
return[member[.HALF_FLAT]]
else begin[{]
if[binary_operation[call[accidental.equals, parameter[literal["^3/"]]], ||, call[accidental.equals, parameter[literal["^3/2"]]]]] begin[{]
return[member[.SHARP_AND_A_HALF]]
else begin[{]
if[binary_operation[call[accidental.equals, parameter[literal["_3/"]]], ||, call[accidental.equals, parameter[literal["_3/2"]]]]] begin[{]
return[member[.FLAT_AND_A_HALF]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=accidental, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a valid accidental"), 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[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Accidental] identifier[convertToAccidental] operator[SEP] identifier[String] identifier[accidental] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[if] operator[SEP] identifier[accidental] operator[==] Other[null] operator[SEP] Keyword[return] identifier[NONE] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[SHARP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[FLAT] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[NATURAL] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[DOUBLE_SHARP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[DOUBLE_FLAT] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[HALF_SHARP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[HALF_FLAT] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[SHARP_AND_A_HALF] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[accidental] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[FLAT_AND_A_HALF] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[accidental] operator[+] literal[String] operator[SEP] operator[SEP]
}
|
protected int getProximityPosition(int predicateIndex)
{
if(!isReverseAxes())
return super.getProximityPosition(predicateIndex);
// A negative predicate index seems to occur with
// (preceding-sibling::*|following-sibling::*)/ancestor::*[position()]/*[position()]
// -sb
if(predicateIndex < 0)
return -1;
if (m_proximityPositions[predicateIndex] <= 0)
{
XPathContext xctxt = getXPathContext();
try
{
OneStepIterator clone = (OneStepIterator) this.clone();
int root = getRoot();
xctxt.pushCurrentNode(root);
clone.setRoot(root, xctxt);
// clone.setPredicateCount(predicateIndex);
clone.m_predCount = predicateIndex;
// Count 'em all
int count = 1;
int next;
while (DTM.NULL != (next = clone.nextNode()))
{
count++;
}
m_proximityPositions[predicateIndex] += count;
}
catch (CloneNotSupportedException cnse)
{
// can't happen
}
finally
{
xctxt.popCurrentNode();
}
}
return m_proximityPositions[predicateIndex];
}
|
class class_name[name] begin[{]
method[getProximityPosition, return_type[type[int]], modifier[protected], parameter[predicateIndex]] begin[{]
if[call[.isReverseAxes, parameter[]]] begin[{]
return[SuperMethodInvocation(arguments=[MemberReference(member=predicateIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProximityPosition, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
else begin[{]
None
end[}]
if[binary_operation[member[.predicateIndex], <, literal[0]]] begin[{]
return[literal[1]]
else begin[{]
None
end[}]
if[binary_operation[member[.m_proximityPositions], <=, literal[0]]] begin[{]
local_variable[type[XPathContext], xctxt]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=clone, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=OneStepIterator, sub_type=None)), name=clone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OneStepIterator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=root)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushCurrentNode, postfix_operators=[], prefix_operators=[], qualifier=xctxt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xctxt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRoot, postfix_operators=[], prefix_operators=[], qualifier=clone, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_predCount, postfix_operators=[], prefix_operators=[], qualifier=clone, selectors=[]), type==, value=MemberReference(member=predicateIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=next)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=count, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=DTM, selectors=[]), operandr=Assignment(expressionl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=nextNode, postfix_operators=[], prefix_operators=[], qualifier=clone, selectors=[], type_arguments=None)), operator=!=), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_proximityPositions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=predicateIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnse, types=['CloneNotSupportedException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=popCurrentNode, postfix_operators=[], prefix_operators=[], qualifier=xctxt, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
return[member[.m_proximityPositions]]
end[}]
END[}]
|
Keyword[protected] Keyword[int] identifier[getProximityPosition] operator[SEP] Keyword[int] identifier[predicateIndex] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isReverseAxes] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[super] operator[SEP] identifier[getProximityPosition] operator[SEP] identifier[predicateIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[predicateIndex] operator[<] Other[0] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[m_proximityPositions] operator[SEP] identifier[predicateIndex] operator[SEP] operator[<=] Other[0] operator[SEP] {
identifier[XPathContext] identifier[xctxt] operator[=] identifier[getXPathContext] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[OneStepIterator] identifier[clone] operator[=] operator[SEP] identifier[OneStepIterator] operator[SEP] Keyword[this] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[root] operator[=] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[xctxt] operator[SEP] identifier[pushCurrentNode] operator[SEP] identifier[root] operator[SEP] operator[SEP] identifier[clone] operator[SEP] identifier[setRoot] operator[SEP] identifier[root] , identifier[xctxt] operator[SEP] operator[SEP] identifier[clone] operator[SEP] identifier[m_predCount] operator[=] identifier[predicateIndex] operator[SEP] Keyword[int] identifier[count] operator[=] Other[1] operator[SEP] Keyword[int] identifier[next] operator[SEP] Keyword[while] operator[SEP] identifier[DTM] operator[SEP] identifier[NULL] operator[!=] operator[SEP] identifier[next] operator[=] identifier[clone] operator[SEP] identifier[nextNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[count] operator[++] operator[SEP]
}
identifier[m_proximityPositions] operator[SEP] identifier[predicateIndex] operator[SEP] operator[+=] identifier[count] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CloneNotSupportedException] identifier[cnse] operator[SEP] {
}
Keyword[finally] {
identifier[xctxt] operator[SEP] identifier[popCurrentNode] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[m_proximityPositions] operator[SEP] identifier[predicateIndex] operator[SEP] operator[SEP]
}
|
private static CmsGalleryDataBean getGalleryDataFromDict() throws SerializationException {
return (CmsGalleryDataBean)CmsRpcPrefetcher.getSerializedObjectFromDictionary(
CmsGalleryController.getGalleryService(),
CmsGalleryDataBean.DICT_NAME);
}
|
class class_name[name] begin[{]
method[getGalleryDataFromDict, return_type[type[CmsGalleryDataBean]], modifier[private static], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGalleryService, postfix_operators=[], prefix_operators=[], qualifier=CmsGalleryController, selectors=[], type_arguments=None), MemberReference(member=DICT_NAME, postfix_operators=[], prefix_operators=[], qualifier=CmsGalleryDataBean, selectors=[])], member=getSerializedObjectFromDictionary, postfix_operators=[], prefix_operators=[], qualifier=CmsRpcPrefetcher, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CmsGalleryDataBean, sub_type=None))]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[CmsGalleryDataBean] identifier[getGalleryDataFromDict] operator[SEP] operator[SEP] Keyword[throws] identifier[SerializationException] {
Keyword[return] operator[SEP] identifier[CmsGalleryDataBean] operator[SEP] identifier[CmsRpcPrefetcher] operator[SEP] identifier[getSerializedObjectFromDictionary] operator[SEP] identifier[CmsGalleryController] operator[SEP] identifier[getGalleryService] operator[SEP] operator[SEP] , identifier[CmsGalleryDataBean] operator[SEP] identifier[DICT_NAME] operator[SEP] operator[SEP]
}
|
public void setDataAttribute(String key, Object newValue) {
cacheData.setCmpAttribute(key, newValue);
if (logger.isDebugEnabled()) {
logger.debug("Activity context with handle "
+ getActivityContextHandle() + " set cmp attribute named "
+ key + " to value " + newValue);
}
}
|
class class_name[name] begin[{]
method[setDataAttribute, return_type[void], modifier[public], parameter[key, newValue]] begin[{]
call[cacheData.setCmpAttribute, parameter[member[.key], member[.newValue]]]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Activity context with handle "], +, call[.getActivityContextHandle, parameter[]]], +, literal[" set cmp attribute named "]], +, member[.key]], +, literal[" to value "]], +, member[.newValue]]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setDataAttribute] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[newValue] operator[SEP] {
identifier[cacheData] operator[SEP] identifier[setCmpAttribute] operator[SEP] identifier[key] , identifier[newValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[getActivityContextHandle] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[newValue] operator[SEP] operator[SEP]
}
}
|
@Indexable(type = IndexableType.REINDEX)
@Override
public CommerceWishList updateCommerceWishList(
CommerceWishList commerceWishList) {
return commerceWishListPersistence.update(commerceWishList);
}
|
class class_name[name] begin[{]
method[updateCommerceWishList, return_type[type[CommerceWishList]], modifier[public], parameter[commerceWishList]] begin[{]
return[call[commerceWishListPersistence.update, parameter[member[.commerceWishList]]]]
end[}]
END[}]
|
annotation[@] identifier[Indexable] operator[SEP] identifier[type] operator[=] identifier[IndexableType] operator[SEP] identifier[REINDEX] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[CommerceWishList] identifier[updateCommerceWishList] operator[SEP] identifier[CommerceWishList] identifier[commerceWishList] operator[SEP] {
Keyword[return] identifier[commerceWishListPersistence] operator[SEP] identifier[update] operator[SEP] identifier[commerceWishList] operator[SEP] operator[SEP]
}
|
public static IAtomContainer getAtomContainer(IMolecularFormula formula, IAtomContainer atomContainer) {
for (IIsotope isotope : formula.isotopes()) {
int occur = formula.getIsotopeCount(isotope);
for (int i = 0; i < occur; i++) {
IAtom atom = formula.getBuilder().newInstance(IAtom.class, isotope);
atom.setImplicitHydrogenCount(0);
atomContainer.addAtom(atom);
}
}
return atomContainer;
}
|
class class_name[name] begin[{]
method[getAtomContainer, return_type[type[IAtomContainer]], modifier[public static], parameter[formula, atomContainer]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=isotope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIsotopeCount, postfix_operators=[], prefix_operators=[], qualifier=formula, selectors=[], type_arguments=None), name=occur)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBuilder, postfix_operators=[], prefix_operators=[], qualifier=formula, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IAtom, sub_type=None)), MemberReference(member=isotope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setImplicitHydrogenCount, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAtom, postfix_operators=[], prefix_operators=[], qualifier=atomContainer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=occur, 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)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=isotopes, postfix_operators=[], prefix_operators=[], qualifier=formula, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=isotope)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IIsotope, sub_type=None))), label=None)
return[member[.atomContainer]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[IAtomContainer] identifier[getAtomContainer] operator[SEP] identifier[IMolecularFormula] identifier[formula] , identifier[IAtomContainer] identifier[atomContainer] operator[SEP] {
Keyword[for] operator[SEP] identifier[IIsotope] identifier[isotope] operator[:] identifier[formula] operator[SEP] identifier[isotopes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[occur] operator[=] identifier[formula] operator[SEP] identifier[getIsotopeCount] operator[SEP] identifier[isotope] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[occur] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[IAtom] identifier[atom] operator[=] identifier[formula] operator[SEP] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[IAtom] operator[SEP] Keyword[class] , identifier[isotope] operator[SEP] operator[SEP] identifier[atom] operator[SEP] identifier[setImplicitHydrogenCount] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[atomContainer] operator[SEP] identifier[addAtom] operator[SEP] identifier[atom] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[atomContainer] operator[SEP]
}
|
GVRShader makeTemplate(Class<? extends GVRShader> id, GVRContext ctx)
{
try
{
Constructor<? extends GVRShader> maker = id.getDeclaredConstructor(GVRContext.class);
return maker.newInstance(ctx);
}
catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex)
{
try
{
Constructor<? extends GVRShader> maker = id.getDeclaredConstructor();
return maker.newInstance();
}
catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex2)
{
ctx.getEventManager().sendEvent(ctx, IErrorEvents.class, "onError", new Object[] {ex2.getMessage(), this});
return null;
}
}
}
|
class class_name[name] begin[{]
method[makeTemplate, return_type[type[GVRShader]], modifier[default], parameter[id, ctx]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GVRContext, sub_type=None))], member=getDeclaredConstructor, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), name=maker)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=GVRShader, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=maker, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDeclaredConstructor, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), name=maker)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=GVRShader, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=maker, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getEventManager, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IErrorEvents, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="onError"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex2, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=sendEvent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex2, types=['NoSuchMethodException', 'IllegalAccessException', 'InstantiationException', 'InvocationTargetException']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoSuchMethodException', 'IllegalAccessException', 'InstantiationException', 'InvocationTargetException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
identifier[GVRShader] identifier[makeTemplate] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[GVRShader] operator[>] identifier[id] , identifier[GVRContext] identifier[ctx] operator[SEP] {
Keyword[try] {
identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[GVRShader] operator[>] identifier[maker] operator[=] identifier[id] operator[SEP] identifier[getDeclaredConstructor] operator[SEP] identifier[GVRContext] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[maker] operator[SEP] identifier[newInstance] operator[SEP] identifier[ctx] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] operator[|] identifier[IllegalAccessException] operator[|] identifier[InstantiationException] operator[|] identifier[InvocationTargetException] identifier[ex] operator[SEP] {
Keyword[try] {
identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[GVRShader] operator[>] identifier[maker] operator[=] identifier[id] operator[SEP] identifier[getDeclaredConstructor] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[maker] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] operator[|] identifier[IllegalAccessException] operator[|] identifier[InstantiationException] operator[|] identifier[InvocationTargetException] identifier[ex2] operator[SEP] {
identifier[ctx] operator[SEP] identifier[getEventManager] operator[SEP] operator[SEP] operator[SEP] identifier[sendEvent] operator[SEP] identifier[ctx] , identifier[IErrorEvents] operator[SEP] Keyword[class] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[ex2] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , Keyword[this]
} operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
}
|
public DownloadMaterialResponse downloadMaterial(String mediaId, MaterialType type){
DownloadMaterialResponse response = new DownloadMaterialResponse();
String url = BASE_API_URL + "cgi-bin/material/get_material?access_token=" + config.getAccessToken();
RequestConfig config = RequestConfig.custom().setConnectionRequestTimeout(NetWorkCenter.CONNECT_TIMEOUT).setConnectTimeout(NetWorkCenter.CONNECT_TIMEOUT).setSocketTimeout(NetWorkCenter.CONNECT_TIMEOUT).build();
CloseableHttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(config).build();
HttpPost request = new HttpPost(url);
StringEntity mediaEntity = new StringEntity("{\"media_id\":\"" + mediaId + "\"}", ContentType.APPLICATION_JSON);
request.setEntity(mediaEntity);
CloseableHttpResponse httpResponse = null;
try{
httpResponse = client.execute(request);
if(HttpStatus.SC_OK == httpResponse.getStatusLine().getStatusCode()){
HttpEntity entity;
String resultJson;
switch (type){
case NEWS:
entity = httpResponse.getEntity();
resultJson = EntityUtils.toString(entity, Charset.forName("UTF-8"));
response = JSONUtil.toBean(resultJson, DownloadMaterialResponse.class);
LOG.debug("-----------------请求成功-----------------");
LOG.debug("响应结果:");
LOG.debug(resultJson);
if (StrUtil.isBlank(response.getErrcode())) {
response.setErrcode("0");
response.setErrmsg(resultJson);
}
break;
case VIDEO:
entity = httpResponse.getEntity();
resultJson = EntityUtils.toString(entity, Charset.forName("UTF-8"));
LOG.debug("-----------------请求成功-----------------");
LOG.debug("响应结果:");
LOG.debug(resultJson);
response = JSONUtil.toBean(resultJson, DownloadMaterialResponse.class);
if (StrUtil.isBlank(response.getErrcode())) {
response.setErrcode("0");
response.setErrmsg(resultJson);
// 通过down_url下载文件。文件放置在content中。通过writeTo方法获取
downloadVideo(response);
}
break;
default:
Header length = httpResponse.getHeaders("Content-Length")[0];
InputStream inputStream = httpResponse.getEntity().getContent();
response.setContent(inputStream, Integer.valueOf(length.getValue()));
break;
}
}else{
response.setErrcode(String.valueOf(httpResponse.getStatusLine().getStatusCode()));
response.setErrmsg("请求失败");
}
} catch (IOException e) {
LOG.error("IO流异常", e);
} catch (Exception e) {
LOG.error("其他异常", e);
}
return response;
}
|
class class_name[name] begin[{]
method[downloadMaterial, return_type[type[DownloadMaterialResponse]], modifier[public], parameter[mediaId, type]] begin[{]
local_variable[type[DownloadMaterialResponse], response]
local_variable[type[String], url]
local_variable[type[RequestConfig], config]
local_variable[type[CloseableHttpClient], client]
local_variable[type[HttpPost], request]
local_variable[type[StringEntity], mediaEntity]
call[request.setEntity, parameter[member[.mediaEntity]]]
local_variable[type[CloseableHttpResponse], httpResponse]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=httpResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SC_OK, postfix_operators=[], prefix_operators=[], qualifier=HttpStatus, selectors=[]), operandr=MethodInvocation(arguments=[], member=getStatusLine, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatusLine, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=setErrcode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="请求失败")], member=setErrmsg, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=entity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpEntity, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=resultJson)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=['NEWS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Charset, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=EntityUtils, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DownloadMaterialResponse, sub_type=None))], member=toBean, postfix_operators=[], prefix_operators=[], qualifier=JSONUtil, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-----------------请求成功-----------------")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="响应结果:")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getErrcode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StrUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0")], member=setErrcode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setErrmsg, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['VIDEO'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Charset, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=EntityUtils, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-----------------请求成功-----------------")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="响应结果:")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DownloadMaterialResponse, sub_type=None))], member=toBean, postfix_operators=[], prefix_operators=[], qualifier=JSONUtil, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getErrcode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StrUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0")], member=setErrcode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resultJson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setErrmsg, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=downloadVideo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-Length")], member=getHeaders, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None), name=length)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Header, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[MethodInvocation(arguments=[], member=getContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=inputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=length, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=setContent, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IO流异常"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="其他异常"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.response]]
end[}]
END[}]
|
Keyword[public] identifier[DownloadMaterialResponse] identifier[downloadMaterial] operator[SEP] identifier[String] identifier[mediaId] , identifier[MaterialType] identifier[type] operator[SEP] {
identifier[DownloadMaterialResponse] identifier[response] operator[=] Keyword[new] identifier[DownloadMaterialResponse] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[BASE_API_URL] operator[+] literal[String] operator[+] identifier[config] operator[SEP] identifier[getAccessToken] operator[SEP] operator[SEP] operator[SEP] identifier[RequestConfig] identifier[config] operator[=] identifier[RequestConfig] operator[SEP] identifier[custom] operator[SEP] operator[SEP] operator[SEP] identifier[setConnectionRequestTimeout] operator[SEP] identifier[NetWorkCenter] operator[SEP] identifier[CONNECT_TIMEOUT] operator[SEP] operator[SEP] identifier[setConnectTimeout] operator[SEP] identifier[NetWorkCenter] operator[SEP] identifier[CONNECT_TIMEOUT] operator[SEP] operator[SEP] identifier[setSocketTimeout] operator[SEP] identifier[NetWorkCenter] operator[SEP] identifier[CONNECT_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[config] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[HttpPost] identifier[request] operator[=] Keyword[new] identifier[HttpPost] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[StringEntity] identifier[mediaEntity] operator[=] Keyword[new] identifier[StringEntity] operator[SEP] literal[String] operator[+] identifier[mediaId] operator[+] literal[String] , identifier[ContentType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setEntity] operator[SEP] identifier[mediaEntity] operator[SEP] operator[SEP] identifier[CloseableHttpResponse] identifier[httpResponse] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[httpResponse] operator[=] identifier[client] operator[SEP] identifier[execute] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[HttpStatus] operator[SEP] identifier[SC_OK] operator[==] identifier[httpResponse] operator[SEP] identifier[getStatusLine] operator[SEP] operator[SEP] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] {
identifier[HttpEntity] identifier[entity] operator[SEP] identifier[String] identifier[resultJson] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] identifier[NEWS] operator[:] identifier[entity] operator[=] identifier[httpResponse] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[resultJson] operator[=] identifier[EntityUtils] operator[SEP] identifier[toString] operator[SEP] identifier[entity] , identifier[Charset] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] identifier[JSONUtil] operator[SEP] identifier[toBean] operator[SEP] identifier[resultJson] , identifier[DownloadMaterialResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[resultJson] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[response] operator[SEP] identifier[getErrcode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[response] operator[SEP] identifier[setErrcode] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setErrmsg] operator[SEP] identifier[resultJson] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[VIDEO] operator[:] identifier[entity] operator[=] identifier[httpResponse] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[resultJson] operator[=] identifier[EntityUtils] operator[SEP] identifier[toString] operator[SEP] identifier[entity] , identifier[Charset] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[resultJson] operator[SEP] operator[SEP] identifier[response] operator[=] identifier[JSONUtil] operator[SEP] identifier[toBean] operator[SEP] identifier[resultJson] , identifier[DownloadMaterialResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[response] operator[SEP] identifier[getErrcode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[response] operator[SEP] identifier[setErrcode] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setErrmsg] operator[SEP] identifier[resultJson] operator[SEP] operator[SEP] identifier[downloadVideo] operator[SEP] identifier[response] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[Header] identifier[length] operator[=] identifier[httpResponse] operator[SEP] identifier[getHeaders] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[InputStream] identifier[inputStream] operator[=] identifier[httpResponse] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setContent] operator[SEP] identifier[inputStream] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[length] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[else] {
identifier[response] operator[SEP] identifier[setErrcode] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[httpResponse] operator[SEP] identifier[getStatusLine] operator[SEP] operator[SEP] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setErrmsg] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[response] operator[SEP]
}
|
public DescribeMatchmakingResult withTicketList(MatchmakingTicket... ticketList) {
if (this.ticketList == null) {
setTicketList(new java.util.ArrayList<MatchmakingTicket>(ticketList.length));
}
for (MatchmakingTicket ele : ticketList) {
this.ticketList.add(ele);
}
return this;
}
|
class class_name[name] begin[{]
method[withTicketList, return_type[type[DescribeMatchmakingResult]], modifier[public], parameter[ticketList]] begin[{]
if[binary_operation[THIS[member[None.ticketList]], ==, literal[null]]] begin[{]
call[.setTicketList, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ticketList, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MatchmakingTicket, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=ticketList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=ticketList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MatchmakingTicket, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[DescribeMatchmakingResult] identifier[withTicketList] operator[SEP] identifier[MatchmakingTicket] operator[...] identifier[ticketList] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[ticketList] operator[==] Other[null] operator[SEP] {
identifier[setTicketList] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[MatchmakingTicket] operator[>] operator[SEP] identifier[ticketList] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[MatchmakingTicket] identifier[ele] operator[:] identifier[ticketList] operator[SEP] {
Keyword[this] operator[SEP] identifier[ticketList] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static boolean hasValidCppCharacters(String s) {
for (char c : s.toCharArray()) {
if (!isValidCppCharacter(c)) {
return false;
}
}
return true;
}
|
class class_name[name] begin[{]
method[hasValidCppCharacters, return_type[type[boolean]], modifier[public static], parameter[s]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isValidCppCharacter, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char))), label=None)
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[hasValidCppCharacters] operator[SEP] identifier[String] identifier[s] operator[SEP] {
Keyword[for] operator[SEP] Keyword[char] identifier[c] operator[:] identifier[s] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isValidCppCharacter] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static List<String> getInboundLayerNamesFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf) {
List<String> inboundLayerNames = new ArrayList<>();
if (layerConfig.containsKey(conf.getLAYER_FIELD_INBOUND_NODES())) {
List<Object> inboundNodes = (List<Object>) layerConfig.get(conf.getLAYER_FIELD_INBOUND_NODES());
if (!inboundNodes.isEmpty()) {
inboundNodes = (List<Object>) inboundNodes.get(0);
for (Object o : inboundNodes) {
String nodeName = (String) ((List<Object>) o).get(0);
inboundLayerNames.add(nodeName);
}
}
}
return inboundLayerNames;
}
|
class class_name[name] begin[{]
method[getInboundLayerNamesFromConfig, return_type[type[List]], modifier[public static], parameter[layerConfig, conf]] begin[{]
local_variable[type[List], inboundLayerNames]
if[call[layerConfig.containsKey, parameter[call[conf.getLAYER_FIELD_INBOUND_NODES, parameter[]]]]] begin[{]
local_variable[type[List], inboundNodes]
if[call[inboundNodes.isEmpty, parameter[]]] begin[{]
assign[member[.inboundNodes], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=inboundNodes, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=nodeName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=inboundLayerNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=inboundNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.inboundLayerNames]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[getInboundLayerNamesFromConfig] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[layerConfig] , identifier[KerasLayerConfiguration] identifier[conf] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[inboundLayerNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[layerConfig] operator[SEP] identifier[containsKey] operator[SEP] identifier[conf] operator[SEP] identifier[getLAYER_FIELD_INBOUND_NODES] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Object] operator[>] identifier[inboundNodes] operator[=] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] operator[SEP] identifier[layerConfig] operator[SEP] identifier[get] operator[SEP] identifier[conf] operator[SEP] identifier[getLAYER_FIELD_INBOUND_NODES] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[inboundNodes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[inboundNodes] operator[=] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] operator[SEP] identifier[inboundNodes] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[o] operator[:] identifier[inboundNodes] operator[SEP] {
identifier[String] identifier[nodeName] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[inboundLayerNames] operator[SEP] identifier[add] operator[SEP] identifier[nodeName] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[inboundLayerNames] operator[SEP]
}
|
public boolean isParentAnEmptyDirectory(File file) {
File parent = file.getParentFile();
if (parent != null && parent.exists() && parent.isDirectory() && parent.list().length == 0) {
return true;
}
return false;
}
|
class class_name[name] begin[{]
method[isParentAnEmptyDirectory, return_type[type[boolean]], modifier[public], parameter[file]] begin[{]
local_variable[type[File], parent]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.parent], !=, literal[null]], &&, call[parent.exists, parameter[]]], &&, call[parent.isDirectory, parameter[]]], &&, binary_operation[call[parent.list, parameter[]], ==, literal[0]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[isParentAnEmptyDirectory] operator[SEP] identifier[File] identifier[file] operator[SEP] {
identifier[File] identifier[parent] operator[=] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[&&] identifier[parent] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[parent] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[&&] identifier[parent] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public TemporalDependencyMatrix calculateTemporalDistance(GroupElement groupElement) {
// find the events
List<Pattern> events = new ArrayList<Pattern>();
selectAllEventPatterns( events,
groupElement );
final int size = events.size();
if ( size >= 1 ) {
// create the matrix
Interval[][] source = new Interval[size][];
for ( int row = 0; row < size; row++ ) {
source[row] = new Interval[size];
for ( int col = 0; col < size; col++ ) {
if ( row == col ) {
source[row][col] = new Interval( 0,
0 );
} else {
source[row][col] = new Interval( Interval.MIN,
Interval.MAX );
}
}
}
Interval[][] result;
if ( size > 1 ) {
List<Declaration> declarations = new ArrayList<Declaration>();
int eventIndex = 0;
// populate the matrix
for ( Pattern event : events ) {
// references to other events are always backward references, so we can build the list as we go
declarations.add( event.getDeclaration() );
Map<Declaration, Interval> temporal = new HashMap<Declaration, Interval>();
gatherTemporalRelationships( event.getConstraints(),
temporal );
// intersects default values with the actual constrained intervals
for ( Map.Entry<Declaration, Interval> entry : temporal.entrySet() ) {
int targetIndex = declarations.indexOf( entry.getKey() );
Interval interval = entry.getValue();
source[targetIndex][eventIndex].intersect( interval );
Interval reverse = new Interval( interval.getUpperBound() == Long.MAX_VALUE ? Long.MIN_VALUE : -interval.getUpperBound(),
interval.getLowerBound() == Long.MIN_VALUE ? Long.MAX_VALUE : -interval.getLowerBound() );
source[eventIndex][targetIndex].intersect( reverse );
}
eventIndex++;
}
result = TimeUtils.calculateTemporalDistance( source );
} else {
result = source;
}
return new TemporalDependencyMatrix( result, events );
}
return null;
}
|
class class_name[name] begin[{]
method[calculateTemporalDistance, return_type[type[TemporalDependencyMatrix]], modifier[public], parameter[groupElement]] begin[{]
local_variable[type[List], events]
call[.selectAllEventPatterns, parameter[member[.events], member[.groupElement]]]
local_variable[type[int], size]
if[binary_operation[member[.size], >=, literal[1]]] begin[{]
local_variable[type[Interval], source]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ArrayCreator(dimensions=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Interval, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=MIN, postfix_operators=[], prefix_operators=[], qualifier=Interval, selectors=[]), MemberReference(member=MAX, postfix_operators=[], prefix_operators=[], qualifier=Interval, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Interval, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Interval, sub_type=None))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=col)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=col, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, 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=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[Interval], result]
if[binary_operation[member[.size], >, literal[1]]] begin[{]
local_variable[type[List], declarations]
local_variable[type[int], eventIndex]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeclaration, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=declarations, selectors=[], type_arguments=None), label=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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Declaration, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Interval, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), name=temporal)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Declaration, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Interval, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConstraints, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), MemberReference(member=temporal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=gatherTemporalRelationships, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=declarations, selectors=[], type_arguments=None), name=targetIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=interval)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Interval, sub_type=None)), StatementExpression(expression=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=targetIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=eventIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intersect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getUpperBound, postfix_operators=[], prefix_operators=[], qualifier=interval, selectors=[], type_arguments=None), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator===), if_false=MethodInvocation(arguments=[], member=getUpperBound, postfix_operators=[], prefix_operators=['-'], qualifier=interval, selectors=[], type_arguments=None), if_true=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[])), TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLowerBound, postfix_operators=[], prefix_operators=[], qualifier=interval, selectors=[], type_arguments=None), operandr=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator===), if_false=MethodInvocation(arguments=[], member=getLowerBound, postfix_operators=[], prefix_operators=['-'], qualifier=interval, selectors=[], type_arguments=None), if_true=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Interval, sub_type=None)), name=reverse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Interval, sub_type=None)), StatementExpression(expression=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=eventIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=targetIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=reverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intersect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=temporal, selectors=[], 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=Declaration, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Interval, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=MemberReference(member=eventIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=event)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None))), label=None)
assign[member[.result], call[TimeUtils.calculateTemporalDistance, parameter[member[.source]]]]
else begin[{]
assign[member[.result], member[.source]]
end[}]
return[ClassCreator(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=events, 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=TemporalDependencyMatrix, sub_type=None))]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[public] identifier[TemporalDependencyMatrix] identifier[calculateTemporalDistance] operator[SEP] identifier[GroupElement] identifier[groupElement] operator[SEP] {
identifier[List] operator[<] identifier[Pattern] operator[>] identifier[events] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Pattern] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[selectAllEventPatterns] operator[SEP] identifier[events] , identifier[groupElement] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[size] operator[=] identifier[events] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>=] Other[1] operator[SEP] {
identifier[Interval] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[source] operator[=] Keyword[new] identifier[Interval] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[row] operator[=] Other[0] operator[SEP] identifier[row] operator[<] identifier[size] operator[SEP] identifier[row] operator[++] operator[SEP] {
identifier[source] operator[SEP] identifier[row] operator[SEP] operator[=] Keyword[new] identifier[Interval] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[col] operator[=] Other[0] operator[SEP] identifier[col] operator[<] identifier[size] operator[SEP] identifier[col] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[row] operator[==] identifier[col] operator[SEP] {
identifier[source] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[col] operator[SEP] operator[=] Keyword[new] identifier[Interval] operator[SEP] Other[0] , Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[source] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[col] operator[SEP] operator[=] Keyword[new] identifier[Interval] operator[SEP] identifier[Interval] operator[SEP] identifier[MIN] , identifier[Interval] operator[SEP] identifier[MAX] operator[SEP] operator[SEP]
}
}
}
identifier[Interval] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>] Other[1] operator[SEP] {
identifier[List] operator[<] identifier[Declaration] operator[>] identifier[declarations] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Declaration] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[eventIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Pattern] identifier[event] operator[:] identifier[events] operator[SEP] {
identifier[declarations] operator[SEP] identifier[add] operator[SEP] identifier[event] operator[SEP] identifier[getDeclaration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Declaration] , identifier[Interval] operator[>] identifier[temporal] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Declaration] , identifier[Interval] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[gatherTemporalRelationships] operator[SEP] identifier[event] operator[SEP] identifier[getConstraints] operator[SEP] operator[SEP] , identifier[temporal] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Declaration] , identifier[Interval] operator[>] identifier[entry] operator[:] identifier[temporal] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[targetIndex] operator[=] identifier[declarations] operator[SEP] identifier[indexOf] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Interval] identifier[interval] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[source] operator[SEP] identifier[targetIndex] operator[SEP] operator[SEP] identifier[eventIndex] operator[SEP] operator[SEP] identifier[intersect] operator[SEP] identifier[interval] operator[SEP] operator[SEP] identifier[Interval] identifier[reverse] operator[=] Keyword[new] identifier[Interval] operator[SEP] identifier[interval] operator[SEP] identifier[getUpperBound] operator[SEP] operator[SEP] operator[==] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[?] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[:] operator[-] identifier[interval] operator[SEP] identifier[getUpperBound] operator[SEP] operator[SEP] , identifier[interval] operator[SEP] identifier[getLowerBound] operator[SEP] operator[SEP] operator[==] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[?] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[:] operator[-] identifier[interval] operator[SEP] identifier[getLowerBound] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[source] operator[SEP] identifier[eventIndex] operator[SEP] operator[SEP] identifier[targetIndex] operator[SEP] operator[SEP] identifier[intersect] operator[SEP] identifier[reverse] operator[SEP] operator[SEP]
}
identifier[eventIndex] operator[++] operator[SEP]
}
identifier[result] operator[=] identifier[TimeUtils] operator[SEP] identifier[calculateTemporalDistance] operator[SEP] identifier[source] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[result] operator[=] identifier[source] operator[SEP]
}
Keyword[return] Keyword[new] identifier[TemporalDependencyMatrix] operator[SEP] identifier[result] , identifier[events] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public LinkedHashMap<String, String> buildHttpArguments(){
//Init http arguments
LinkedHashMap<String, String> httpArguments = new LinkedHashMap<String,String>();
return httpArguments;
}
|
class class_name[name] begin[{]
method[buildHttpArguments, return_type[type[LinkedHashMap]], modifier[public], parameter[]] begin[{]
local_variable[type[LinkedHashMap], httpArguments]
return[member[.httpArguments]]
end[}]
END[}]
|
Keyword[public] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[buildHttpArguments] operator[SEP] operator[SEP] {
identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[httpArguments] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[httpArguments] operator[SEP]
}
|
public Map<String, Object> validateTokenAndGetClaims(final String token) {
final CommonProfile profile = validateToken(token);
final Map<String, Object> claims = new HashMap<>(profile.getAttributes());
claims.put(JwtClaims.SUBJECT, profile.getId());
return claims;
}
|
class class_name[name] begin[{]
method[validateTokenAndGetClaims, return_type[type[Map]], modifier[public], parameter[token]] begin[{]
local_variable[type[CommonProfile], profile]
local_variable[type[Map], claims]
call[claims.put, parameter[member[JwtClaims.SUBJECT], call[profile.getId, parameter[]]]]
return[member[.claims]]
end[}]
END[}]
|
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[validateTokenAndGetClaims] operator[SEP] Keyword[final] identifier[String] identifier[token] operator[SEP] {
Keyword[final] identifier[CommonProfile] identifier[profile] operator[=] identifier[validateToken] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[claims] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[profile] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[claims] operator[SEP] identifier[put] operator[SEP] identifier[JwtClaims] operator[SEP] identifier[SUBJECT] , identifier[profile] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[claims] operator[SEP]
}
|
public static int cudaHostGetDevicePointer(Pointer pDevice, Pointer pHost, int flags)
{
return checkResult(cudaHostGetDevicePointerNative(pDevice, pHost, flags));
}
|
class class_name[name] begin[{]
method[cudaHostGetDevicePointer, return_type[type[int]], modifier[public static], parameter[pDevice, pHost, flags]] begin[{]
return[call[.checkResult, parameter[call[.cudaHostGetDevicePointerNative, parameter[member[.pDevice], member[.pHost], member[.flags]]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[int] identifier[cudaHostGetDevicePointer] operator[SEP] identifier[Pointer] identifier[pDevice] , identifier[Pointer] identifier[pHost] , Keyword[int] identifier[flags] operator[SEP] {
Keyword[return] identifier[checkResult] operator[SEP] identifier[cudaHostGetDevicePointerNative] operator[SEP] identifier[pDevice] , identifier[pHost] , identifier[flags] operator[SEP] operator[SEP] operator[SEP]
}
|
@CheckForNull
@Restricted(NoExternalUse.class)
public String checkJavaVersion(final PrintStream logger, String javaCommand,
final BufferedReader r, final StringWriter output) throws IOException {
String line;
while (null != (line = r.readLine())) {
output.write(line);
output.write("\n");
line = line.toLowerCase(Locale.ENGLISH);
if (line.startsWith("java version \"") || line.startsWith("openjdk version \"")) {
final String versionStr = line.substring(line.indexOf('\"') + 1, line.lastIndexOf('\"'));
logger.println(Messages.SSHLauncher_JavaVersionResult(SSHLauncher.getTimestamp(), javaCommand, versionStr));
// parse as a number and we should be OK as all we care about is up through the first dot.
final VersionNumber minJavaLevel = JavaProvider.getMinJavaLevel();
try {
final Number version = NumberFormat.getNumberInstance(Locale.US).parse(versionStr);
//TODO: burn it with fire
if(version.doubleValue() < Double.parseDouble("1."+minJavaLevel)) {
throw new IOException(Messages.SSHLauncher_NoJavaFound2(line, minJavaLevel.toString()));
}
} catch(final ParseException e) {
throw new IOException(Messages.SSHLauncher_NoJavaFound2(line, minJavaLevel));
}
return javaCommand;
}
}
return null;
}
|
class class_name[name] begin[{]
method[checkJavaVersion, return_type[type[String]], modifier[public], parameter[logger, javaCommand, r, output]] begin[{]
local_variable[type[String], line]
while[binary_operation[literal[null], !=, assign[member[.line], call[r.readLine, parameter[]]]]] begin[{]
call[output.write, parameter[member[.line]]]
call[output.write, parameter[literal["\n"]]]
assign[member[.line], call[line.toLowerCase, parameter[member[Locale.ENGLISH]]]]
if[binary_operation[call[line.startsWith, parameter[literal["java version \""]]], ||, call[line.startsWith, parameter[literal["openjdk version \""]]]]] begin[{]
local_variable[type[String], versionStr]
call[logger.println, parameter[call[Messages.SSHLauncher_JavaVersionResult, parameter[call[SSHLauncher.getTimestamp, parameter[]], member[.javaCommand], member[.versionStr]]]]]
local_variable[type[VersionNumber], minJavaLevel]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=US, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[])], member=getNumberInstance, postfix_operators=[], prefix_operators=[], qualifier=NumberFormat, selectors=[MethodInvocation(arguments=[MemberReference(member=versionStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=version)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=version, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1."), operandr=MemberReference(member=minJavaLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=parseDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=minJavaLevel, selectors=[], type_arguments=None)], member=SSHLauncher_NoJavaFound2, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minJavaLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=SSHLauncher_NoJavaFound2, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None)
return[member[.javaCommand]]
else begin[{]
None
end[}]
end[}]
return[literal[null]]
end[}]
END[}]
|
annotation[@] identifier[CheckForNull] annotation[@] identifier[Restricted] operator[SEP] identifier[NoExternalUse] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[String] identifier[checkJavaVersion] operator[SEP] Keyword[final] identifier[PrintStream] identifier[logger] , identifier[String] identifier[javaCommand] , Keyword[final] identifier[BufferedReader] identifier[r] , Keyword[final] identifier[StringWriter] identifier[output] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] Other[null] operator[!=] operator[SEP] identifier[line] operator[=] identifier[r] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[output] operator[SEP] identifier[write] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[line] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[versionStr] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] identifier[line] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] , identifier[line] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[SSHLauncher_JavaVersionResult] operator[SEP] identifier[SSHLauncher] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] , identifier[javaCommand] , identifier[versionStr] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[VersionNumber] identifier[minJavaLevel] operator[=] identifier[JavaProvider] operator[SEP] identifier[getMinJavaLevel] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[final] identifier[Number] identifier[version] operator[=] identifier[NumberFormat] operator[SEP] identifier[getNumberInstance] operator[SEP] identifier[Locale] operator[SEP] identifier[US] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[versionStr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[<] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] literal[String] operator[+] identifier[minJavaLevel] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[Messages] operator[SEP] identifier[SSHLauncher_NoJavaFound2] operator[SEP] identifier[line] , identifier[minJavaLevel] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[ParseException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[Messages] operator[SEP] identifier[SSHLauncher_NoJavaFound2] operator[SEP] identifier[line] , identifier[minJavaLevel] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[javaCommand] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public EClass getIfcConversionBasedUnit() {
if (ifcConversionBasedUnitEClass == null) {
ifcConversionBasedUnitEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(118);
}
return ifcConversionBasedUnitEClass;
}
|
class class_name[name] begin[{]
method[getIfcConversionBasedUnit, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcConversionBasedUnitEClass], ==, literal[null]]] begin[{]
assign[member[.ifcConversionBasedUnitEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=118)], 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[.ifcConversionBasedUnitEClass]]
end[}]
END[}]
|
Keyword[public] identifier[EClass] identifier[getIfcConversionBasedUnit] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcConversionBasedUnitEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcConversionBasedUnitEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[118] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcConversionBasedUnitEClass] operator[SEP]
}
|
public final Transaction beginTransaction(SessionName session, TransactionOptions options) {
BeginTransactionRequest request =
BeginTransactionRequest.newBuilder()
.setSession(session == null ? null : session.toString())
.setOptions(options)
.build();
return beginTransaction(request);
}
|
class class_name[name] begin[{]
method[beginTransaction, return_type[type[Transaction]], modifier[final public], parameter[session, options]] begin[{]
local_variable[type[BeginTransactionRequest], request]
return[call[.beginTransaction, parameter[member[.request]]]]
end[}]
END[}]
|
Keyword[public] Keyword[final] identifier[Transaction] identifier[beginTransaction] operator[SEP] identifier[SessionName] identifier[session] , identifier[TransactionOptions] identifier[options] operator[SEP] {
identifier[BeginTransactionRequest] identifier[request] operator[=] identifier[BeginTransactionRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setSession] operator[SEP] identifier[session] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[session] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setOptions] operator[SEP] identifier[options] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[beginTransaction] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static OAuth20ResponseModeTypes getResponseModeType(final J2EContext context) {
val responseType = context.getRequestParameter(OAuth20Constants.RESPONSE_MODE);
val type = Arrays.stream(OAuth20ResponseModeTypes.values())
.filter(t -> t.getType().equalsIgnoreCase(responseType))
.findFirst()
.orElse(OAuth20ResponseModeTypes.NONE);
LOGGER.debug("OAuth response type is [{}]", type);
return type;
}
|
class class_name[name] begin[{]
method[getResponseModeType, return_type[type[OAuth20ResponseModeTypes]], modifier[public static], parameter[context]] begin[{]
local_variable[type[val], responseType]
local_variable[type[val], type]
call[LOGGER.debug, parameter[literal["OAuth response type is [{}]"], member[.type]]]
return[member[.type]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[OAuth20ResponseModeTypes] identifier[getResponseModeType] operator[SEP] Keyword[final] identifier[J2EContext] identifier[context] operator[SEP] {
identifier[val] identifier[responseType] operator[=] identifier[context] operator[SEP] identifier[getRequestParameter] operator[SEP] identifier[OAuth20Constants] operator[SEP] identifier[RESPONSE_MODE] operator[SEP] operator[SEP] identifier[val] identifier[type] operator[=] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[OAuth20ResponseModeTypes] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[t] operator[->] identifier[t] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[responseType] operator[SEP] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] identifier[OAuth20ResponseModeTypes] operator[SEP] identifier[NONE] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[type] operator[SEP]
}
|
public String getPressCommand (int keyCode)
{
KeyRecord krec = _keys.get(keyCode);
return (krec == null) ? null : krec.pressCommand;
}
|
class class_name[name] begin[{]
method[getPressCommand, return_type[type[String]], modifier[public], parameter[keyCode]] begin[{]
local_variable[type[KeyRecord], krec]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=krec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=pressCommand, postfix_operators=[], prefix_operators=[], qualifier=krec, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[getPressCommand] operator[SEP] Keyword[int] identifier[keyCode] operator[SEP] {
identifier[KeyRecord] identifier[krec] operator[=] identifier[_keys] operator[SEP] identifier[get] operator[SEP] identifier[keyCode] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[krec] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[krec] operator[SEP] identifier[pressCommand] operator[SEP]
}
|
public static int optionLength(final String option) {
// Any arguments used for the doclet need to be recognized here. Many javadoc plugins (ie. gradle)
// automatically add some such as "-doctitle", "-windowtitle", which we ignore.
if (option.equals(DOC_TITLE_OPTION) ||
option.equals(WINDOW_TITLE_OPTION) ||
option.equals(SETTINGS_DIR_OPTION) ||
option.equals(DESTINATION_DIR_OPTION) ||
option.equals(BUILD_TIMESTAMP_OPTION) ||
option.equals(ABSOLUTE_VERSION_OPTION) ||
option.equals(OUTPUT_FILE_EXTENSION_OPTION) ||
option.equals(INDEX_FILE_EXTENSION_OPTION)) {
return 2;
} else if (option.equals(QUIET_OPTION) ||
option.equals(USE_DEFAULT_TEMPLATES_OPTION)) {
return 1;
} else {
logger.error("The Javadoc command line option is not recognized by the Barclay doclet: " + option);
return 0;
}
}
|
class class_name[name] begin[{]
method[optionLength, return_type[type[int]], modifier[public static], parameter[option]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[option.equals, parameter[member[.DOC_TITLE_OPTION]]], ||, call[option.equals, parameter[member[.WINDOW_TITLE_OPTION]]]], ||, call[option.equals, parameter[member[.SETTINGS_DIR_OPTION]]]], ||, call[option.equals, parameter[member[.DESTINATION_DIR_OPTION]]]], ||, call[option.equals, parameter[member[.BUILD_TIMESTAMP_OPTION]]]], ||, call[option.equals, parameter[member[.ABSOLUTE_VERSION_OPTION]]]], ||, call[option.equals, parameter[member[.OUTPUT_FILE_EXTENSION_OPTION]]]], ||, call[option.equals, parameter[member[.INDEX_FILE_EXTENSION_OPTION]]]]] begin[{]
return[literal[2]]
else begin[{]
if[binary_operation[call[option.equals, parameter[member[.QUIET_OPTION]]], ||, call[option.equals, parameter[member[.USE_DEFAULT_TEMPLATES_OPTION]]]]] begin[{]
return[literal[1]]
else begin[{]
call[logger.error, parameter[binary_operation[literal["The Javadoc command line option is not recognized by the Barclay doclet: "], +, member[.option]]]]
return[literal[0]]
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[int] identifier[optionLength] operator[SEP] Keyword[final] identifier[String] identifier[option] operator[SEP] {
Keyword[if] operator[SEP] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[DOC_TITLE_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[WINDOW_TITLE_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[SETTINGS_DIR_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[DESTINATION_DIR_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[BUILD_TIMESTAMP_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[ABSOLUTE_VERSION_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[OUTPUT_FILE_EXTENSION_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[INDEX_FILE_EXTENSION_OPTION] operator[SEP] operator[SEP] {
Keyword[return] Other[2] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[QUIET_OPTION] operator[SEP] operator[||] identifier[option] operator[SEP] identifier[equals] operator[SEP] identifier[USE_DEFAULT_TEMPLATES_OPTION] operator[SEP] operator[SEP] {
Keyword[return] Other[1] operator[SEP]
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[option] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP]
}
}
|
public static <T> T checkPrecondition(
final T value,
final ContractConditionType<T> condition)
throws PreconditionViolationException
{
return checkPrecondition(
value, condition.predicate(), condition.describer());
}
|
class class_name[name] begin[{]
method[checkPrecondition, return_type[type[T]], modifier[public static], parameter[value, condition]] begin[{]
return[call[.checkPrecondition, parameter[member[.value], call[condition.predicate, parameter[]], call[condition.describer, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[checkPrecondition] operator[SEP] Keyword[final] identifier[T] identifier[value] , Keyword[final] identifier[ContractConditionType] operator[<] identifier[T] operator[>] identifier[condition] operator[SEP] Keyword[throws] identifier[PreconditionViolationException] {
Keyword[return] identifier[checkPrecondition] operator[SEP] identifier[value] , identifier[condition] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] , identifier[condition] operator[SEP] identifier[describer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public double getProd() {
double prod = s.one();
for (int c = 0; c < this.values.length; c++) {
prod = s.times(prod, values[c]);
}
return prod;
}
|
class class_name[name] begin[{]
method[getProd, return_type[type[double]], modifier[public], parameter[]] begin[{]
local_variable[type[double], prod]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=prod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=times, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=values, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.prod]]
end[}]
END[}]
|
Keyword[public] Keyword[double] identifier[getProd] operator[SEP] operator[SEP] {
Keyword[double] identifier[prod] operator[=] identifier[s] operator[SEP] identifier[one] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] Keyword[this] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[SEP] identifier[c] operator[++] operator[SEP] {
identifier[prod] operator[=] identifier[s] operator[SEP] identifier[times] operator[SEP] identifier[prod] , identifier[values] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[prod] operator[SEP]
}
|
protected void activate(Map<String, Object> properties, ComponentContext context) {
sslOptions.activate(context);
sslFactoryProvider.activate(context);
wsocChain.init(WS_CHAIN_NAME, chfw.getFramework());
wsocSecureChain.init(WSS_CHAIN_NAME, chfw.getFramework());
modified(properties);
}
|
class class_name[name] begin[{]
method[activate, return_type[void], modifier[protected], parameter[properties, context]] begin[{]
call[sslOptions.activate, parameter[member[.context]]]
call[sslFactoryProvider.activate, parameter[member[.context]]]
call[wsocChain.init, parameter[member[.WS_CHAIN_NAME], call[chfw.getFramework, parameter[]]]]
call[wsocSecureChain.init, parameter[member[.WSS_CHAIN_NAME], call[chfw.getFramework, parameter[]]]]
call[.modified, parameter[member[.properties]]]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[activate] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] , identifier[ComponentContext] identifier[context] operator[SEP] {
identifier[sslOptions] operator[SEP] identifier[activate] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[sslFactoryProvider] operator[SEP] identifier[activate] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[wsocChain] operator[SEP] identifier[init] operator[SEP] identifier[WS_CHAIN_NAME] , identifier[chfw] operator[SEP] identifier[getFramework] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[wsocSecureChain] operator[SEP] identifier[init] operator[SEP] identifier[WSS_CHAIN_NAME] , identifier[chfw] operator[SEP] identifier[getFramework] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[modified] operator[SEP] identifier[properties] operator[SEP] operator[SEP]
}
|
public void fit(@NonNull MultiDataSetIterator iterator) {
List<S.Builder> featureNormBuilders = new ArrayList<>();
List<S.Builder> labelNormBuilders = new ArrayList<>();
iterator.reset();
while (iterator.hasNext()) {
MultiDataSet next = iterator.next();
fitPartial(next, featureNormBuilders, labelNormBuilders);
}
featureStats = buildList(featureNormBuilders);
if (isFitLabel()) {
labelStats = buildList(labelNormBuilders);
}
}
|
class class_name[name] begin[{]
method[fit, return_type[void], modifier[public], parameter[iterator]] begin[{]
local_variable[type[List], featureNormBuilders]
local_variable[type[List], labelNormBuilders]
call[iterator.reset, parameter[]]
while[call[iterator.hasNext, parameter[]]] begin[{]
local_variable[type[MultiDataSet], next]
call[.fitPartial, parameter[member[.next], member[.featureNormBuilders], member[.labelNormBuilders]]]
end[}]
assign[member[.featureStats], call[.buildList, parameter[member[.featureNormBuilders]]]]
if[call[.isFitLabel, parameter[]]] begin[{]
assign[member[.labelStats], call[.buildList, parameter[member[.labelNormBuilders]]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[fit] operator[SEP] annotation[@] identifier[NonNull] identifier[MultiDataSetIterator] identifier[iterator] operator[SEP] {
identifier[List] operator[<] identifier[S] operator[SEP] identifier[Builder] operator[>] identifier[featureNormBuilders] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[S] operator[SEP] identifier[Builder] operator[>] identifier[labelNormBuilders] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[MultiDataSet] identifier[next] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[fitPartial] operator[SEP] identifier[next] , identifier[featureNormBuilders] , identifier[labelNormBuilders] operator[SEP] operator[SEP]
}
identifier[featureStats] operator[=] identifier[buildList] operator[SEP] identifier[featureNormBuilders] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isFitLabel] operator[SEP] operator[SEP] operator[SEP] {
identifier[labelStats] operator[=] identifier[buildList] operator[SEP] identifier[labelNormBuilders] operator[SEP] operator[SEP]
}
}
|
public static HtmlTree SCRIPT(String src) {
HtmlTree htmltree = HtmlTree.SCRIPT();
htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
return htmltree;
}
|
class class_name[name] begin[{]
method[SCRIPT, return_type[type[HtmlTree]], modifier[public static], parameter[src]] begin[{]
local_variable[type[HtmlTree], htmltree]
call[htmltree.addAttr, parameter[member[HtmlAttr.SRC], call[.nullCheck, parameter[member[.src]]]]]
return[member[.htmltree]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[HtmlTree] identifier[SCRIPT] operator[SEP] identifier[String] identifier[src] operator[SEP] {
identifier[HtmlTree] identifier[htmltree] operator[=] identifier[HtmlTree] operator[SEP] identifier[SCRIPT] operator[SEP] operator[SEP] operator[SEP] identifier[htmltree] operator[SEP] identifier[addAttr] operator[SEP] identifier[HtmlAttr] operator[SEP] identifier[SRC] , identifier[nullCheck] operator[SEP] identifier[src] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[htmltree] operator[SEP]
}
|
public String getProperty(String key) {
String v = propertiesMap.get(key);
if (v != null) {
return v;
} else {
return context.getProperty(key);
}
}
|
class class_name[name] begin[{]
method[getProperty, return_type[type[String]], modifier[public], parameter[key]] begin[{]
local_variable[type[String], v]
if[binary_operation[member[.v], !=, literal[null]]] begin[{]
return[member[.v]]
else begin[{]
return[call[context.getProperty, parameter[member[.key]]]]
end[}]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[getProperty] operator[SEP] identifier[String] identifier[key] operator[SEP] {
identifier[String] identifier[v] operator[=] identifier[propertiesMap] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[v] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[context] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.